MilesUp

← Blog

How secure is AI-generated code? What the research says in 2026

MilesUp · 2 December 2026

AI coding tools now write working code almost every time. Whether that code is secure is a separate question. University researchers, developer surveys and security companies give a consistent answer: often not, and not much better than a year ago.

The short version
  • In a peer-reviewed Stanford study, developers with an AI assistant wrote less secure code than those without one, and were more likely to believe their code was secure.
  • Georgia Tech traced 35 published vulnerabilities to AI coding tools in March 2026 alone, more than in all of 2025.
  • In Veracode's 2026 lab tests, 44% of AI code-generation tasks introduced a security vulnerability, almost unchanged from 45% in 2025.
  • Developers know it: in Stack Overflow's 2025 survey, 46% distrust the accuracy of AI tools and only 3% highly trust it.

How we picked these sources

We group the sources by who produced them, and we say who each one is. Peer-reviewed and university research has no product to sell. Developer surveys show what practitioners see day to day. Security companies publish useful data, but they sell tools that address the problems they report, so we list them last and label them.

Peer-reviewed research

Stanford: developers with AI wrote less secure code and trusted it more

Who: Perry, Srivastava, Kumar and Boneh, Stanford University · Published: ACM CCS 2023

In what the authors call the first large-scale user study of its kind, they compared participants who had an AI assistant (based on OpenAI's codex-davinci-002 model) with participants who did not.

The second finding is the important one for teams shipping with AI: the risk is not only in the code, but in the false confidence that comes with it.

NYU: about 40% of Copilot's code was vulnerable

Who: Pearce, Ahmad, Tan, Dolan-Gavitt and Karri, New York University · Published: IEEE Symposium on Security and Privacy 2022

The researchers asked GitHub Copilot to complete 89 security-relevant scenarios, producing 1,689 programs. About 40% were vulnerable. It was one of the first rigorous studies of AI-written code, and later work, including the 2026 results below, keeps finding the same pattern.

University tracking

Georgia Tech: vulnerabilities from AI tools are now showing up in public code

Who: Systems Software & Security Lab, School of Cybersecurity and Privacy, Georgia Tech · Published: 9 April 2026

Georgia Tech's Vibe Security Radar scans public security advisories and traces each vulnerability back through the code history to see whether an AI coding tool wrote it, using signals such as co-author tags and bot emails in commits.

43,000+

security advisories scanned

74

confirmed cases so far: 14 critical, 25 high

~18

cases in the second half of 2025, over seven months

35

in March 2026 alone, more than all of 2025 combined

The radar only sees code that still carries an AI tool's signature, so it misses tools that leave no trace. The researchers say Claude Code and Copilot make up most detections partly because they leave the clearest signatures. Treat these numbers as a floor.

Developer surveys

Google DORA 2025: more AI, less stable delivery

Who: DORA, Google Cloud's long-running software delivery research program · Published: 23 September 2025 · Google also sells AI coding tools

~5,000

technology professionals surveyed worldwide

90%

use AI at work

30%

have little or no trust in AI-generated code

DORA found that AI now helps teams ship faster, but that AI adoption still has a negative relationship with software delivery stability. More changes, shipped faster, lead to more failures unless testing and review keep up.

Stack Overflow 2025: developers don't trust AI's accuracy

Who: Stack Overflow's annual Developer Survey · Published: 2025, over 33,000 responses on the AI questions

84%

use or plan to use AI tools, up from 76%

46%

distrust the accuracy of AI tools; 33% trust it

3%

highly trust AI output

66%

say their top frustration is AI code that is "almost right, but not quite"

Security vendor research

Veracode: lab tests across 100+ models

Who: Veracode, an application security testing company · Published: July 2025 and July 2026

Veracode gives AI models coding tasks that can each be solved securely or insecurely, and checks the output with static analysis. The tasks cover SQL injection, weak cryptography, cross-site scripting (XSS) and log injection, in Java, Python, C# and JavaScript.

2025 report

2026 report

44%

of AI code-generation tasks introduced a risky vulnerability

56%

average security pass rate, vs 55% in the first report

~100%

of generated code is now syntactically correct

The code compiles and runs, and models are good at avoiding SQL injection, but they still rarely escape output correctly for the web or clean what they write to logs.

CodeRabbit: AI vs human pull requests

Who: CodeRabbit, an AI code review company · Published: 17 December 2025

CodeRabbit compared 470 open-source GitHub pull requests: 320 co-authored by AI and 150 written by humans only.

10.83

issues per AI co-authored PR, vs 6.45 for human-only

~1.7×

more issues overall in AI PRs

2.74×

the high end for security issues

CodeRabbit inferred AI authorship from signals in each PR and says it cannot guarantee that every PR labelled human-only had no AI help.

Escape.tech: live vibe-coded apps on the internet

Who: Escape, an API security testing company · Published: October 2025, updated June 2026

Escape scanned real, publicly deployed apps built with vibe-coding platforms, mostly Lovable, plus Create.xyz, Base44, Vibe Studio and Bolt.new.

5,600+

public vibe-coded apps analysed

2,000+

high-impact vulnerabilities

400+

exposed secrets, such as API keys

175

instances of exposed personal data, including medical records

Escape calls these a lower-bound estimate from a single snapshot. Its summary page uses an earlier count, 2,038 critical vulnerabilities across 1.4K apps.

What this means if your app was built with AI

These studies use different methods and samples, so read them as direction, not as a forecast for any single app. The only way to know where your app stands is to check its code.

Sources

  1. Perry et al., "Do Users Write More Insecure Code with AI Assistants?", ACM CCS 2023: https://arxiv.org/abs/2211.03622 (published version: https://doi.org/10.1145/3576915.3623157)
  2. Pearce et al., "Asleep at the Keyboard? Assessing the Security of GitHub Copilot's Code Contributions", IEEE S&P 2022: https://arxiv.org/abs/2108.09293
  3. Georgia Tech College of Computing, "Bad Vibes: AI-Generated Code is Vulnerable, Researchers Warn" (9 April 2026): https://www.cc.gatech.edu/news/bad-vibes-ai-generated-code-vulnerable-researchers-warn
  4. Vibe Security Radar dashboard (linked from the Georgia Tech article): https://vibe-radar-ten.vercel.app/
  5. Google Cloud, "Announcing the 2025 DORA Report: State of AI-Assisted Software Development" (23 September 2025): https://cloud.google.com/blog/products/ai-machine-learning/announcing-the-2025-dora-report
  6. Google, "How are developers using AI? Inside our 2025 DORA report" (23 September 2025): https://blog.google/technology/developers/dora-report-2025/
  7. Stack Overflow Developer Survey 2025, AI section: https://survey.stackoverflow.co/2025/ai
  8. Veracode, 2025 GenAI Code Security Report press release (30 July 2025): https://www.veracode.com/press-release/ai-generated-code-poses-major-security-risks-in-nearly-half-of-all-development-tasks-veracode-research-reveals/
  9. Veracode, 2026 GenAI Code Security Report (28 July 2026): https://www.veracode.com/blog/2026-genai-code-security-report-ai-risk/
  10. CodeRabbit, State of AI vs Human Code Generation Report (17 December 2025): https://www.coderabbit.ai/blog/state-of-ai-vs-human-code-generation-report
  11. Escape.tech, methodology (29 October 2025, updated 17 June 2026): https://escape.tech/blog/methodology-how-we-discovered-vulnerabilities-apps-built-with-vibe-coding/
  12. Escape.tech, state of security of vibe-coded apps: https://escape.tech/state-of-security-of-vibe-coded-apps

Figures checked against each source on 2 December 2026.