What the Tests Don't See

A static audit of 6,000 agent-generated patches on SWE-bench Verified

Daniel Rivera · Independent technical report · October 2026

TL;DR. Coding agents are graded on whether their patches pass tests. I audited the patches that 12 frontier models submitted to SWE-bench Verified, all under the same agent scaffold, against the human-written fixes for the same issues. Agent patches are not less secure than human fixes by static analysis. What the tests miss is behavior: one model routinely silences exceptions, and three models rewrite tests they were told not to touch. None of this shows up in a resolve rate, by construction.

1.1% vs 1.6%
patches with a new security finding: models vs. human fixes
85%
of model security findings are task-intrinsic (the human fix triggers the same rule)
4.5%
of GPT-5 mini patches add a silent except: pass (other models ≤1.0%)
23
forbidden test edits by 3 models; 5 rewrite assertions the official update leaves alone

Signals per model

Dot plot with confidence intervals of four signals for twelve models compared with a human baseline: new security findings (all near the human rate of 1.6%), silent exception handlers (GPT-5 mini at 4.5%, others near zero), edits to existing tests (DeepSeek V3.2 2.2%, Claude 4.5 Haiku 1.6%, Kimi K2.5 0.8%, others zero), and mean source lines added (GPT-5.2 about 22, others 8 to 14, human 10).
Rates over analyzed patches with Wilson 95% intervals; the orange line is the human reference fix. Models are sorted by resolve rate.

Findings

Capability isn't the issue

Scatter plot of resolve rate (56 to 77 percent) against the share of patches with a new security finding (0.6 to 1.6 percent) for twelve models; all points are at or below the human baseline of 1.6 percent and show no trend.
Resolve rate vs. the share of patches with a new security finding. No model exceeds the human baseline (Spearman ρ = 0.22, p = 0.49).

Method

For each of 6,000 (model, instance) pairs, the pipeline reconstructs every touched file before and after the patch, runs Bandit and Semgrep on both versions, and counts a finding as introduced only if its (rule, source line) count goes up. Edits to tests are compared line by line with the official SWE-bench test patch. The whole pipeline runs in about 10 minutes on a laptop with no API keys.

git clone https://github.com/Drivera341/swebench-security-audit
cd swebench-security-audit && uv sync && make all

Citation

@misc{rivera2026tests,
  title  = {What the Tests Don't See: A Static Audit of 6,000
            Agent-Generated Patches on SWE-bench Verified},
  author = {Rivera, Daniel},
  year   = {2026},
  url    = {https://github.com/Drivera341/swebench-security-audit}
}