All projects

Research · first author · 2026

P2Patch

Vulnerability repair where an exploit agent keeps attacking each patch until it holds.

  • LLM agents
  • Automated repair
  • Security
P2Patch run dashboard: a CVE run marked accepted, with the pipeline stages from Docker build through exploiter, patcher and verifier agents, and a coverage score of 100.

Overview

A patch that blocks the demonstrated exploit has not necessarily fixed the bug. P2Patch turns that into the repair objective: an exploiter agent reproduces the vulnerability, a patcher agent fixes it, and then the exploiter receives the patched program and hunts for a bypass of the same weakness. Every execution-confirmed bypass becomes a permanent requirement the final patch must block. Exploits used during repair are kept strictly separate from the held-out suites used to score it.

Contributions and results

  • Held-out fix-closed coverage rose from 78.1% to 84.7%, and beyond-upstream coverage from 42.1% to 62.5%, against single-pass repair on the same agent and model (101 CVEs across Java and C/C++; Holm-adjusted p = 0.029).
  • The adversarial loop found a bypass in up to 41% of runs after the patch had already blocked its own exploit.
  • An attribution ablation placed the gain in the adversarial loop, not in having a working exploit alone.
  • Honest about cost and scope: most subjects tie, and the loop costs about 4.6× per subject.
P2Patch workflow: subject isolation, exploit bootstrap, adversarial hardening between patcher and exploiter agents, and certification against held-out suites.
The workflow figure from the paper.

More projects

All projects