Review the evidence before patching: EviRepair hits 93% on SecBench, 30 points over Codex

EviRepair: Evidence-Driven Agents for Reliable Vulnerability Repair

Yilian Shi, Qingyu Liu, Tianyi Zhou, Wende Tan, Chenyang Si, Yueming Lyu, Xia Hu, Dongrui Liu

cs.CR

2026-10-09

EviRepair has agents gather and cross-check vulnerability evidence before patching, lifting resolved rates 16.37% on PatchEval and 40.33% on SecBench over agent baselines.

What problem this solves

Agent-based repair of real repository vulnerabilities has a blind spot: evidence. Single-agent pipelines fold analysis, patching, and validation into one workflow, so an unreviewed diagnostic conclusion steers the patch, and an early misreading propagates all the way down. Multi-agent setups split the roles but simply pool each agent's intermediate output, with no check that the findings agree before a patch is written. A vulnerability report also states what is suspected, not what was observed. EviRepair, from Nanjing University, Shanghai Artificial Intelligence Laboratory, and Imperial College London, treats every claim in the report as a hypothesis; only evidence gathered from the repository enters the repair pipeline.

Method

Two stages, joined by a reviewed Vulnerability Model. Each agent runs in its own context and exchanges results only through structured records with fixed fields.

Vulnerability Diagnosis: collect evidence, then cross-check it. An Analysis Coordinator reads the report, explores the repository, forms security hypotheses (entry point, sink, vulnerability class), and dispatches three agents in parallel, none of which can see the others' findings:

An Evidence Consistency Reviewer then checks that the findings describe one vulnerability, cover the report's claims, and that the oracle runs. Two hard rules are fixed in the pipeline: agreement among agents is not evidence, and a claim supported only by the report is never confirmed. A failed check triggers a targeted re-dispatch of just the responsible agent, with verified evidence retained. What passes becomes a five-field model: root cause, attack path, runtime oracle, security boundary, preserved behaviors.

Patch Synthesis: the model is a specification; failures change the patch, never the diagnosis. A Repair Coordinator translates the model into a validation matrix, one case and expected outcome per row; claims diagnosis could not confirm are recorded as unverified cases, so leftover uncertainty is handed to repair explicitly. The Patch Synthesizer writes a single patch at the root cause (not a filter for the reproducer input) and runs the full matrix. A Patch Reviewer then judges in an isolated context, blind to the Synthesizer's reasoning. Passing the matrix is necessary but not sufficient, since the system built the matrix itself; the patch must also match the model: fix the root cause, remove the unsafe behavior, keep the old one.

Results

PatchEval (230 CVE tasks, description only, no PoC) and SEC-bench (200 CVE tasks plus 100 OSS-Fuzz tasks that come with sanitizer output), against Codex v0.153.2 and OpenCode v1.17.7, three backbones (DeepSeek-V4.1-Flash, GLM-5.2, Qwen3.8-27B), equal 5-hour budgets, network disabled. Resolved rates averaged over backbones:

System (3-backbone avg)PatchEvalSEC-bench
Codex70.00%62.56%
OpenCode71.89%83.33%
EviRepair79.13%93.11%

Against the stronger baseline, OpenCode, the share of unresolved tasks drops about 26% on PatchEval and 59% on SEC-bench. Across 21 same-backbone, same-subset comparisons, EviRepair is best in 18 and ties once; it loses JavaScript under DeepSeek-V4.1-Flash and OSS-Fuzz under Qwen3.8-27B.

The gains have structure. On SEC-bench's CVE subset (description only), EviRepair averages 92.83%, 41.17 points over Codex; on OSS-Fuzz, where sanitizer reports pinpoint the crash, all systems are strong and margins shrink. On PatchEval the biggest gains come on authorization flaws (CWE-863/285) and open redirect (CWE-601), repairs that hinge on drawing the line between permitted and rejected requests; SSRF (CWE-918) shows no advantage, which the authors attribute to the network-isolated sandbox, since reproducing SSRF needs outbound requests. The pattern holds across both benchmarks: the further the fix sits from where the vulnerability manifests, the more evidence reconstruction pays.

Ablations (GLM-5.2, PatchEval): reverting either stage to a single agent takes 73.04% down to 69.13% or 67.83%; reverting both drops it to 60.87%, a 12.17-point loss that exceeds the 9.12-point sum of the individual losses, so the two checkpoints back each other up. And Qwen3.8-27B, the smallest backbone, resolves 75.22% of PatchEval under EviRepair, beating both baselines running the larger GLM-5.2 (67.39% and 60.87%); the margin over the strongest baseline grows from 1.30 points on the largest backbone to 8.26 on the smallest.

Why it matters

Two portable lessons, more than the framework itself. First, making evidence review an explicit gate with hard rules (“agreement is not evidence”) beats stacking more agent roles; the 30-point gap over Codex on SEC-bench (backbone average) comes from evidence reconstruction, not a stronger model, since all systems share the same backbone. Second, structured evidence compensates for a weak backbone: a 27B model with this pipeline overtakes larger models running bare, so compute-limited teams can trade orchestration time for model cost.

The cold water: the average absolute lead is 7 to 9 points on PatchEval and 9.78 points over OpenCode on SEC-bench; the headline 40.33% average improvement is lifted by Codex's weak 62.56% on SEC-bench.

Limitations

The authors list three: evaluation covers only two benchmarks; security assessment stops at hidden tests, with no guarantee the vulnerability is eliminated, that nothing regresses, or that the patch stays maintainable; and the multi-agent design adds calls, latency, and cost. The third comes with no numbers, though token cost per extra review loop is the first question a real deployment asks.

Multi-file repair is a clear failure zone: 7 of the 230 PatchEval tasks span three or more files, OpenCode does best on them, and EviRepair resolves none of the ones requiring four or more files. The authors admit the Vulnerability Model centers on a single root cause and attack path, so fixes coordinating changes across files fall outside the representation. Resolved rate also measures passing hidden tests, which is not the same as closing the vulnerability, a point the authors concede in the ethics statement.

Terms

Source

What people are saying

Related papers

All paper explainers