betaFeedback

WorksComputer Science

CWE-bench: Refocusing Agentic Security from Exploitation to Defense

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. We introduce CWE-bench, a benchmark of 250 repository audit-and-repair tasks spanning 185 CWE types and eight languages, grouped into ten weakness classes. We release 100 tasks publicly and keep 150 held out. 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 deterministic programmatic verifier. Verifiers were curated with panels of agentic judges and reviewed by hand, so that they reject incomplete repairs without penalizing correct ones. The best agent reaches 67% pass@1 and 79% pass@4. We further conduct analyses showing that (i) agents with similar pass@1 differ widely in retry gains and cost, and (ii) no single agent is best across languages or weakness classes. As the offensive capabilities of agents improve, CWE-bench provides a broad and rigorous measure of whether their defensive capabilities keep pace.

Introduction

Can an agent make a vulnerable codebase safe to use? Most cybersecurity evaluations of AI agents measure offense: solving capture-the-flag challenges, exploiting applications, or reproducing vulnerabilities ([1, 2, 11]). Defense has received far less attention, even though it is the harder problem. An attacker needs to exploit only one vulnerability; a defender must find and fix all of them without breaking the software. Consider a file server with a path-traversal flaw. An attacker needs just one handler that builds a file path from user input to read files outside the shared directory. A defender must find and fix every such handler, and cannot simply disable downloads, since that removes the service the server exists to provide.

A growing number of benchmarks evaluate defensive agents, but each simplifies the problem in a different way. Many build tasks directly on public Common Vulnerabilities and Exposures (CVEs), whose fixes may already be in training data, or on LLM-generated code bases that fall outside the distribution of real software ([4, 5, 6, 7]). Others give the agent a vulnerability description, proof-of-concept input, or location hint, reducing discovery to repair of a known flaw ([4, 8, 6]). The rest cover only a narrow slice of weaknesses, such as memory-safety bugs in C/C++ ([8, 10] (Shi et al. 2026)). A real defender faces none of these simplifications: it must find unknown vulnerabilities across the full range of weaknesses in real code.

We introduce CWE-bench1, a benchmark of 250 repository auditing and repair tasks that addresses each of these gaps. Every task is built on a real open-source repository with injected vulnerabilities. We release 100 tasks publicly, with their verifiers, reference patches, and agent rollouts, so that anyone can reproduce our results and evaluate new agents; the

BenchmarkTasksCWEsOWASP 2025Lang.CodebaseVuln. sourceInformation given to agent
PatchEval [4]230397/103RealPublic CVEsVulnerability description
CyberGym-E2E† [9]920NR1/102RealPublic OSS-Fuzz bugsNone
LiveCVEBench [5]190749/1014RealPublic CVEsBug report
ZeroDayBench† [10]22154/106RealInjectedVaries (5 levels)
PatchBench [8]213161/102RealInjectedPoC and sanitizer report
Vul4Py [6]100607/101RealPublic CVEsCVE and file/line hints
SecProbe† [7]3531515/106LLM-generatedInjectedSoftware specification
CWE-bench25018510/108RealInjectedThreat model

caption: Comparison of recent vulnerability repair benchmarks. OWASP 2025 counts the OWASP Top 10:2025 categories covered under each category’s official CWE mapping. Codebase indicates whether tasks are built on real open-source repositories or LLM-generated ones. Injected denotes vulnerabilities inserted into a codebase, such as real CVEs transplanted into new repositories. C/C++ and JavaScript/TypeScript count as separate languages. PatchEval counts its 230-task sandboxed subset. CWE-bench counts its 100 public and 150 held-out tasks. NR: not reported. †Some values (in italics) are derived by us: from source-CVE records (ZeroDayBench), sanitizer crash types (CyberGym-E2E), or the 20 most frequent CWEs reported (SecProbe, a lower bound).

:::

remaining 150 are held out, so their injected vulnerabilities have no published fix. Agents receive only the repository and an audit instruction describing the system and its threat model; they are not told the weakness, where it occurs, or how many vulnerable sites there are. Tasks span 185 Common Weakness Enumeration (CWE) types and eight programming languages, which we group into ten weakness classes. A patch passes only if it blocks the exploits while preserving the original functionality, as checked by a deterministic programmatic verifier. To make the verifiers both hard and fair, we curated them with panels of agentic judges and reviewed every task by hand. Table 1 compares CWE-bench with recent defensive benchmarks.

The best agent, Claude Opus 5.5, reaches 67% pass@1 and 79% pass@4, and the four leading agents lie within three points of pass@1. Beyond these aggregate scores, agents with similar pass@1 differ widely in how much they gain from retries and in cost per attempt, and their ordering changes across languages and weakness classes, with no single agent leading in either.

The paper makes three contributions:

  1. CWE-bench, a benchmark of 250 auditing and repair tasks on real repositories, covering 185 CWEs across ten weakness classes with no diagnosis given to the agent. We release 100 tasks and 4,400 agent rollouts, and keep 150 tasks held out.

  1. A deterministic grading procedure that checks both exploit blocking and preserved functionality, with verifiers curated by panels of agentic judges and human review.

  1. An evaluation of eleven frontier agents, showing that similar pass@1 hides large differences in retry gains, task coverage, and cost, and that no single agent is best across languages or weakness classes.

