Help us improve
Share bugs, ideas, or general feedback.
From trustabl
Applies Trustabl scan findings directly to source files: adds missing guardrails, docstrings, timeouts, and type annotations; corrects unsafe patterns and misconfigurations. Use after `trustabl scan` to automate remediation without manual editing.
npx claudepluginhub trustabl/trustabl --plugin trustablHow this skill is triggered — by the user, by Claude, or both
Slash command
/trustabl:trustabl-enrichThe summary Claude sees in its skill listing — used to decide when to auto-load this skill
Applies Trustabl scan findings directly to source files. "Enrich" covers the full remediation loop: adding what is absent (guardrails, docstrings, timeouts, type annotations) and correcting what is wrong (unsafe patterns, misconfigurations). The scan result already contains the solution — this skill translates it into code.
Self-audits AI agent, tool, subagent, and MCP-server code for security and reliability misconfigurations before committing. Runs Trustabl's static analyzer via the bundled MCP server, detects weaknesses in Python/TS/JS agent definitions and tool handlers, and guides remediation.
Generates targeted security fixes with regression tests from detect-dev SARIF findings. Use when remediating vulnerabilities after a security audit.
Applies fixes for security findings produced by /security-review. Use after detecting vulnerabilities to remediate them using language-idiomatic safe APIs.
Share bugs, ideas, or general feedback.
Applies Trustabl scan findings directly to source files. "Enrich" covers the full remediation loop: adding what is absent (guardrails, docstrings, timeouts, type annotations) and correcting what is wrong (unsafe patterns, misconfigurations). The scan result already contains the solution — this skill translates it into code.
trustabl scan (JSON, SARIF, or plain text) and want findings applied to source files automaticallyThis skill does not run trustabl scan. Run the scan first (or use the trustabl-scan skill), then invoke this skill with the results.
All three formats produced by the Trustabl CLI are accepted. The skill detects the format automatically.
| Format | Command |
|---|---|
| JSON | trustabl scan --format json |
| SARIF 2.1.0 | trustabl scan --format sarif |
| Plain text | paste terminal output directly |
When you run
trustabl scanyourself (e.g. to produce input, or to re-verify at the end), resolve the binary the way the trustabl-scan skill does: prefer"$TRUSTABL_BIN", then the plugin-managed path reported by the TrustablSessionStartcheck this session, thentrustablonPATH.
If the input cannot be parsed or contains zero findings, report clearly and stop — do not proceed to enrichment.
SARIF extraction path:
runs[0].results[]locations[0].physicalLocation.artifactLocation.uri + locations[0].physicalLocation.region.startLinemessage.textresult.fixes[0].description.text — present on most resultsruns[0].tool.driver.rules[] — match on id == ruleId, read help.text; use when fixes array is absentJSON extraction path:
findings[]file_path + start_line … end_line (1-indexed, inclusive; a single-line finding sets end_line == start_line; both are 0 for repo-level findings with no location). Note: Trustabl 0.1.4 renamed the former flat line field to start_line / end_line — read those, not line.explanation · Fix: suggested_fixrule_id, scope, severity, confidence. Dependency CVE findings (when the scan ran with --vuln-scan / vuln_scan) appear in the same findings array — the advisory id (CVE / GHSA / PYSEC) is the rule_id, and start_line points at the dependency's line in its manifest. The structured vulnerabilities[] array carries the same matches with fixed_in versions.Parse — detect the format and normalize every finding into: file, start_line, end_line, rule_id, scope, severity, confidence, explanation, suggested_fix. (For SARIF, end_line may be absent for a single-line region — fall back to start_line.)
Summarize — render a Markdown table before touching any file:
| # | File | Line | Rule | Scope | Severity | Confidence | Explanation |
Enrich per file — group findings by file. For each file:
explanation and suggested_fixApply bottom-up — within each file, sort enrichments by line_start descending, then apply using the Edit tool. Bottom-up order prevents line-offset drift.
Report — after all edits: <file>: N enrichment(s) applied, M false positive(s) skipped, K external action(s) required. Then ask: "Re-run trustabl scan to confirm findings are resolved?" — never run it automatically.
Use this prompt verbatim for each file's model call.
You are a security engineer enriching AI agent source code based on findings from a Trustabl static analysis scan.
INPUTS
You will receive:
1. The current content of a source file
2. A list of findings for that file, each with:
- start_line / end_line: the flagged line range (1-indexed, inclusive; equal for a single-line finding)
- rule_id: Trustabl rule that fired
- scope: tool | agent | subagent | repo
- severity: info | low | medium | high | critical
- confidence: 0.0–1.0
- explanation: what is wrong and why it matters
- suggested_fix: the exact change Trustabl recommends
Read the file content carefully before generating any replacement.
OUTPUT
Return a raw JSON array — one object per finding, in the same order as input. No prose. No markdown fences.
[
{
"rule_id": "<rule_id from input>",
"line_start": <first line of replacement range — must include the flagged line>,
"line_end": <last line of replacement range>,
"replacement": "<exact replacement lines, original indentation preserved, no trailing newline>",
"false_positive": false,
"reason": "<populated only if false_positive is true>"
}
]
SCOPE GUIDE
- tool: enrich the tool function — add missing docstrings, network timeout kwargs, type annotations, failure handlers, normalized paths
- agent: enrich the Agent / AgentDefinition constructor — add missing input_guardrails, output_guardrails, fix tool_use_behavior, correct MCP server wiring
- subagent: enrich the .claude/agents/*.md frontmatter — fix tools list, align description to tools, add missing name field
- repo: enrich project-level config — add tracing processor, add SandboxAgent, update pyproject.toml / package.json settings
RULES
- The scan's `explanation` and `suggested_fix` fields are the authoritative spec. Do not invent a different solution.
- line_start and line_end MUST include the flagged range (start_line..end_line). Expand the range only if adjacent lines must also change for the replacement to be syntactically valid.
- If the fix is a config or external action with no code edit, set line_start and line_end to 0 and replacement to "".
- Set false_positive: true only when the code is demonstrably correct despite the finding. Populate reason with the specific evidence.
- Preserve the file's indentation style (tabs vs spaces) and language idioms.
- Do not add comments to enriched code explaining the change.
- Do not add imports that are not required by the replacement code.
After the model returns the JSON array:
If the response cannot be parsed as a JSON array, halt immediately and report the raw model response to the user — do not attempt heuristic extraction.
line_start descending.line_start == 0 as: [external action required] <rule_id>: <suggested_fix>false_positive == true as: [false positive] <rule_id>: <reason>Findings with no file location (META findings and repo-scoped findings where file_path is empty): show them in the summary table with File: (repo-level) and Line: —, then log them as external actions — do not attempt an Edit for these.
rule_id in every enrichment objectline_start == 0 entries as external actions requiredtrustabl scantrustabl scan — this skill enriches onlyline_start–line_end unless required for syntactic validitysuggested_fix field