CWE-bench v2 is a benchmark dataset from Collinear AI that tests whether AI agents can repair security weaknesses in real code. Each task hands the agent a checkout of an open-source repository and a short instruction. The agent must find and fix a weakness without breaking existing functionality. The public release has 100 tasks spanning 91 different entries of the Common Weakness Enumeration (CWE), the MITRE-maintained catalog of software weakness types.

How it is built

Every task is a self-contained Harbor task: a Dockerized environment, an instruction and a deterministic verifier. Scoring is fully programmatic, so results can be reproduced without extra cost. According to Collinear, the checks were curated with panels of LLM judges and every task was reviewed by hand. For each task the team asked whether the instruction reads like a realistic request, whether the verifier tests behavior rather than one specific fix, and whether the verifier rejects memorized solutions such as the known upstream patch. A held-out set that no model has seen is kept private and can be used by contacting Collinear.

How to use it

The dataset ships a registry.json, so the Harbor tool can run the benchmark directly from the Hugging Face repository with a chosen agent and model. Collinear recommends four attempts per task, and the reported score is the mean reward over all 400 trials. You must accept the dataset’s access conditions first and save a Hugging Face token to git’s credential helper. The tasks are also tagged as reinforcement-learning environments, so the same verifiers can supply rewards when training defensive agents.

What the first results show

Of 11 models evaluated, Gemini 4 Argon leads with 67.8% pass@1 and 81.0% pass@4, just ahead of Claude Opus 5.5. These are Collinear’s own results; see our full report on the release and our cheat sheet on pass@k for how to read them.

What to know before using it

  • Gated access. Accept the conditions on the dataset page before downloading.
  • Self-reported leaderboard. Results come from the publisher and community pull requests rather than an independent audit.
  • Defensive framing. The tasks ask agents to fix weaknesses, not to exploit them.