Related Work

Offensive evaluation. Offensive success is self-certifying: a captured flag, a triggered crash, or a working exploit is proof on its own. This has let offensive evaluation scale quickly, from capture-the-flag challenges [1] to exploiting real web applications [2], reproducing real vulnerabilities [11], achieving consequential attacks [11], and grading intermediate exploitation steps [12], with multi-stage penetration tests now separating tooling gaps from planning failures [13]. Defensive success is not self-certifying. Blocking the known exploit is necessary but not sufficient, since a patch can stop one payload while leaving variants open, or disable the feature entirely. Offensive benchmarks therefore show whether agents can expose weaknesses, but not whether they can remove them.

Defensive auditing and repair. Defensive benchmarks work around the grading problem through shortcuts that limit what they measure. First, many build tasks on public CVEs and grade against the developer’s own fix and tests [14, 4, 5, 6]. Those fixes are published and may appear in training data, so a correct patch can reflect recall rather than investigation. Generating the repository along with its tests avoids

CWE-bench evaluation workflowVector (PDF)

caption: CWE-bench evaluation. Each task provides an open-source repository with injected vulnerabilities and an audit instruction that does not name them. The agent audits and patches the repository without Internet access. A patch passes only if both the security verifier (SS) and the functional verifier (FF) succeed. During curation, the verifiers are reviewed by panels of agentic judges and by hand to refine the checks.

:::

contamination ([7]), but produces code outside the distribution of real software. Second, many give the agent a vulnerability description, proof-of-concept input, or location hints ([4, 8, 6, 5]). The agent then only repairs a known flaw and skips auditing, a large part of real defensive work. Third, many cover only a narrow range of weaknesses ([8, 10] (Shi et al. 2026)). Several are limited to memory-safety bugs in C/C++, where sanitizers give an automatic check, leaving access-control, authentication, and logic flaws untested; these reach only one to four of the ten OWASP Top 10:2025 categories (Table 1). CWE-bench addresses all three: real repositories with injected vulnerabilities, no diagnosis given to the agent, and coverage of 185 CWEs spanning all ten OWASP Top 10:2025 categories. Because the held-out tasks have no published fix, CWE-bench can also release part of its evaluation set for reproducibility while keeping a held-out portion that cannot be recalled.

Evaluation validity and integrity. Even with executable checks, defensive grading can go wrong in three ways. First, test-passing patches can still be incorrect ([15]). Prior work strengthens validation with fuzzing and differential checks, maintainer-added tests, or semantic checks ([16, 17, 8]), and finds errors in proof-of-concept grading itself ([18]). Second, LLM judges are not a reliable substitute: they can agree with one another while disagreeing with execution-based checks ((Deininger and Slany, 2026)). Third, agents can game the evaluation by retrieving published fixes or exploiting weaknesses in the evaluation harness ([11] (Kouremetis et al. 2026; Zheng et al. 2026)). CWE-bench combines these lessons: a deterministic programmatic verifier provides the score, panels of agentic judges and human reviewers shaped those verifiers during curation, every verifier is checked to reject the published upstream fix, and agents can reach only their model API during evaluation.

Benchmark Design

Problem formulation

We formulate each task as a Markov decision process M=⟨S,A,T,R⟩\mathcal{M} = \langle\mathcal{S}, \mathcal{A}, \mathcal{T}, \mathcal{R} \rangle. A state st∈Ss_t \in\mathcal{S} consists of the repository, the audit instruction, and the interaction history up to step tt, where the instruction does not name the vulnerabilities or their number. Actions at∈Aa_t \in\mathcal{A} are the operations available through the agent’s harness, such as inspecting code, running commands, and editing files. The transition function T:S×A→S\mathcal{T} : \mathcal{S} \times\mathcal{A} \to\mathcal{S} applies an action’s effect on the repository and appends its output to the history; actions that attempt to access the Internet are blocked and leave the repository unchanged. The agent acts according to a policy π(at∣st)\pi(a_t \mid s_t). When the agent submits or reaches the one-hour time limit at step TT, the reward R:S→{0,1}R : \mathcal{S} \to\{0,1\} is computed on the final state, so a timed-out rollout is graded on whatever repairs it has made:

R(sT)=S(sT)⋅F(sT),(1)R(s_T) = S(s_T) \cdot F(s_T), \tag*{(1)}

where S(sT)=1S(s_T) = 1 if the exploits for the target vulnerabilities are blocked, and F(sT)=1F(s_T) = 1 if the repository’s existing functionality tests still pass. A rollout passes only if both checks succeed. Both checks are deterministic, so a given final state always receives the same reward.

Task coverage and construction

The evaluation set contains 250 tasks spanning 185 CWE types and eight programming languages, from injection and access control to memory-safety errors (use after free, out-of-bounds writes, type confusion), certificate revocation, and LLM prompt injection. Many of these CWEs sit at the edges of the OWASP Top 10:2025 categories or outside them, so we group every CWE into ten weakness classes of our own, in the spirit of OWASP but finer where the set requires it (Appendix § 10); the set still covers all ten OWASP Top 10:2025 categories. Figure 2 breaks the set down by language and by weakness class; each class contains 17 to 40 tasks.

