--- license: mit pretty_name: PatchBench size_categories: - n<1K task_categories: - text-generation language: - en tags: - code - security - vulnerability-repair - program-repair - agents - benchmark - fuzzing configs: - config_name: default data_files: - split: test path: data/test-*.parquet --- # PatchBench [![ArXiv](https://img.shields.io/badge/arXiv-2609.04075-b31b1b?style=flat&logo=arxiv&logoColor=white)](https://arxiv.org/abs/2609.04075) [![GitHub](https://img.shields.io/badge/GitHub-ai--sec--lab%2FPatchBench-181717?style=flat&logo=github&logoColor=white)](https://github.com/ai-sec-lab/PatchBench) [![License](https://img.shields.io/badge/License-MIT-blue?style=flat)](https://github.com/ai-sec-lab/PatchBench/blob/main/LICENSE) PatchBench is a benchmark for evaluating AI agents on realistic vulnerability patching tasks: **213 tasks drawn from 32 popular GitHub C/C++ projects**. It selects vulnerabilities whose ground-truth fixes lie *outside* the crash stack, and uses vulnerability transplant plus code mutation to mitigate surface-level fixes and patch memorization. This repository holds the **task metadata**, one row per task to identify the project, the exact repository state, the crash, and the reference patch. ## Dataset Structure Each example contains: - **id**: Unique task identifier, also naming the task's image (Same as the one in [ARVO](https://github.com/n132/ARVO-Meta)) - **image**: Docker Hub image for the task, `anonymous3619/vulpatch:{id}-vul` - **project**: Real-world repository name - **repo_addr**: Repository URL - **base_commit**: Historical commit at which the vulnerability is still present, upstream of the developer's fixing commit - **inverted_commit**: Newer upstream commit the vulnerability was transplanted onto - **fuzzer**: Fuzzing engine that produced the crash, one of `libfuzzer`, `honggfuzz`, `afl`, `aflpp` - **sanitizer_type**: The error detection tool type - **command**: Command that reproduces the crash inside the image, with the PoC at `/tmp/poc` - **sanitizer_report**: Sanitizer output for the original PoC, including the crash stack - **patch**: Reference patch against the task repository `base_commit`, `inverted_commit` and `patch` are **ground truth** and are not visible to the agent during inference. ## Dataset Usage ```python from datasets import load_dataset dataset = load_dataset("ai-sec-lab/PatchBench", split="test") ``` Filtering works the usual way: ```python libxml2 = dataset.filter(lambda r: r["project"] == "libxml2") ubsan = dataset.filter(lambda r: r["sanitizer_type"] == "ubsan") ``` ## Evaluation See our repo for details: [ai-sec-lab/PatchBench](https://github.com/ai-sec-lab/PatchBench). ## Citation ```bibtex @misc{shen2026PatchBench, title = {{{PatchBench}}: Evaluating {{AI}} Agents for Vulnerability Patching}, author = {Shen, Chihao and Li, Jiacheng and Mahajan, Aastha and Tian, Jeffery Siyuan and Kwon, Yonghwi and Chen, Yizheng}, year = 2026, number = {arXiv:2609.04075}, eprint = {2609.04075} } ```