Releases: cla7aye15I4nd/PatchAgent
v2.1.0
What's Changed
- Upgrade langchain dependencies to version 1.1.0 and refactor imports … by @cla7aye15I4nd in #9
Full Changelog: v2.0.2...v2.1.0
v2.0.2
Full Changelog: v2.0.1...v2.0.2
v2.0.1
Full Changelog: v2.0.0...v2.0.1
v2.0.0
What's Changed
- Update README.md by @cla7aye15I4nd in #7
- Update README.md by @cla7aye15I4nd in #8
Full Changelog: v1.1.0...v2.0.0
v1.1.0
What's Changed
- Sync upstream code by @cla7aye15I4nd in #5
- Update README.md by @cla7aye15I4nd in #6
Full Changelog: v1.0.1...v1.1.0
v1.0.1
What's Changed
- Update pyproject toml depdency by @cla7aye15I4nd in #4
Full Changelog: v1.0.0...v1.0.1
v1.0.0
What's Changed
- Change default log path by @cla7aye15I4nd in #1
- Fix ossfuzz logic by @cla7aye15I4nd in #2
- Update ci by @cla7aye15I4nd in #3
New Contributors
- @cla7aye15I4nd made their first contribution in #1
Full Changelog: https://github.com/cla7aye15I4nd/PatchAgent/commits/v1.0.0
PatchAgent
Note
The original research repository is located at osf.io/8k2ac.
This repository is a production-focused fork dedicated to real-world bug fixing.
📋 Overview
PatchAgent is an LLM-based program repair agent that mimics human expertise to automatically generate patches for real-world bugs. It integrates:
- Language Server Protocol: For accurate code navigation and analysis
- Patch Verification: For ensuring correct and safe fixes
- Interaction Optimization: To achieve human-like reasoning during vulnerability repair
🚀 Getting Started
Prerequisites
- Python 3.12+
- Docker (for OSS-Fuzz integration)
- Git
Installation
# Pull the image
docker pull ghcr.io/cla7aye15i4nd/patchagent:latest
# Run the container
docker run -it --privileged ghcr.io/cla7aye15i4nd/patchagent:latestEnvironment Configuration
Create a .env file based on the template:
cp .env.template .env
# Edit .env with your API keys and configuration💻 Usage Example
PatchAgent can be used to repair real-world bugs. Here's a simple example to repair an OSS-Fuzz issue:
from patchagent.agent.generator import agent_generator
from patchagent.builder import OSSFuzzBuilder
from patchagent.task import PatchTask
# Initialize the task with a crash reproduction
patchtask = PatchTask(
["poc.bin"], # Proof of Concept file(s)
"libpng_read_fuzzer", # Name of the fuzz target
OSSFuzzBuilder(
"libpng", # Project name
"/path/to/libpng", # Source path
"/path/to/oss-fuzz", # OSS-Fuzz path
),
)
# Run the repair process
patchtask.repair(agent_generator(patchtask))🛠️ Development Setup
For development, we recommend using the VS Code devcontainer:
- Install the VS Code Remote Development Extension
- Open the repository in VS Code
- When prompted, click "Reopen in Container"
This will set up a fully configured development environment with all the necessary tools.
🔧 Supported Languages and Sanitizers
Languages
- C/C++
- Java
Sanitizers
- AddressSanitizer (ASan)
- MemorySanitizer (MSan)
- UndefinedBehaviorSanitizer (UBSan)
- Jazzer (Java fuzzing)
🏆 Fixed Vulnerabilities
Below is a sample of the vulnerabilities fixed by PatchAgent. More will be disclosed as responsible disclosure periods end.
| Repository | Stars | Vulnerabilities |
|---|---|---|
| assimp | 11.4k | #5763, #5764, #5765 |
| libssh2 | 1.4k | #1508 |
| hdf5 | 0.6k | #5201, #5210 |
| libredwg | 1.0k | #1061 |
| Pcap++ | 2.8k | #1678, #1680 |
📄 License
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.
📞 Contact
For questions, bugs, or feature requests:
- Create GitHub issues
- For direct communication related to PatchAgent, contact Zheng Yu
📚 Citation
To cite PatchAgent in scientific publications, please use:
@article{PatchAgent,
title = {PatchAgent: A Practical Program Repair Agent Mimicking Human Expertise},
author = {Yu, Zheng and Guo, Ziyi and Wu, Yuhang and Yu, Jiahao and
Xu, Meng and Mu, Dongliang and Chen, Yan and Xing, Xinyu},
booktitle = {34rd USENIX Security Symposium (USENIX Security 25)},
year = {2025}
}