Figure 2. Composition of the 250-task evaluation set (100 public, 150 held-out). Left: tasks per programming language. Right: tasks and distinct CWEs per weakness class (Appendix § 10).

Each task starts from an open-source repository with a real CVE, into which we inject new vulnerabilities. For each task, we write exploits that trigger the injected vulnerabilities and functionality tests that exercise the repository’s intended behavior; these form the checks SS and FF in Equation (1). A task is accepted only if a reference patch passes both checks and the unmodified repository fails.

Public and held-out sets. We split the tasks into a public set of 100 tasks, spanning 91 CWEs, and a held-out set of 150 tasks, spanning 126 CWEs. The public set is released with its environments, verifiers, reference patches, and the 4,400 agent rollouts behind our results, so that anyone can inspect a task, reproduce our scores, and evaluate new agents (Appendix § 11). The held-out set is kept private: its injected vulnerabilities have no published fix and cannot appear in training data, so it continues to measure progress on tasks no agent has seen. We report results on the full 250-task set and show the two subsets for illustration.

Quality checks

A verifier that is too lenient rewards incomplete patches, and one that is too strict penalizes correct patches that differ from the reference fix. We curated the verifiers with panels of agentic judges (Appendix § 8). Each judge works in a separate copy of a patched repository, where it can inspect code, build the project, and run the verifier, and assesses the patch on five criteria: security, functionality, robustness to attack variants, grading integrity, and build soundness. We manually reviewed rollouts where the panel and the verifier disagreed (Appendix § 9). These reviews led us to add probes that catch incomplete repairs, to replace checks that assumed the reference patch’s structure with checks of behavior, and to correct judge rubrics where the judges erred. The panels shape the verifiers only; the reported score is the programmatic verdict alone.

In addition, every task was checked against six questions and reviewed by hand (Table 2). The checks ensure that a task reads as a realistic request, that its graded behavior is fair to expect from the instruction, and that its verifier rewards a

CheckRequirement
Realistic instructionThe instruction reads like a real request, not an evaluation setting.
Inferable requirementsEvery graded behavior can be inferred from the instruction.
Behavior, not structureThe verifier checks for correct behavior, not for the structure of one particular fix.
Reference and baselineThe unmodified repository fails and the reference patch passes.
Preserved functionalityThe original functionality still works after a correct fix.
No memorized fixesThe verifier rejects memorized solutions, such as the known upstream patch.

Table 2. Checks applied to every task.

real repair rather than a memorized one.

Experiments

Experimental Setup

Agents. We evaluate eleven frontier models, each run in a coding-agent harness: Claude Code, Codex, Antigravity, or OpenCode (Table 3). Scores therefore reflect the model and its harness together. Each agent uses high reasoning effort and makes four independent attempts per task, with a one-hour limit per attempt.

SystemHarnessAll 250 tasksPublic (100)Held-out (150)Mean cost (USD)
Pass@1Pass@4Pass@1Pass@4Pass@1Pass@4
Claude Opus 5.5Claude Code67.179.267.278.067.080.01.85
Muse WonderOpenCode66.178.864.879.067.078.72.73
Gemini 4 ArgonAntigravity65.077.267.881.063.274.73.70
GPT-6 AstraCodex64.272.863.870.064.574.73.87
DeepSeek V4.1 FlashOpenCode57.673.657.072.058.074.70.04
Grok 4.7OpenCode54.771.255.574.054.269.32.97
Hy4 PreviewOpenCode47.364.452.068.044.262.00.43
Mistral Large 4OpenCode45.660.446.259.045.261.30.37
Qwen 3.8 MaxOpenCode45.464.845.062.045.766.72.06
Kimi K3.1 ProOpenCode45.364.041.563.047.864.70.96
GLM 5.3OpenCode42.063.644.065.040.762.70.58

Table 3. Pass@1 and pass@4 (%) on all 250 tasks, which form the leaderboard, and on the public and held-out sets, with mean API cost per rollout over all 250 tasks. Agents are ordered by pass@1 on all tasks; the best value in each column is in bold.

Execution. Each attempt runs in an isolated container where the agent can reach only its model API. Attempts in which the model API declines the request, for example when a safety filter blocks the task, count as failures.

Metrics. Each attempt is scored by the programmatic verifier (Equation (1)). We report pass@1, the mean fraction of passing attempts per task, and pass@4, the fraction of tasks with at least one passing attempt ((Chen et al., 2021)), along with the mean API cost per rollout. The leaderboard is computed on all 250 tasks; we also report the public and held-out sets separately for illustration.

Main Results

Table 3 reports results for all eleven agents. Claude Opus 5.5 leads with 67.1% pass@1 and 79.2% pass@4, followed by Muse Wonder (66.1%), Gemini 4 Argon (65.0%), and GPT-6 Astra (64.2%). The public and held-out sets rank the agents similarly (Spearman ρ=0.82\rho= 0.82 across the eleven agents), with a mean gap of 2.7 points in pass@1 between the two sets. The leading agent differs between them, however: Gemini 4 Argon leads on the public set and Claude Opus 5.5 and Muse Wonder tie on the held-out set. Of the 250 tasks, 230 are solved by at least one agent and 20 by none.

How do repeated attempts and different agents expand task coverage?

