Static Analysis Until Clean
Run a static application security scanner, fix each real finding at its source, document false positives, and re-scan until no high findings remain.
Copy the Static Analysis Until Clean loop
Stops when the scanner reports no unresolved findings at or above the severity threshold, or after 8 iterations. Edit the settings block, then paste the whole prompt into your agent.
You are running the "Static Analysis Until Clean" loop. Settings (edit before running): - Scan command: semgrep scan --config auto --json - Test command: npm test - Severity threshold: ERROR (high) - Max iterations: 8 Goal: no unresolved findings at or above the severity threshold. Each iteration: 1. Run the scan and list findings at or above the threshold: rule, file, line, and message. 2. Take one rule at a time, starting with the most severe. 3. For each finding, trace the data flow. Can untrusted input reach this line? Write one sentence explaining your verdict. 4. Real issue: fix it with the standard safe pattern (parameterized queries, allowlists, path normalization and containment checks, context-aware output encoding, safe parsers). Add a test that feeds a malicious input and asserts it is handled. 5. False positive: add the scanner's inline suppression for that single line, with a comment that explains why it is safe. 6. Run the test command, then re-scan. Stop when: - No unresolved findings remain at or above the threshold. Success. - You reach the max iteration count. Rules: - Do not disable rules globally or exclude directories from the scan. - Do not "fix" findings with blocklists or string replacement when a safe API exists. - Every suppression needs a written reason. Limit suppressions to findings you traced and proved unreachable. - Do not run exploit payloads against any live system. Tests run locally only. Final report: real issues fixed (with tests), false positives suppressed (with reasons), and findings left open.
When this loop fits
- A SAST tool reports injection, path traversal, or unsafe deserialization findings you need to clear before release.
- You added a scanner to CI and the first run produced a long backlog.
- You want each security fix paired with a test that proves the issue is closed.
What happens on each pass
The agent repeats these steps until the stop condition holds or it runs out of iterations.
- Scan. Run the scanner and group findings by rule and severity.
- Confirm reachability. Trace each finding's data flow to decide whether untrusted input can actually reach it.
- Fix at the source. Use parameterized queries, path normalization, output encoding, or safe APIs instead of ad-hoc filtering.
- Prove and re-scan. Add a test for each real fix, run the suite, and scan again.
MCP servers for this loop
The 6 strongest of 1526 matching servers, ranked by how closely they fit and then by trust score.
- 55Trust score 55 of 100, Fair
BlackVeil DNS & Email Security Scanner
by madaburns · TypeScript
DNS and email security scanner with 82 MCP tools for SPF, DMARC, DNSSEC, SSL, and brand audits.
RegistryRemoteLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: A. Last commit or release 12 days ago. - 55Trust score 55 of 100, Fair
Scan your own website for vulnerabilities: DNS takeover, compromised CDNs, debug mode and more.
RegistryLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded. - 52Trust score 52 of 100, Fair
AI Agent Security Scanner
Unknown author
Security scanner for AI agents and MCP servers: injection, jailbreak, tool abuse.
RegistryRemoteLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded. - 52Trust score 52 of 100, Fair
Audits any Base EVM 0x contract or Solana SPL Mint for proxy patterns, GoPlus honeypot flags, and.
RegistryRemoteLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded. - 52Trust score 52 of 100, Fair
LLM Security Scanner
Unknown author
LLM agent security scan: injection, jailbreak, tool abuse probes plus guardrail audit.
RegistryRemoteLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded. - 50Trust score 50 of 100, Fair
AI-powered security scanning using Black Duck Signal for vulnerability detection.
RegistryLicenseQualityMaintenanceLicense: Not graded. No license is recorded for this server.Quality: Not graded. No README or tool list has been captured yet.Maintenance: Not graded. No commit or release date has been recorded.
How to run this loop
- Connect the tools. Install a server the loop can use, for example BlackVeil DNS & Email Security Scanner, or rely on your agent's built-in terminal and file access.
- Edit the settings block. Replace the example commands, targets, and limits with your project's own. Keep the iteration cap low on the first run.
- Paste it into an agent session. Start a fresh session in Claude Code, Cursor, or VS Code agent mode, in the repository root, and paste the prompt.
- Review before you merge. Read the final report and the diff. The loop leaves its work for you to review rather than shipping it.
Static Analysis Until Clean questions
When does the Static Analysis Until Clean loop stop?
It stops as soon as the scanner reports no unresolved findings at or above the severity threshold. It also stops after 8 iterations by default, or earlier when the prompt's own stop rules say it is stuck, and then reports what changed and what is left. Change the cap in the settings block at the top of the prompt.
When is it acceptable for the agent to suppress a finding?
Only after it traces the data flow and shows untrusted input cannot reach the flagged line. The suppression has to sit on that single line with a written reason, so a reviewer can check the argument instead of discovering a silent exclusion later.
Which static analysis tools does this loop support?
Any scanner with machine-readable output: Semgrep, CodeQL, SonarQube, Bandit for Python, gosec for Go, and Brakeman for Rails all fit. Several have MCP servers that let the agent run scans and read rule documentation directly.