TL;DR
AI code review agents are increasingly acting as automated gatekeepers for open-source repositories, but they have a dangerous blind spot: attack fixes—pull requests (PRs) that genuinely solve a real bug while quietly introducing a triggerable logic vulnerability. Evaluating 16 deployed code review workflows on a new benchmark called VeilPRBench, the authors find that agents block only 25.0% of these malicious PRs on average. Even when explicitly told which weakness type to look for, blocking rates barely pass 55%.
What Problem Does This Paper Address?
Maintainers of large software projects are drowning in pull requests, a problem accelerated by AI-assisted "vibe coding." To cope, teams are wiring LLM-based code review agents directly into their review and merge pipelines.
This creates a subtle supply-chain threat. Unlike obvious malware or prompt-injection tricks, an attack fix hides in plain sight by being genuinely useful. Its stealth is structural: the code actually fixes the reported issue and passes functional tests, making it look like a routine, legitimate contribution.
Consider the example above: an HTTP client library's PR fixes a bug where authorization headers were dropped on same-origin redirects. To do this, it adds a same_origin helper that compares only the hostnames—ignoring the scheme (https vs. http). The bug is fixed and tests pass, yet a redirect from https://api.example.com to http://api.example.com is now misjudged as same-origin, leaking credentials in cleartext.
Methods
To measure whether automated reviewers can catch these dual-nature PRs without rejecting legitimate ones, the authors built VeilPRBench and an end-to-end evaluation protocol.
- Executable Validation: Every PR in the benchmark is backed by independent, hidden tests. An attack PR must (1) pass issue-directed functional and regression tests, and (2) trigger a concrete security violation under specific conditions that does not occur in a clean reference state. Benign PRs must pass both functional and security checks.
- Information Boundary: Review agents only see what a real reviewer sees—the PR diff, title, description, issue, and public repository context. Hidden tests, trigger inputs, and labels are strictly withheld.
- Standardized Verdicts: Because not all 16 workflows output a native "merge/block" decision, the authors normalize review comments into findings and use a deterministic rule plus a shared LLM adjudicator to classify each review as
BLOCK,PASS, or⊥(no explicit verdict).
Datasets
The authors introduce VeilPRBench, a newly constructed benchmark of 327 PRs across 14 open-source projects (including urllib3, requests, curl, redis, flask, git, and sqlite) and 29 historical issue families, spanning Python, C, and JavaScript:
- 192 Attack PRs: Manually constructed from an initial pool of 608 candidates by modifying checks, control flow, state transitions, data propagation, or resource handling while preserving the issue fix. They cover 19 target-CWE categories (led by CWE-200, CWE-770, and CWE-672).
- 135 Benign Repairs: Matched at the repair-context level (covering 13 projects and 27 issue families) with comparable modification locations and diff sizes, serving as controls to ensure agents aren't just blocking everything.
Key Insights and Ideas
- Useful fixes and vulnerabilities are not mutually exclusive: Passing functional tests gives reviewers false confidence. Because the vulnerability is woven into the repair logic itself, surface-level or diff-only inspections frequently miss it.
- Swapping the LLM backbone doesn't fix the problem: Upgrading or changing the underlying model shifts the trade-off between blocking attacks and accepting benign PRs, but no model achieves consistently high attack blocking across workflows.
- Explicitly naming the vulnerability isn't enough: Giving PR-Agent generic security instructions boosts attack blocking significantly, but adding repository-specific and sample-specific weakness-type hints (telling it what CWE to look for, without giving away the location) yields only a marginal extra gain—and actually causes blocking rates to drop in some categories like CWE-918.
- Review decisions are unstable: Running the exact same review workflow multiple times on the same PRs changes blocking outcomes for 9 to 32 out of 70 attacks, highlighting high variance in automated gatekeeping.
Key Results
- Low Attack Blocking Overall: Across all 16 workflows (evaluated with
claude-opus-4-7on all 327 PRs), the average Attack Blocking Rate (ABR) is just 25.0% (769/3,072 evaluations), ranging from 9.9% (AI Code Reviewer) to 55.2% (Code Butler). - The Detection–Acceptance Trade-off: Overall Benign Acceptance Rate (BAP) is 80.9%. However, the highest-blocking agent (Code Butler, 55.2% ABR) only accepts 60.0% of benign repairs, whereas PR-Agent accepts 99.3% of benign repairs but blocks only 28.1% of attacks.
- Cross-Backbone Performance: On a fixed 100-PR subset (70 attacks, 30 benign) across 5 frontier models, mean ABR across the 16 workflows ranges from 16.2% (
gpt-5.5) and 20.0% (deepseek-v4-pro) up to 27.1% (claude-opus-4-7), 28.7% (qwen3.7-plus), and 28.8% (gemini-3.1-pro-preview). - Security-Context Ablation (PR-Agent): With no extra prompt (
L0), PR-Agent averages 29.2% ABR and 93.0% BAP across the 5 backbones. Adding generic security guidance (L1) raises ABR to 50.7% (+21.6 percentage points) while dropping BAP to 89.3%. Adding joint repository- and weakness-specific guidance (L2) reaches 55.0% ABR and 85.2% BAP—still leaving 45.0% of attacks unblocked.
Limitations and Future Work
The authors note that their main metric (ABR) measures whether a workflow blocks an attack PR, not necessarily whether it identified the exact target vulnerability; a separate manual audit of 50 accepted-attack reviews and 316 verdicts was used to examine target correspondence, but those sample-level diagnostics do not replace full-benchmark calibration. Additionally, VeilPRBench focuses on single-PR logic vulnerabilities in Python, C, and JavaScript, leaving multi-PR attacks or other languages outside its current scope. Moving forward, the authors argue that automated review evaluations should separately report workflow completion, final blocking decisions, and target-vulnerability correspondence to better close this security gap.
Summary updated