The four leading agents lie within three points of pass@1, yet range from 72.8% to 79.2% pass@4 (Table 3). The difference lies in how consistently each agent repairs the tasks it can solve (Figure 3, left). GPT-6 Astra passes all four attempts on 138 tasks, more than any other agent, but has mixed outcomes on only 44, so additional attempts add little and it has the lowest pass@4 of the four. Claude Opus 5.5 passes all four attempts on fewer tasks (132) but has mixed outcomes on 66, which retries convert into passes. The same pattern holds further down the table: DeepSeek V4.1 Flash has mixed outcomes on 92 tasks and reaches a higher pass@4 than GPT-6 Astra (73.6% against 72.8%) despite a pass@1 6.6 points lower.

Figure 3. Outcomes across four attempts and task coverage. Left: for each agent, the number of tasks passed on all four attempts, on one to three, and on none; the four leading agents are in bold. Right: tasks passed at least once by each of the three leading agents, and their overlap.

The leading agents also solve different tasks (Figure 3, right). Claude Opus 5.5, Muse Wonder, and Gemini 4 Argon pass at least one attempt on 198, 197, and 193 tasks, respectively, but only 159 are common to all three, and together they pass 226 of the 250. Claude Opus 5.5 passes 33 tasks that GPT-6 Astra never does, while GPT-6 Astra passes 17 that Claude Opus 5.5 never does.

How does pass rate scale with inference cost?

Claude Opus 5.5 reaches the highest pass@1 (67.1%) at $1.85 per rollout, while Muse Wonder, Gemini 4 Argon, and GPT-6 Astra score lower at $2.73, $3.70, and $3.87 (Figure 4). DeepSeek V4.1 Flash reaches 57.6% at $0.04. These two agents form the Pareto frontier. Along it, the step from DeepSeek V4.1 Flash to Claude Opus 5.5 costs about 50× more per rollout for 9.5 more points of pass@1, or 1.2× the pass rate.

Figure 4. Pass@1 against mean API cost per rollout, using the values in Table 3. Orange points mark the Pareto frontier: agents for which no agent of equal or lower cost scores higher.

How does performance vary across languages and weakness classes?

The leading agents trade places across both languages and weakness classes (Figure 5). Claude Opus 5.5 leads on C/C++ (75.0%), JS/TS (65.3%), and Java (62.5%), Muse Wonder on Go (69.0%), and Muse Wonder and GPT-6 Astra tie on Python (58.6%). Across weakness classes, the leader changes more often: Claude Opus 5.5 leads three of the ten classes outright, GPT-6 Astra three, Gemini 4 Argon two, and Muse Wonder one, and Claude Opus 5.5 and Muse Wonder tie on the remaining one, trust boundaries and request handling (W07). W07 and authentication and sessions (W05) are the hardest classes: the best agent reaches 58.3% and 59.8%, and the mean agent 44.7% and 46.5%. Supply chain and data integrity (W08) and cryptography and secrets (W06) are among the easiest, with GPT-6 Astra reaching 77.8% and 79.5%.

Figure 5. Pass@1 by language (left) and weakness class (right). C/C++ and JS/TS are grouped. Outlined cells mark the best score in each column.

Discussion

CWE-bench asks agents to find and repair vulnerabilities in real repositories without being told the weakness or where it occurs, across 185 CWEs in ten weakness classes. Across eleven agents, the leaders lie within three points of pass@1 but differ in retries, coverage, and cost, and the leading agent changes across languages and weakness classes. We draw three takeaways from these results.

Automated vulnerability repair is becoming practical. The leading agents audit and repair most tasks end to end, without being told the weakness or where it occurs, and reach 79% pass@4 with retries. This performance is no longer limited to the most expensive models: Claude Opus 5.5 leads at a lower cost per rollout than each of the next three agents ($1.85 against $2.73 to $3.87), and DeepSeek V4.1 Flash reaches 58% pass@1 at $0.04 per rollout (Section 4.4), which makes repair cheap enough to run routinely rather than only in periodic audits. Agents also solve different tasks: the three leading agents together cover 226 of the 250 tasks, against 198 for the best single agent (Section 4.3). Systems that combine several agents, rather than relying on one, are a natural direction for automated defense.

Narrow benchmarks give a misleading picture of security capability. The leading agent changes from one weakness class to the next, and the four leading agents each lead at least one class (Section 4.5). A benchmark that covers a few weakness classes, as several defensive benchmarks do ([8, 10] (Shi et al. 2026)), can therefore rank agents differently than one that covers many, and a single aggregate score hides where each agent is weak. CWE-bench covers 185 CWEs, but this is still a fraction of the 956 active weaknesses in CWE (Appendix § 10). Judging how ready agents are for defensive work requires a broader map of vulnerability classes, with results reported per class rather than as one number.

Verifiers must be hard but fair, and open to inspection. A benchmark is only as good as what its verifier accepts. A verifier that is too lenient rewards incomplete patches, such as one that blocks the known exploit but leaves variants open, and overstates how ready an agent is to secure code. A verifier that is too strict penalizes correct patches that remove the vulnerability and preserve behavior but differ from the expected fix. Both errors mislead anyone choosing an agent, and the same holds for any team that uses automated checks to accept agent-written patches. CWE-bench addresses this in two ways. During curation, panels of agentic judges and human reviewers shaped each verifier toward checks of behavior that reject incomplete repairs and memorized fixes (§ 3.3). After curation, we release 100 tasks with their verifiers, reference patches, and rollouts, so that anyone can inspect what a verifier accepts and rejects and report a task they believe is wrong, while the 150 held-out tasks continue to measure progress on tasks no agent has seen.

