mlsanityData to 14 Oct 2026

Red Teaming Program Repair Agents: When Correct Patches can Hide Vulnerabilities

arXiv 2509.25894 ↗First posted 30 Sep 2025cs.SEcited by 5

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

  1. 2024AgentPoison: Red-teaming LLM Agents via Poisoning Memory or Knowledge Bases17 Jul

Other references · 30

  1. 2024SWE-agent: Agent-Computer Interfaces Enable Automated Software Engineeringcited by 1,737
  2. 2021Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributionscited by 431
  3. 2023Detecting Language Model Attacks with Perplexitycited by 431
  4. 2024Agentless: Demystifying LLM-based Software Engineering Agentscited by 421
  5. 2021Unified Pre-training for Program Understanding and Generationcited by 366
  6. 2024AutoCodeRover: Autonomous Program Improvementcited by 278
  7. 2023Certifying LLM Safety against Adversarial Promptingcited by 266
  8. 2020Unsupervised Translation of Programming Languagescited by 263
  9. 2024RepairAgent: An Autonomous, LLM-Based Agent for Program Repaircited by 232
  10. 2024LLM-Based Multi-Agent Systems for Software Engineering: Literature Review, Vision and the Road Aheadcited by 155
  11. 2018SequenceR: Sequence-to-Sequence Learning for End-to-End Program Repaircited by 145
  12. 2024MAGIS: LLM-Based Multi-Agent Framework for GitHub Issue Resolutioncited by 134
18 more
  1. 2025Trae Agent: An LLM-based Agent for Software Engineering with Test-time Scalingcited by 94
  2. 2021CURE: Code-Aware Neural Machine Translation for Automatic Program Repaircited by 86
  3. 2024From LLMs to LLM-based Agents for Software Engineering: A Survey of Current, Challenges and Futurecited by 86
  4. 2024MarsCode Agent: AI-native Automated Bug Fixingcited by 71
  5. 2025OrcaLoca: An LLM Agent Framework for Software Issue Localizationcited by 45
  6. 2024An LLM-Assisted Easy-to-Trigger Backdoor Attack on Code Completion Models: Injecting Disguised Vulnerabilities against Strong Detectioncited by 40
  7. 2024A Deep Dive into Large Language Models for Automated Bug Localization and Repaircited by 39
  8. 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 33
  9. 2025A Survey on Backdoor Threats in Large Language Models (LLMs): Attacks, Defenses, and Evaluationscited by 27
  10. 2025Code Graph Model (CGM): A Graph-Integrated Large Language Model for Repository-Level Software Engineering Taskscited by 27
  11. 2024An Empirical Study on LLM-based Agents for Automated Bug Fixingcited by 23
  12. 2024PromSec: Prompt Optimization for Secure Generation of Functional Source Code with Large Language Models (LLMs)cited by 19
  13. 2024Black-Box Adversarial Attacks on LLM-Based Code Completioncited by 14
  14. 2025Challenges and Paths Towards AI for Software Engineeringcited by 11
  15. 2025AgentMesh: A Cooperative Multi-Agent Generative AI Framework for Software Development Automationcited by 9
  16. 2024Poisoning Programs by Un-Repairing Code: Security Concerns of AI-generated Codecited by 6
  17. 2024MaPPing Your Model: Assessing the Impact of Adversarial Attacks on LLM-based Programming Assistantscited by 5
  18. 2025Adversarial Bug Reports as a Security Risk in Language Model-Based Automated Program Repaircited by 4

Built on by

Cited by year (2026 to 14 Oct)

Citing papers per year: 2026: 5.

5 papers.

Similar, not cited

Close in wording, no citation either way

  1. 2025How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-bench
  2. 2025Evaluating Agent-based Program Repair at Google
  3. 2025Understanding Automated Program Repair Agents Through the Lens of Traceability: An Empirical Study
  4. 2025From LLMs to Agents: A Comparative Evaluation of LLMs and LLM-based Agents in Security Patch Detection
  5. 2024Evaluating Software Development Agents: Patch Patterns, Code Quality, and Issue Complexity in Real-World GitHub Scenarios
  6. 2026VulnResolver: A Hybrid Agent Framework for LLM-Based Automated Vulnerability Issue Resolution
  7. 2025LLM Agents for Automated Web Vulnerability Reproduction: Are We There Yet?
  8. 2025When "Correct" Is Not Safe: Can We Trust Functionally Correct Patches Generated by Code Agents?