A study of more than 20,000 GitHub issues found vulnerabilities in patches from a standalone AI model and every tested autonomous repair framework.
Researchers examined patches for more than 20,000 GitHub issues in SWE-bench, a dataset of real software problems and the changes that fixed them. They compared developer-written patches with patches from two standalone AI models and four autonomous software-repair frameworks.
The risks varied by system. Llama 3.3 produced 135 manually confirmed vulnerabilities across the training and test sets, while developer patches for the same issues contained 12. On the test set, GPT-5.4 nano produced three vulnerabilities compared with two in developer patches. All four autonomous frameworks also produced vulnerabilities; OpenHands had the highest retained count, with 44 across 11 issue instances.
Where AI patches failed
The study found that AI repair systems can add security vulnerabilities while attempting to fix real software issues. Llama 3.3 introduced 135 manually confirmed vulnerabilities across the SWE-bench training and test sets, compared with 12 in developer-written patches for those same issues. On the test set, GPT-5.4 nano introduced three vulnerabilities, compared with two in developer patches.
Each of the four tested autonomous frameworks—OpenHands, AutoCodeRover, HoneyComb and SWE-agent—also introduced vulnerabilities. OpenHands had the highest retained count, with 44 vulnerabilities across 11 issue instances. The vulnerabilities were associated with broader code changes, more modified files, more types of files being changed and issue reports missing specific information such as code snippets. The study also found that the vulnerability patterns in Llama’s patches differed from those in developer-written code.
Why the risks matter
The findings indicate that passing a software repair task does not by itself establish that an AI-generated patch is secure. Because the risks were linked not only to the changed code but also to the amount of code changed and the information in the issue report, security checks could use both the patch and its surrounding context to identify changes that need closer review.
This is especially relevant as repair systems become more autonomous. The study supports developing risk-assessment methods that complement existing vulnerability detection and help focus manual security reviews on potentially higher-risk AI-generated patches.
Evidence and caveats
This was a large empirical analysis of patches for real GitHub issues in SWE-bench, rather than a study of synthetic code snippets. The researchers evaluated developer patches, Llama 3.3 patches across roughly 21,000 training and test instances, GPT-5.4 nano on the test set, and publicly released patches from four autonomous frameworks on the test set. Vulnerabilities were manually confirmed, and the analysis examined code-, issue- and project-level factors.
The results describe the evaluated SWE-bench setup and do not establish that every AI-generated patch is insecure or that the same rates apply to other models, tasks or workflows. The framework analysis was limited to the test set, and the study assessed AI contributions without later developer revision or human review. For the standalone Llama analysis, the model received the issue description and the exact files changed in the developer fix, an evaluation choice intended to isolate code-generation security rather than file-retrieval performance.
// Source
ACM Transactions on Software Engineering and Methodology · 2026 · DOI: 10.1145/3861341
Authors: Amirali Sajadi, Kostadin Damevski, Preetha Chatterjee
Institutions: Drexel University, Virginia Commonwealth University