Conclusion

Security evaluations of AI agents have largely measured how well agents attack software. As agents are deployed to audit and maintain code, the more consequential question is whether they make software safer. CWE-bench measures this directly: agents must find and repair unlabeled vulnerabilities in real repositories, and a patch counts only if it blocks the exploit and preserves the program’s behavior. Our results show that agents differ in how they respond to retries, which tasks they cover, what they cost, and which weakness classes they handle, differences that a single pass rate hides. We release 100 tasks and their rollouts so that others can reproduce these results and evaluate new agents, and keep 150 tasks held out to track progress on tasks no agent has seen. As the offensive capabilities of agents improve, their defensive capabilities must keep pace, and the only way to know whether they do is to measure defense rigorously across the full breadth of vulnerabilities that real software contains.

Evaluation Details

Each agent pairs a model with the harness listed in Table 3, runs at high reasoning effort, and makes four independent attempts per task with a one-hour limit per attempt. An attempt that reaches the time limit is graded on the repository state at that point. For each agent and task, we score the first four graded attempts. Each attempt runs in an isolated container whose only network access is the model provider’s API. Cost is the API cost of an attempt as reported by the harness (Claude Code, Codex, and Qwen 3.8 Max), or, where the harness does not report it, computed from the attempt’s token usage at the provider’s list prices, with the discount for cached input tokens.

Agentic Judge Panel

We used panels of agentic judges to curate the programmatic verifiers; the panels do not contribute to the reported scores. Each judge receives the task instruction, a description of the injected vulnerability and of what a correct fix must do, and the reference patch. Each judge then works independently in its own copy of a patched repository with shell access: it can inspect the code, build the project, run its tests, and run the programmatic verifier, whose result is available as evidence. A judge assesses each criterion in Table 4 separately and accepts the patch only if all five hold.

CriterionRequirement
SecurityThe repair closes the target vulnerability.
FunctionalityOrdinary, legitimate behavior remains available.
GeneralizationThe repair blocks attack variants beyond the particular verifier probe.
IntegrityThe submission repairs the software rather than manipulating the grading mechanism.
SoundnessThe patched codebase builds and runs in the task environment.

Table 4. Judge-panel criteria. A judge accepts a repair only if all five criteria are satisfied.

Human Review

During verifier curation, we manually reviewed attempts on which the programmatic verifier and the panel disagreed. The programmatic verifier encodes our definition of a correct repair, so each disagreement was resolved in its favor unless review showed an error in the verifier. When judges showed that the verifier was too strict, failing valid repairs, we replaced the affected checks with checks of behavior. When judges showed that it accepted incomplete repairs, we added probes to catch them. When a judge rejected a patch over an issue that does not affect security or functionality, we kept the verifier’s verdict. In addition, every task was reviewed by hand against the checks in Table 2.

Weakness Classes and Task Coverage

The OWASP Top 10:2025 assigns 248 CWEs to its ten categories, but 71 of the 185 CWEs in CWE-bench (38%) are not assigned to any of them, including most memory-safety weaknesses such as use after free (CWE-416), out-of-bounds write (CWE-787), and type confusion (CWE-843). We therefore assign every CWE in the set to one of ten weakness classes of our own, W01 to W10, defined in the spirit of OWASP but split more finely where the set requires it, for example separating memory and resource safety (W03) and input validation and parsing (W02) from injection (W01). Every task targets a single CWE, and every CWE in the set belongs to exactly one class. The set still covers all ten OWASP Top 10:2025 categories, each with at least two CWEs. Table 5 lists the CWEs in the evaluation set under their class.

Coverage of the full CWE list. To show where the classes end, we place every active weakness in CWE v5.0 (956 entries, released October 2026)2 into one of the ten classes or into an out-of-scope group (Table 6). A weakness inherits the class of the nearest CWE-bench CWE in the CWE research hierarchy (CWE-1000) when that class is unambiguous, and we assign the remaining entries by hand. Of the 956 weaknesses, 694 (73%) fall into the ten classes and 262 (27%)

GroupCWE v5.0CWE-benchCoverage
W01 Injection402050%
W02 Input validation & parsing981818%
W03 Memory & resource safety1353324%
W04 Access control1242016%
W05 Authentication & sessions551731%
W06 Cryptography & secrets562341%
W07 Trust boundaries & request handling431433%
W08 Supply chain & data integrity291345%
W09 Information exposure & logging601423%
W10 Error handling & logic flaws541120%
In the ten classes69418326%
– Code quality & maintainability115––
– Hardware design102––
– Too general to classify26––
– Intentionally malicious code8––
– User interface & human factors9––
– Machine-learning model behavior2––
Outside the classes262––
All active weaknesses95618319%

Table 6. Active weaknesses in CWE v5.0 by weakness class or out-of-scope group, with the number in CWE-bench and the share of each class it covers.

