CWE-bench: Refocusing Agentic Security from Exploitation to Defense

Gonzalo Gonzalez-Pumariega, Ajay Jagannath, Adit Jain, Guram Gogia, Soumyadeep Bakshi +1 more
10/12/2026
cs.CRcs.AIcs.SE
benchmark-dataset

No confident code implementation found for this paper.

Abstract

Cybersecurity evaluations of AI agents have focused largely on offense, yet a working exploit does not show that an agent can make software safe. An attacker needs to exploit only one vulnerability; a defender must find and fix all of them.

Show full abstract

We introduce CWE-bench, a private benchmark of 120 held-out repository audit-and-repair tasks spanning 73 CWE types, eight languages, and all OWASP Top 10 2025 categories. Agents are given a repository to audit and a description of its threat model, but are not told the weakness, where it occurs, or how many vulnerable sites there are. Each patch must block the exploit while preserving original functionality, as checked by a programmatic verifier. We validated the verifier against a panel of agentic judges, manually reviewing disagreements during development and refining the checks. The best agents reach 68% pass@1 and 81% pass@4. We further conduct analyses showing that (i) agents with the same pass@1 differ widely in retry gains and cost, and (ii) no single agent is best across languages or vulnerability categories, and difficulty varies far more by vulnerability category than by language. As the offensive capabilities of agents improve, CWE-bench provides a broad and rigorous measure of whether their defensive capabilities keep pace.

View on arXivView PDF

Code Implementations

No confident code match yet

We couldn't find an author-owned or strongly-evidenced community implementation for this paper. Any repos shown below are weak matches — verify before relying on them.

No code implementations found yet.

Know of an implementation? Let us know in the comments below!

Similar Papers

Cite this paper

@article{gonzalezpumariega2026cwebench,
  title  = {CWE-bench: Refocusing Agentic Security from Exploitation to Defense},
  author = {Gonzalo Gonzalez-Pumariega and Ajay Jagannath and Adit Jain and Guram Gogia and Soumyadeep Bakshi and Nazneen Rajani},
  year   = {2026},
  eprint = {2610.17020},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2610.17020v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2610.17020.svg)](https://codeofpaper.com/paper/2610.17020)

Discussion