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.

Claude Opus 5.5, without LeoPrevent: 5 of 15 prompts, each attempted three times. A prompt counts if any attempt has a vulnerability detected by the scanner checks used in this benchmark.

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.

4 of 33security interview challenges caught all three agents on every run
13% to 27%of runs where the agent's new code shipped the challenge's flaw
35% to 40%of runs on 38 real CVE tasks still exploitable, even when told to avoid vulnerabilities
Share of runs that shipped exploitable code, with no security tool. Security interview challenges: Claude Opus 5.5 13%, GPT-6 Astra 26%, GPT-6.1 Sol 27%. A.S.E real CVE tasks: Claude Opus 5.5 40%, GPT-6 Astra 35%, GPT-6.1 Sol 38%. SECURITY INTERVIEW CHALLENGES · 33 Claude Opus 5.5 13% GPT-6 Astra 26% GPT-6.1 Sol 27% A.S.E REAL CVE TASKS · 38 Claude Opus 5.5 40% GPT-6 Astra 35% GPT-6.1 Sol 38%
Share of runs that shipped exploitable code, lower is better. Each agent ran every task three times with no security tool installed. The two benchmarks measure different things, so compare agents within a group, not across groups.

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

AgentModelSecurity interview challengesA.S.E
Claude CodeClaude Opus 5.513% (13 of 98)40% (46 of 114)
Codex CLIGPT-6 Astra26% (26 of 99)35% (40 of 114)
Codex CLIGPT-6.1 Sol27% (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.

Share of runs that shipped exploitable code, without LeoPrevent (grey) and with it (green). A.S.E real CVE tasks: Claude Opus 5.5 40% to 15%, GPT-6 Astra 35% to 19%, GPT-6.1 Sol 38% to 22%. Security interview challenges: Claude Opus 5.5 13% to 10%, GPT-6 Astra 26% to 10%, GPT-6.1 Sol 27% to 11%. A.S.E REAL CVE TASKS Claude Opus 5.5 40% 15% GPT-6 Astra 35% 19% GPT-6.1 Sol 38% 22% SECURITY INTERVIEW CHALLENGES Claude Opus 5.5 13% 10% GPT-6 Astra 26% 10% GPT-6.1 Sol 27% 11%
Share of runs that shipped exploitable code: grey without LeoPrevent, green with it, on the same task-and-run pairs. A.S.E counts all 38 tasks.
Agent and modelA.S.E real CVE tasksSecurity interview challenges
Claude Code, Claude Opus 5.546 → 17 runs, 63% fewer13 → 10 runs, 23% fewer
Codex CLI, GPT-6 Astra40 → 22 runs, 45% fewer26 → 10 runs, 62% fewer
Codex CLI, GPT-6.1 Sol43 → 25 runs, 42% fewer27 → 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.