ClassTasksPublicCWEsCWE IDs
W01 Injection27102074, 79, 80, 87, 88, 89, 91, 93, 94, 95, 113, 116, 564, 643, 644, 652, 838, 917, 1236, 1427
W02 Input validation & parsing2541820, 155, 176, 178, 179, 180, 184, 185, 187, 235, 462, 611, 777, 827, 1286, 1287, 1288, 1289
W03 Memory & resource safety401533125, 129, 130, 131, 170, 190, 191, 192, 195, 196, 362, 369, 401, 404, 412, 416, 457, 476, 606, 609, 680, 763, 772, 776, 787, 789, 823, 833, 834, 843, 908, 909, 1333
W04 Access control29102122, 59, 73, 250, 272, 273, 276, 283, 352, 377, 403, 425, 552, 639, 641, 648, 698, 732, 862, 863, 915
W05 Authentication & sessions231318256, 257, 287, 289, 290, 291, 303, 306, 307, 384, 488, 522, 613, 614, 620, 640, 836, 1004
W06 Cryptography & secrets281623295, 296, 297, 298, 299, 311, 312, 315, 319, 321, 323, 324, 326, 327, 328, 329, 330, 337, 347, 757, 760, 780, 916
W07 Trust boundaries & request handling18914345, 346, 348, 350, 444, 501, 565, 601, 784, 807, 918, 923, 942, 1021
W08 Supply chain & data integrity18813426, 427, 434, 454, 471, 472, 494, 502, 829, 1104, 1188, 1357, 1395
W09 Information exposure & logging25714117, 200, 201, 209, 212, 214, 219, 226, 359, 433, 524, 532, 598, 1230
W10 Error handling & logic flaws17811248, 252, 358, 460, 617, 636, 693, 703, 755, 837, 841
Total250100185

caption: tbl:5 CWEs in the evaluation set by weakness class, with the number of tasks, of public tasks, and of distinct CWEs in each class.

:::

fall outside them. CWE-bench contains 183 of the 694,3and its coverage of a class ranges from 16% for access control (W04) to 50% for injection (W01).

Out of scope. The 262 weaknesses outside the classes form six groups. Code-quality and maintainability weaknesses (115), such as dead code, excessive complexity, and missing documentation, do not by themselves make a repository exploitable, so no exploit can separate a vulnerable repository from a repaired one. Hardware-design weaknesses (102), the members of the CWE Hardware Design view, concern circuits, on-chip fabrics, and debug logic rather than software repositories. Intentionally malicious code (8), such as trojan horses and logic bombs, is planted rather than introduced by mistake. User-interface weaknesses (9), such as missing warnings and homoglyphs, depend on how a person perceives the interface, and two weaknesses concern the behavior of machine-learning models rather than the code that calls them. The remaining 26 entries, the eight CWE pillars and broad design classes such as violation of secure design principles (CWE-657), are too general to place in one class; their concrete descendants are classified individually.

Expanding coverage. CWE-bench can grow in two directions. Within the ten classes, 511 weaknesses have no task yet, most of them in access control (104), memory and resource safety (102), and input validation and parsing (80). Each fits the existing task format of an injected vulnerability checked by an exploit and functionality tests. Beyond the classes, hardware-design weaknesses fit the same format on hardware-description repositories, with simulation testbenches in place of program exploits, and planted malicious code fits an audit task in which the agent must find and remove the code. Code-quality, user-interface, and model-behavior weaknesses have no exploit that confirms a repair, and remain outside the task format.

Released Artifacts

