A New Benchmark for Evaluating LLMs / Agents on Patching Real-World Vulnerabilities
📢 News
[2026/07/24] We release PatchEval-Verified, with updated Docker evaluation environments for 230 CVEs. In the original PatchEval, some PoC tests were adapted from project regression tests and were tied too closely to particular patch implementations. We revised these tests to evaluate whether a vulnerability is fixed, rather than requiring a specific fix, improving robustness and reducing false negatives.
[2025/11/18] PatchEval is released as a benchmark for evaluating Large Language Models and agents on real-world vulnerability repair.
👋 Overview
PatchEval-Verified evaluates LLMs and coding agents on automated repair of real-world vulnerabilities. This repository provides 230 CVE cases with Docker-based evaluation environments, covering vulnerabilities reported between 2015 and 2025 across Go, JavaScript, and Python. Every image contains the vulnerable repository and a validation entrypoint.
The main improvement over the original PatchEval release is the upgraded evaluation harness:
Less implementation coupling: a valid repair should not need to reproduce the official patch or one specific implementation strategy.
Stronger vulnerability validation: the validation tests are designed to check whether the vulnerability remains exploitable after applying the generated patch.
More robust scoring: strengthened test logic reduces accidental passes and rejection of semantically correct alternative fixes.
The repository also provides a streamlined two-stage workflow:
1. Generate patches with a CLI coding agent
patcheval/exp_agent/run_infer.sh
2. Evaluate generated patches in the verified Docker environments
patcheval/exp_agent/run_eval.sh
-> patcheval/evaluation/run_evaluation.py
The included agent adapters are:
Codex CLI
OpenCode
TraeCLI
The figure below illustrates the overall design of the original PatchEval benchmark. This repository focuses on the 230 Docker-verified cases and the dynamic evaluation workflow.
💻 Getting Started
Requirements
Operating System: Linux.
Python: Python 3.10+; Python 3.12 is recommended.
Docker: Docker must be installed and available to the current user.
CPU: 16 or more cores are recommended for parallel experiments.
Disk Storage: Reserve at least 500 GB if pulling all 230 images locally.
[!NOTE]
programing_language is the field name used by the released dataset and is intentionally preserved for compatibility.
The agent runner uses cve_description, repo, and image_url to construct the task and runtime environment. Reference information such as patch_url and fix_func is not included in the agent prompt and should not be used as a repair source.
Docker Images
scripts/images.txt contains the same 230 image references recorded by image_url in the verified dataset. Image names follow this form:
CONCURRENCY controls parallel patch-generation containers, while MAX_WORKERS controls parallel evaluation containers. Replace codex with opencode or traecli to use another adapter. See patcheval/exp_agent/README.md for the required agent-specific environment variables.
🧪 Standalone Patch Evaluation
To evaluate patches generated by another system, prepare a JSON or JSONL file whose entries contain:
run_infer.sh returns a non-zero exit code if any selected case fails, while preserving all generated patches and logs. Failed generation cases are represented by empty patch files and remain in the evaluation input, where they are counted as failed repairs.
📁 Outputs
A patch-generation run creates:
patcheval/exp_agent/agent_runs/<timestamp>-<prefix>/
├── patches/ # one patch file per CVE
├── .work/ # prompts and agent stdout/stderr
├── results.jsonl # per-case generation status
├── run_metadata.json
└── summary.json # generated/failed counts
We welcome issues, bug reports, improvements to the verified validation environments, agent adapters, and reproducibility scripts.
📖 Citation
If you find PatchEval useful for your research and applications, please cite:
@misc{wei2025patcheval,
title={PATCHEVAL: A New Benchmark for Evaluating LLMs on Patching Real-World Vulnerabilities},
author={Zichao Wei and Jun Zeng and Ming Wen and Zeliang Yu and Kai Cheng and Yiding Zhu and Jingyi Guo and Shiqi Zhou and Le Yin and Xiaodong Su and Zhechao Ma},
year={2025},
eprint={2511.11019},
archivePrefix={arXiv},
primaryClass={cs.CR},
url={https://arxiv.org/abs/2511.11019},
}
✍️ License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.
A New Benchmark for Evaluating LLMs / Agents on Patching Real-World Vulnerabilities
📢 News
👋 Overview
PatchEval-Verified evaluates LLMs and coding agents on automated repair of real-world vulnerabilities. This repository provides 230 CVE cases with Docker-based evaluation environments, covering vulnerabilities reported between 2015 and 2025 across Go, JavaScript, and Python. Every image contains the vulnerable repository and a validation entrypoint.
The main improvement over the original PatchEval release is the upgraded evaluation harness:
The repository also provides a streamlined two-stage workflow:
The included agent adapters are:
The figure below illustrates the overall design of the original PatchEval benchmark. This repository focuses on the 230 Docker-verified cases and the dynamic evaluation workflow.
💻 Getting Started
Requirements
Setup
Verify both Docker and the Python Docker SDK:
📜 Repository Structure
📊 Verified Dataset and Docker Images
Dataset
The metadata used by both patch generation and evaluation is:
It contains 230 entries with fields including:
The agent runner uses
cve_description,repo, andimage_urlto construct the task and runtime environment. Reference information such aspatch_urlandfix_funcis not included in the agent prompt and should not be used as a repair source.Docker Images
scripts/images.txtcontains the same 230 image references recorded byimage_urlin the verified dataset. Image names follow this form:Pull all images with:
The script pulls images concurrently. Make sure the images required by your selected cases are available locally before evaluation.
🚀 CLI Agent Patch Generation and Evaluation
The verified workflow has been smoke-tested with the included
codex,opencode, andtraecliadapters. All adapters use the same two-step interface:Start with one case before scaling to the complete dataset.
Codex smoke test
Full 230-case run
CONCURRENCYcontrols parallel patch-generation containers, whileMAX_WORKERScontrols parallel evaluation containers. Replacecodexwithopencodeortraeclito use another adapter. See patcheval/exp_agent/README.md for the required agent-specific environment variables.🧪 Standalone Patch Evaluation
To evaluate patches generated by another system, prepare a JSON or JSONL file whose entries contain:
Then run:
For every patch, the evaluator:
image_url;/workspace/fix.patch;cd /workspace && bash fix-run.shwith a 600-second command timeout;A repair passes only when
fix-run.shexits successfully. See patcheval/evaluation/README.md for details.run_infer.shreturns a non-zero exit code if any selected case fails, while preserving all generated patches and logs. Failed generation cases are represented by empty patch files and remain in the evaluation input, where they are counted as failed repairs.📁 Outputs
A patch-generation run creates:
run_eval.shconverts these patches to:Evaluation results are written to:
📈 Results on PatchEval-Verified
Coming soon…
🚀 Contributions
We welcome issues, bug reports, improvements to the verified validation environments, agent adapters, and reproducibility scripts.
📖 Citation
If you find PatchEval useful for your research and applications, please cite:
✍️ License
This project is licensed under the Apache License 2.0. See the LICENSE file for details.