← Lab /AI/ML

Coding agents detect up to 91% of privacy defects when explicitly prompted

Coding agents can reliably identify privacy defects in code reviews when asked to check privacy

AI/ML arXiv 13 Nov 2026 Benchmark Prototype evidence

Published as “PrivacyPR: A Dataset of Real-World Privacy Fixes for Benchmarking Privacy-Aware Code Review”

Why it matters

Practitioners adopting agent-based code review should explicitly request privacy checks to improve detection, but must weigh the higher cost and increased false-positive rate.

Summary

Coding agents detect far more privacy defects when explicitly prompted (88-91% vs 42-51% under a generic prompt) but also raise many false alarms (11-15% of non-fix PRs) and incorrectly claim defects in 13-21% of correct fixes. The paper introduces PrivacyPR, a real-world dataset of 4,131 GitHub pull requests with privacy-related labels and a benchmark harness, and shows that prompt design matters more than model size for privacy-aware code review.

What they found 1

  1. Privacy-aware prompting raises defect detection from 42-51% to 88-91% for coding agents, but also increases false positives to 11-15% on non-fix PRs.

    “On Small, two coding agents detect only 42-51% of defects under a generic review prompt, but 88-91% when explicitly asked to check privacy, while flagging 11-15% of non-fix PRs.”

Caveats 4

  • Agents also claim a defect in 13-21% of the original fixes (single calls: 4-10%), so they are more sensitive but less specific.
  • The evaluation also has construct-validity risks: reverting fixes may expose easier cues than naturally occurring defects; each agent setting was run once; and all evaluated reviewers use Gemini models that may have seen the public fixes during training.
  • PrivacyPR relies on keyword retrieval and a single LLM annotation run, so it may miss privacy fixes and retain label noise; human validation covered only relatively small PRs and annotators saw the model labels.
  • The evaluation also has construct-validity risks: GPT-6.1 generates defect descriptions, screens tasks, and judges reviews; reverting fixes may expose easier cues than naturally occurring defects; each agent setting was run once; and all evaluated reviewers use Gemini models that may have seen the public fixes during training.

What’s new here 4

  • Links each privacy defect to its accepted fix and the surrounding review discussion, providing traceability absent in prior work.
  • Offers the largest cross-project collection of real privacy fixes (1,169) and non-fix PRs across 1,048 repositories.
  • Provides a manually validated test split (Verified) and an evaluation harness that reverts fixes to create realistic review tasks.
  • Includes LLM-generated privacy relevance, fix type, and GDPR principle annotations released publicly.