Benchmarks · Updated 2 November 2026
How secure is the code AI coding agents write?
We test coding agents on application code and cloud infrastructure, then check the security mistakes in what they write. Each task runs three times, with and without LeoPrevent. The results pages include the code examples, methods and verdicts.
Explore the results
Infrastructure: the agent made encryption optional
Claude Opus 5.5 wrote a load balancer that served plain HTTP when no certificate was supplied. We found it while running all 100 GenIaC-SecBench prompts across AWS, Azure, GCP and Kubernetes.
33%
of infrastructure-as-code prompts with no security guidance produced vulnerable code.
See the load-balancer code and full results, or read the blog post.
Application code: copying flaws and recreating vulnerabilities
Our October evaluations tested Claude Opus 5.5, GPT-6 Astra and GPT-6.1 Sol on two application-code benchmarks. The security interview challenges ask agents to add features to 33 small apps with known flaws. A.S.E asks them to rewrite functions behind real CVEs, then runs the original exploits against their code.
The infrastructure result counts prompts with a scanner finding; the application results below count runs that shipped a flaw. The percentages measure different things and should not be ranked against one another.
What we found
- Agents copy the security mistakes already in your code. On 33 public security interview challenges, the agents' new code shipped the planted flaw in 13% to 27% of runs, often by reusing insecure code that was already there.
- Some mistakes catch every agent, every time. Four of the 33 challenges caught all three agents on all three runs: unsalted MD5 password hashing, a hardcoded admin password, an Nginx rule that can be bypassed, and an XSLT endpoint that reads server files.
- Even when told to be careful. On A.S.E, real projects with the function behind a published vulnerability removed and an explicit instruction to avoid vulnerabilities, the original exploit still worked against 35% to 40% of the agents' rewrites, on 38 real CVE tasks.
- Agents differ in what they miss. The two GPT models fell for Nginx configuration, PHP deserialization and business logic flaws that Claude Opus 5.5 avoided, but all three shared the four that caught everyone.
Application-code results by model
| Agent | Model | Security interview challenges | A.S.E |
|---|---|---|---|
| Claude Code | Claude Opus 5.5 | 13% (13 of 98) | 40% (46 of 114) |
| Codex CLI | GPT-6 Astra | 26% (26 of 99) | 35% (40 of 114) |
| Codex CLI | GPT-6.1 Sol | 27% (27 of 99) | 38% (43 of 114) |
Share of runs that shipped the flaw, lower is better. Security interview challenges: runs whose new code shipped the challenge's planted flaw. A.S.E: runs whose code passed the project's tests and was still broken by the original CVE exploit, on 38 tasks. The two benchmarks measure different things, so compare agents within a column, not across columns. Each agent ran with no security tool installed. Sources: the secure code review challenges and A.S.E (paper).
With LeoPrevent
LeoPrevent is the security tool we build. It reviews what a coding agent wrote when the agent finishes its turn and tells the agent what it found, so the agent can fix it in the same turn. We ran the application-code benchmarks with and without it, on the same tasks.
With LeoPrevent, every agent shipped fewer exploitable runs on both application-code benchmarks. On A.S.E's real CVEs, Claude Opus 5.5 shipped exploitable code 63% less often, and no task got worse for any agent. On the security interview challenges, both GPT models went from failing 9 challenges to 3.
Part of what is left is a flaw LeoPrevent did catch. On the Nginx challenge it flagged the problem in every run, but it hands that kind of finding to the developer as a suggestion rather than having the agent change the configuration itself. Our runs have no developer to accept it, so those runs count as not prevented; in everyday use, the developer would see the finding.
| Agent and model | A.S.E real CVE tasks | Security interview challenges |
|---|---|---|
| Claude Code, Claude Opus 5.5 | 46 → 17 runs, 63% fewer | 13 → 10 runs, 23% fewer |
| Codex CLI, GPT-6 Astra | 40 → 22 runs, 45% fewer | 26 → 10 runs, 62% fewer |
| Codex CLI, GPT-6.1 Sol | 43 → 25 runs, 42% fewer | 27 → 11 runs, 59% fewer |
Exploitable runs without LeoPrevent and with it, out of 114 on A.S.E and 99 on the challenges (98 for Claude Opus 5.5). The runs left on the challenges include the Nginx flaw LeoPrevent flagged as a suggestion for the developer: 3 of the remaining runs for each GPT model and 2 for Claude Opus 5.5. The security interview challenges are our own test set, so that column is a check rather than independent evidence. LeoPrevent works alongside code review, static analysis and testing; it doesn't replace them. Each result page has the full numbers and their limits.
Infrastructure with LeoPrevent
Of the 15 GenIaC prompts with no security guidance, 5 produced vulnerable code without LeoPrevent; 2 still did with it. Each prompt counts if any of its three attempts is vulnerable. In the load-balancer example, the agent removed the plain-HTTP fallback after LeoPrevent reported it. This experiment enabled automatic fixes for rules that currently ship as suggestions. Full results.
How we test
- Application code and infrastructure. Agents add features to existing apps, restore functions in real projects, or write cloud configuration from an empty project. Each results page describes its prompts.
- How the agents ran. Claude Code and the Codex CLI, given the request as it is, each in its own isolated container. The GPT models ran at medium effort and Claude Opus 5.5 at its default; on A.S.E, Claude Code used the benchmark's own tool settings.
- Three runs per task. Agents give different answers to the same request, so one run per task mostly measures luck.
- Exploits where possible. Where the benchmark has its own security tests or an exploit we can run, those decide the verdict. On A.S.E every verdict is the original CVE exploit; on the security interview challenges, 93% are. GenIaC uses scanner checks on generated infrastructure files; we do not deploy that infrastructure or run attacks against it.
- Analysis fixed in advance, verdicts published. We write down how we will compare before the runs, say on the result page when we report a subset chosen afterwards, and publish the verdict of every run so the numbers can be recomputed.