Red Teaming Program Repair Agents: When Correct Patches can Hide Vulnerabilities
On the map: LLM agents and tool use → Agent threats, guardrails and governance
also in 1 more
Abstract (arXiv)
LLM-based agents are increasingly deployed for software maintenance tasks such as automated program repair (APR). APR agents automatically fetch GitHub issues and use backend LLMs to generate patches that fix the reported bugs. However, existing work primarily focuses on the functional correctness of APR-generated patches, whether they pass hidden or regression tests, while largely ignoring potential security risks. Given the openness of platforms like GitHub, where any user can raise issues and participate in discussions, an important question arises: Can an adversarial user submit a valid issue on GitHub that misleads an LLM-based agent into generating a functionally correct but vulnerable patch? To answer this question, we propose SWExploit, which generates adversarial issue statements designed to make APR agents produce patches that are functionally correct yet vulnerable. SWExploit operates in three main steps: (1) program analysis to identify potential injection points for vulnerable payloads; (2) adversarial issue generation to provide misleading reproduction and error information while preserving the original issue semantics; and (3) iterative refinement of the adversarial issue statements based on the outputs of the APR agents. Empirical evaluation on three agent pipelines and five backend LLMs shows that SWExploit can produce patches that are both functionally correct and vulnerable (the attack success rate on the correct patch could reach 0.91, whereas the baseline ASRs are all below 0.20). Based on our evaluation, we are the first to challenge the traditional assumption that a patch passing all tests is inherently reliable and secure, highlighting critical limitations in the current evaluation paradigm for APR agents.
Key facts. Cited by 5 papers in the map (data through 14 Oct 2026). Placed in Agent threats, guardrails and governance, one of 16 directions in LLM agents and tool use. Builds on 31 of its 54 references that are in the map. First posted on arXiv 30 Sep 2025.
Builds on
31 of 54 references.
Closest ancestors · 1
Same direction, newest first
Other references · 30
- 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
- 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
- 2023Detecting Language Model Attacks with Perplexitycited by 431
- 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 421
- 2021Unified Pre-training for Program Understanding and Generationcited by 366
- 2024AutoCodeRover: Autonomous Program Improvementcited by 278
- 2023Certifying LLM Safety against Adversarial Promptingcited by 266
- 2020Unsupervised Translation of Programming Languagescited by 263
- 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 232
- 2024LLM-Based Multi-Agent Systems for Software Engineering: Literature Review, Vision and the Road Aheadcited by 155
- 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 145
- 2024MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolutioncited by 134
18 more
- 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scalingcited by 94
- 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 86
- 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 86
- 2024MarsCode Agent: AI-native Automated Bug Fixingcited by 71
- 2025OrcaLoca: An LLM Agent Framework for Software Issue Localizationcited by 45
- 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
- 2024A Deep Dive into Large Language Models for Automated Bug Localization and Repaircited by 39
- 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 33
- 2025A Survey on Backdoor Threats in Large Language Models (LLMs): Attacks, Defenses, and Evaluationscited by 27
- 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Taskscited by 27
- 2024An Empirical Study on LLM-based Agents for Automated Bug Fixingcited by 23
- 2024PromSec: Prompt Optimization for Secure Generation of Functional Source Code with Large Language Models (LLMs)cited by 19
- 2024Black-Box Adversarial Attacks on LLM-Based Code Completioncited by 14
- 2025Challenges and Paths Towards AI for Software Engineeringcited by 11
- 2025AgentMesh: A Cooperative Multi-Agent Generative AI Framework for Software Development Automationcited by 9
- 2024Poisoning Programs by Un-Repairing Code: Security Concerns of AI-generated Codecited by 6
- 2024MaPPing Your Model: Assessing the Impact of Adversarial Attacks on LLM-based Programming Assistantscited by 5
- 2025Adversarial Bug Reports as a Security Risk in Language Model-Based Automated Program Repaircited by 4
Built on by
Citing papers per year: 2026: 5.
5 papers.
- 2026Does Runtime Topology Context Improve LLM-Generated Kubernetes Security Patches?cited by 2
- 2026When Passing Tests Hides Vulnerabilities: An Empirical Study of Silent Failures in Agentic Systemscited by 1
- 2026Better Understanding, Better Fixes? A Study of Hallucination in LLM-based Automated Program Repaircited by 0
- 2026The History Is the Detector: Executing CVE Patch History, End-to-Endcited by 0
- 2026Adversarial Testing of Automated Program Repair Agents for Security Vulnerabilitiescited by 0
- 2026Adversarial Testing of Automated Program Repair Agents for Security Vulnerabilities14 Sep 2026
- 2026The History Is the Detector: Executing CVE Patch History, End-to-End4 Sep 2026
- 2026Better Understanding, Better Fixes? A Study of Hallucination in LLM-based Automated Program Repair4 Sep 2026
- 2026Does Runtime Topology Context Improve LLM-Generated Kubernetes Security Patches?28 Jul 2026
- 2026When Passing Tests Hides Vulnerabilities: An Empirical Study of Silent Failures in Agentic Systems25 Jun 2026
Similar, not cited
Close in wording, no citation either way
- 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-bench
- 2025Evaluating Agent-based Program Repair at Google
- 2025Understanding Automated Program Repair Agents Through the Lens of Traceability: An Empirical Study
- 2025From LLMs to Agents: A Comparative Evaluation of LLMs and LLM-based Agents in Security Patch Detection
- 2024Evaluating Software Development Agents: Patch Patterns, Code Quality, and Issue Complexity in Real-World GitHub Scenarios
- 2026VulnResolver: A Hybrid Agent Framework for LLM-Based Automated Vulnerability Issue Resolution
- 2025LLM Agents for Automated Web Vulnerability Reproduction: Are We There Yet?
- 2025When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?