ACM Transactions on Software Engineering and Methodology· 2026Q1
How Safe Are AI-Generated Patches? A Large-scale Study on Security Risks in LLM and Agentic Automated Program Repair on SWE-bench
- 26citations
- Q1SCImago
- 2026year
Short summary
AI-generated code patches introduce significantly more vulnerabilities than human-written ones, with Llama 3.3 introducing 135 confirmed vulnerabilities compared to 12 in developer patches on SWE-bench.
AI-generated from the title and abstract; the full text is not read.
Key points
- AI-generated patches introduce more vulnerabilities than human-written patches in automated program repair.
- Llama 3.3 introduced 135 confirmed vulnerabilities, while developer patches introduced 12 on SWE-bench.
- GPT-5.4 nano introduced 3 vulnerabilities, compared to 2 in developer patches.
- All four agentic frameworks evaluated also introduced vulnerabilities, with OpenHands having the highest count (44).
- Vulnerabilities are linked to broader code modifications and issues lacking specific information.
AI-generated from the title and abstract; the full text is not read.
Abstract
Large language models (LLMs) and agentic frameworks are increasingly used for development tasks such as automated program repair (APR). Prior work has identified security risks in LLM-generated code, but most studies focus on synthetic, simplified, or isolated tasks. We present a large-scale security analysis of LLM-generated patches using 20,000+ GitHub issues from SWE-bench. We evaluate developer-written patches, two standalone LLMs (Llama 3.3 Instruct-70B and GPT-5.4 nano), and four agentic frameworks (OpenHands, AutoCodeRover, HoneyComb, and SWE-agent). We also analyze code, issue, and project-level factors associated with insecure patches. Under our evaluated SWE-bench setup, Llama 3.3 introduced 135 manually confirmed vulnerabilities across the train and test sets, compared with 12 in developer-written patches for the same issues. On the SWE-bench test set, GPT-5.4 nano introduced 3 vulnerabilities compared with 2 in developer patches. All four evaluated agentic frameworks also introduced vulnerabilities. OpenHands had the highest retained count, with 44 vulnerabilities across 11 issue instances. Vulnerabilities are associated with broader code modifications and with issues missing specific information. These results suggest that APR systems require proactive risk assessment methods that consider both generated code and issue context.
The authors' abstract, as published at the source. ACM Transactions on Software Engineering and Methodology, 2026 · DOI ↗
Continue with a free account
Ask the paper: 5 free questions a day about this paper; save it, get its citation, new summaries every day for your field. Takeaways are Premium.
Continue free on the webSign in with Google or Apple; no card needed. You come back to this paper.
On your phone:
Field: Information Systems
Information SystemsComputer Science