The 100 public tasks are released as a Hugging Face dataset (https://huggingface.co/datasets/collinear-ai/cwe-bench). Each task is a self-contained Harbor task comprising a Dockerized environment with the repository, the audit instruction, the deterministic verifier, and the reference patch. The dataset ships a registry, so the full public set can be run directly from the Hub:

harbor run --repo "https://huggingface.co/datasets/collinear-ai/cwe-bench" \

-d [email protected] -k 4 --agent <agent> --model <model> --env docker

We also release the 4,400 rollouts behind the public-set results in Table 3 (eleven agents, four attempts per task) at https://huggingface.co/buckets/collinear-ai/cwe-bench-rollouts, with their trajectories, final patches, and verifier logs, an index of every rollout with its reward, token counts, and cost, and a script that recomputes the public-set pass@1, pass@4, and cost in Table 3. A leaderboard is maintained at https://cwe-bench.com and https://huggingface.co/spaces/collinear-ai/cwe-bench-leaderboard. The 150 held-out tasks are not released; agents can be evaluated on them on request.

Item Response Theory Analysis

As another view of the results, we fit a Rasch item response theory (IRT) model (Rodriguez et al., 2021) to the outcomes on all 250 tasks in Table 3. The model treats the passing attempts cmjc_{mj} of agent mm on task jj out of nmjn_{mj} as

cmj∼Binomial⁡(nmj,pmj),pmj=11+exp⁡{−(θm−bj)},(2)c_{mj} \sim\operatorname{Binomial}(n_{mj},p_{mj}), \qquad p_{mj} = \frac{1}{1+\exp\left\{-(\theta_m-b_j)\right\}}, \tag*{(2)}

where θm\theta_m is the ability of agent mm and bjb_j the difficulty of task jj. Abilities are centered at zero, and intervals come from 300 bootstrap refits.

Because every agent attempted every task four times, the fitted abilities follow the pass@1 ordering; what the model adds is a placement of tasks and agents on the same scale. Figure 6 shows the fitted success curves for three tiers of agents. Claude Opus 5.5, Muse Wonder, Gemini 4 Argon, and GPT-6 Astra have overlapping intervals, above a middle tier of DeepSeek V4.1 Flash and Grok 4.7 and a lower tier of the remaining five agents. On the task of median difficulty, the predicted chance of success is 77%, 61%, and 42% for the three tiers. Sixty-six tasks have an estimated difficulty above the strongest agent’s ability (48 to 78 across bootstrap refits, 95% interval), meaning even the strongest agent is predicted to solve them less than half the time.

Figure 6. Predicted chance of solving a task as a function of task difficulty, from a Rasch model fit to the outcomes on all 250 tasks in Table 3. Each curve uses the mean ability of one tier: top (Claude Opus 5.5, Muse Wonder, Gemini 4 Argon, GPT-6 Astra), middle (DeepSeek V4.1 Flash, Grok 4.7), and lower (Hy4 Preview, Mistral Large 4, Qwen 3.8 Max, Kimi K3.1 Pro, GLM 5.3). The vertical line marks the task of median difficulty. Below, each circle is one task placed by its estimated difficulty; hollow circles are tasks that every agent always or never solved. The shaded region contains the 66 tasks the strongest agent is predicted to solve less than half the time.

References

  1. [1]Andy K Zhang, Neil Perry, Riya Dulepet, Joey Ji, Celeste Menders, Justin Lin, Eliot Jones, Gashon Hussein, Samantha Liu, Donovan Jasper, Pura Peetathawatchai, Ari Glenn, Vikram Sivashankar, Daniel Zamoshchin, Leo Glikbarg, Derek Askaryar, Haoxiang Yang, Aolin Zhang, Rishi Alluri, Nathan Tran, Rinnara Sangpisit, Kenny Oseleonomen, Dan Boneh, Daniel Ho, and Percy Liang. CyBench: A framework for evaluating cybersecurity capabilities and risks of language models. In Y. Yue, A. Garg, N. Peng, F. Sha, and R. Yu, editors, International Conference on Learning Representations, volume 2025, pages 25094–25243, 2025. URL https://proceedings.iclr.cc/paper_files/paper/2025/file/3e9412a9c1d93810ef3ef7825115016b-Paper-Conference.pdf.arxiv.org/abs/2408.08926
  2. [2]Yuxuan Zhu, Antony Kellermann, Dylan Bowman, Philip Li, Akul Gupta, Adarsh Danda, Richard Fang, Conner Jensen, Eric Ihli, Jason Benn, Jet Geronimo, Avi Dhir, Sudhit Rao, Kaicheng Yu, Twm Stone, and Daniel Kang. CVE-bench: A benchmark for AI agents’ ability to exploit real-world web application vulnerabilities. In Aarti Singh, Maryam Fazel, Daniel Hsu, Simon Lacoste-Julien, Felix Berkenkamp, Tegan Maharaj, Kiri Wagstaff, and Jerry Zhu, editors, Proceedings of the 42nd International Conference on Machine Learning, volume 267 of Proceedings of Machine Learning Research, pages 79850–79867. PMLR, 13–19 Jul 2025. URL https://proceedings.mlr.press/v267/zhu25i.html.arxiv.org/abs/2503.17332
  3. [4]Zichao Wei, Jun Zeng, Ming Wen, Zeliang Yu, Kai Cheng, Yiding Zhu, Jingyi Guo, Shiqi Zhou, Le Yin, Xiaodong Su, and Zhechao Ma. Patcheval: A new benchmark for evaluating llms on patching real-world vulnerabilities, 2025. URL https://arxiv.org/abs/2511.11019.
  4. [5]Xianzhen Luo, Jingyuan Zhang, Shiqi Zhou, Jinyang Huang, Chuan Xiao, Qingfu Zhu, Zhiyuan Ma, Yue Xing, Yang Yue, Wencong Zeng, and Wanxiang Che. CVE-factory: Scaling expert-level agentic tasks for code security vulnerability. In Tong Zhang, Miroslav Dudik, Martin Jaggi, Alekh Agarwal, Sharon Li, Dale Schuurmans, Jerry Zhu, Felix Berkenkamp, Hanze Dong, and Alberto Bietti, editors, Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 83137–83168. PMLR, 06–11 Jul 2026a. URL https://proceedings.mlr.press/v306/luo26aj.html.arxiv.org/abs/2602.03012
  5. [6]Tan Bui, Ting Zhang, Ferdian Thung, Yunpeng Xiong, Penghao Jiang, Xin Zhou, and David Lo. Vul4py: Benchmarking automated vulnerability repair in python with paired exploit and functional oracles, 2026. URL https://arxiv.org/abs/2608.00692.
  6. [7]Xiaoan Luo, Yue Huang, Kehan Guo, Ping He, Chuan Zou, Chujie Gao, Lichi Li, Yuchen Ma, Zhangchen Xu, Zichen Chen, Yufei Han, and Xiangliang Zhang. Secprobe: Adaptive evaluation of coding agents on cybersecurity vulnerabilities, 2026b. URL https://arxiv.org/abs/2609.33763.
  7. [8]Chih ao Shen, Jiacheng Li, Aastha Mahajan, Jeffery Siyuan Tian, Yonghwi Kwon, and Yizheng Chen. Patchbench: Evaluating ai agents for vulnerability patching, 2026. URL https://arxiv.org/abs/2609.04075.
  8. [9]Tianneng Shi, Robin Rheem, Dongwei Jiang, Mona Wang, Francisco De La Riega, Zhun Wang, Jingzhi Jiang, Alexander Cheung, Sean Tai, Jonah Cha, Jianhong Tu, Gabriel Han, Chenguang Wang, Jingxuan He, Wenbo Guo, and Dawn Song. CyberGym-E2E: Scalable real-world benchmark for AI agents’ end-to-end cybersecurity capabilities. In Tong Zhang, Miroslav Dudik, Martin Jaggi, Alekh Agarwal, Sharon Li, Dale Schuurmans, Jerry Zhu, Felix Berkenkamp, Hanze Dong, and Alberto Bietti, editors, Proceedings of the 43rd International Conference on Machine Learning, volume 306 of Proceedings of Machine Learning Research, pages 112094–112108. PMLR, 06–11 Jul 2026. URL https://proceedings.mlr.press/v306/shi26r.html.
  9. [10]Nancy Lau, Louis Sloot, Jyoutir Raj, Giuseppe Marco Boscardin, Evan Harris, Dylan Bowman, Mario Brajk ovski, Ja ideep Chawla, and Dan Zhao. Zerodaybench: Evaluating llm agents on unseen zero-day vulnerabilities for cyberdefense, 2026. URL https://arxiv.org/abs/2603.02297.
  10. [11]Zhun Wang, Nico Schiller, Hongwei Li, Srijith Sesha Narayana, Milad Nasr, Nicholas Carlini, Xiangyu Qi, Eric Wallace, Elie Bursztein, Luca Invernizzi, Kurt Thomas, Yan Shoshaitishvili, Wenbo Guo, Jingxuan He, Thorsten Holz, and Dawn Song. Exploitgym: Can ai agents turn security vulnerabilities into real attacks?, 2026a. URL https://arxiv.org/abs/2605.11086.
  11. [12]Seunghyun Lee and David Brumley. Exploitbench: A capability ladder benchmark for llm cybersecurity agents, 2026. URL https://arxiv.org/abs/2605.14153.
  12. [13]Gelei Deng, Yi Liu, Yuekang Li, Ruozhao Yang, Xiaofei Xie, Jie Zhang, Han Qiu, and Tianwei Zhang. What makes a good llm agent for real-world penetration testing?, 2026. URL https://arxiv.org/abs/2602.17622.
  13. [14]Hwiwon Lee, Ziqi Zhang, Hanxiao Lu, and LINGMING ZHANG. Sec-bench: Automated benchmarking of llm agents on real-world software security tasks. In D. Belgrave, C. Zhang, H. Lin, R. Pascanu, P. Koniusz, M. Ghassemi, and N. Chen, editors, Advances in Neural Information Processing Systems, volume 38, Main Conference, pages 116342–116378. Curran Associates, Inc., 2025. doi: 10.52202/085713-3878. URL https://proceedings.neurips.cc/paper_files/paper/2025/file/a9168f1c54e51470271e8cf83e1a775-Paper-Conference.pdf.
  14. [15]Zichao Qi, Fan Long, Sara Achour, and Martin Rinard. An analysis of patch plausibility and correctness for generate-and-validate patch generation systems. In Proceedings of the 2015 International Symposium on Software Testing and Analysis, ISSTA ’15, page 24–36. ACM, 2015. doi: 10.1145/2771783.2771791. URL http://dx.doi.org/10.1145/2771783.2771791.
  15. [16]TJ Byun, Cornelius Aschermann, Kai Yuan Thng, Wu Zhou, Yupeng Yang, Lauren Deason, and Joshua Saxe. Introducing AutoPatch-Bench: A benchmark for AI-powered security fixes. Engineering at Meta, April 2025. URL https://engineering.fb.com/2025/04/29/ai-research/autopatchbench-benchmark-ai-powered-security-fixes/. Technical release, April 29, 2025. Accessed September 30, 2026.
  16. [17]Zheng Yu, Wenxuan Shi, Xinqian Sun, Zheyun Feng, Meng Xu, and Xinyu Xing. Patch validation in automated vulnerability repair, 2026. URL https://arxiv.org/abs/2603.06858.
  17. [18]Hwiwon Lee, Jiawei Liu, Dongjun Kim, Wubing Xia, Ziqi Zhang, Chunqiu Steven Xia, and Lingming Zhang. Sec-bench pro: Can language models solve long-horizon software security tasks?, 2026. URL https://arxiv.org/abs/2605.26548.

Paper details

vlnc:W_afdkj9x8
Version
v1 · latest
Published
Fresh — added to the Hub within the last 30 days
Added
License
CC BY 4.0
Usage

views · 0

downloads · 0

A view counts once per browser per day, a download each time the PDF is requested.

  • Computer Science

agentic judges

View statement
Looking for related papers…
Contents