mlsanityData to 7 Oct 2026

AI Code in the Wild: Measuring Security Risks and Ecosystem Shifts of AI-Generated Code in Modern Software

arXiv 2512.18567 ↗First posted 21 Dec 2025cs.SE cs.AIcited by 4

Not on the map. Why?

Abstract (arXiv)

Large language models (LLMs) for code generation are becoming integral to modern software development, but their real-world prevalence and security impact remain poorly understood. We present the first large-scale empirical study of AI-generated code (AIGCode) in the wild. We build a high-precision detection pipeline and a representative benchmark to distinguish AIGCode from human-written code, and apply them to (i) development commits from the top 1,000 GitHub repositories (2022-2025) and (ii) 7,000+ recent CVE-linked code changes. This lets us label commits, files, and functions along a human/AI axis and trace how AIGCode moves through projects and vulnerability life cycles. Our measurements show three ecological patterns. First, AIGCode is already a substantial fraction of new code, but adoption is structured: AI concentrates in glue code, tests, refactoring, documentation, and other boilerplate, while core logic and security-critical configurations remain mostly human-written. Second, adoption has security consequences: some CWE families are overrepresented in AI-tagged code, and near-identical insecure templates recur across unrelated projects, suggesting "AI-induced vulnerabilities" propagated by shared models rather than shared maintainers. Third, in human-AI edit chains, AI introduces high-throughput changes while humans act as security gatekeepers; when review is shallow, AI-introduced defects persist longer, remain exposed on network-accessible surfaces, and spread to more files and repositories. We will open-source the complete dataset and release analysis artifacts and fine-grained documentation of our methodology and findings.

Key facts. Cited by 4 papers in the map (data through 7 Oct 2026). Builds on 34 of its 59 references that are in the map. First posted on arXiv 21 Dec 2025.

Builds on

34 of 59 references.

References · 34

  1. 2021Evaluating Large Language Models Trained on Codecited by 8,053
  2. 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,286
  3. 2023The Impact of AI on Developer Productivity: Evidence from GitHub Copilotcited by 264
  4. 2022Do Users Write More Insecure Code with AI Assistants?cited by 186
  5. 2025A Survey on Code Generation with LLM-based Agentscited by 104
  6. 2022Natural Attack for Pre-trained Models of Codecited by 72
  7. 2023Evaluating the Code Quality of AI-Assisted Code Generation Tools: An Empirical Study on GitHub Copilot, Amazon CodeWhisperer, and ChatGPTcited by 71
  8. 2023CodeLMSec Benchmark: Systematically Evaluating and Finding Security Vulnerabilities in Black-Box Code Language Modelscited by 52
  9. 2023Security Weaknesses of Copilot-Generated Code in GitHub Projects: An Empirical Studycited by 36
  10. 2024Automatic Programming: Large Language Models and Beyondcited by 35
  11. 2023Vulnerabilities in AI Code Generators: Exploring Targeted Data Poisoning Attackscited by 29
  12. 2024CodeIP: A Grammar-Guided Multi-Bit Watermark for Large Language Models of Codecited by 21
22 more
  1. 2025SecVulEval: Benchmarking LLMs for Real-World C/C++ Vulnerability Detectioncited by 19
  2. 2024Assessing AI Detectors in Identifying AI-Generated Code: Implications for Educationcited by 18
  3. 2024Transforming Software Development: Evaluating the Efficiency and Challenges of GitHub Copilot in Real-World Projectscited by 18
  4. 2024Exploring the Limitations of Detecting Machine-Generated Textcited by 15
  5. 2025MCPGuard : Automatically Detecting Vulnerabilities in MCP Serverscited by 13
  6. 2024Just another copy and paste? Comparing the security vulnerabilities of ChatGPT generated code and StackOverflow answerscited by 12
  7. 2025A.S.E: A Repository-Level Benchmark for Evaluating Security in AI-Generated Codecited by 12
  8. 2024The Impact of Generative AI on Collaborative Open-Source Software Development: Evidence from GitHub Copilotcited by 11
  9. 2024LLMs: A Game-Changer for Software Engineers?cited by 11
  10. 2025Security Degradation in Iterative AI Code Generation -- A Systematic Analysis of the Paradoxcited by 10
  11. 2025textttDroid: A Resource Suite for AI-Generated Code Detectioncited by 9
  12. 2016Predicting the Popularity of GitHub Repositoriescited by 6
  13. 2024Enhancing Security of AI-Based Code Synthesis with GitHub Copilot via Cheap and Efficient Prompt-Engineeringcited by 6
  14. 2024ChatGPT Code Detection: Techniques for Uncovering the Source of Codecited by 6
  15. 2025CodeMirage: A Multi-Lingual Benchmark for Detecting AI-Generated and Paraphrased Source Code from Production-Level LLMscited by 6
  16. 2025Assessing the Quality and Security of AI-Generated Code: A Quantitative Analysiscited by 5
  17. 2025RefleXGen:The unexamined code is not worth usingcited by 4
  18. 2025Is Your Prompt Poisoning Code? Defect Induction Rates and Security Mitigation Strategiescited by 3
  19. 2025A Rigorous Turing Test: a Foundation for Evaluating Artificial General Intelligencecited by 2
  20. 2025MultiAIGCD: A Comprehensive dataset for AI Generated Code Detection Covering Multiple Languages, Models,Prompts, and Scenarioscited by 2
  21. 2025The Hidden DNA of LLM-Generated JavaScript: Structural Patterns Enable High-Accuracy Authorship Attributioncited by 2
  22. 2024Enhancing Source Code Classification Effectiveness via Prompt Learning Incorporating Knowledge Featurescited by 1

Built on by

Cited by year (2026 to 7 Oct)

Citing papers per year: 2026: 4.

4 papers.