Omer Bin SaleemBuild with AI Subscribe
← All research AI · Security2 sources

AI code got smarter. It did not get safer.

AI-generated code passes syntax checks almost 100% of the time. It passes security checks 56% of the time.

Slide 1 of 9: AI code got smarter. It did not get safer.Slide 2 of 9: AI code got smarter. It did not get safer.Slide 3 of 9: AI code got smarter. It did not get safer.Slide 4 of 9: AI code got smarter. It did not get safer.Slide 5 of 9: AI code got smarter. It did not get safer.Slide 6 of 9: AI code got smarter. It did not get safer.Slide 7 of 9: AI code got smarter. It did not get safer.Slide 8 of 9: AI code got smarter. It did not get safer.Slide 9 of 9: AI code got smarter. It did not get safer.

The numbers

  1. AI-generated code, 2026

    It compiles. It isn’t secure.

    Syntax pass rate~100%the code runs
    Security pass rate56%virtually unchanged since last year

    Source: Veracode, 2026 GenAI Code Security Report (vendor)

  2. The best model tested68%

    Still fails about 1 in 3 security tasks.

    Source: Veracode, 2026 GenAI Code Security Report

  3. Security pass rate by model size

    Bigger models didn’t help

    • Large models53%
    • Medium models51%
    • Small models51%

    Source: Veracode, 2026 GenAI Code Security Report

  4. By language

    Java is the riskiest

    Python63%security pass rate
    Java30%security pass rate

    Source: Veracode, 2026 GenAI Code Security Report

  5. 302,600 AI-written commits, 6,299 repos22.7%

    of the issues they introduced are still in the code today.

    Most were code smells, not vulnerabilities. Debt piles up quietly too.

    Source: arXiv 2603.28592, Mar 2026 (preprint, revised Oct 2026)

Treat AI code like untrusted input

  1. Security scan on every AI change. In CI, blocking, not a nightly report nobody opens.
  2. Put secure patterns in the agent’s rules. Parameterised queries, no secrets in code, approved libraries only.
  3. Review risky areas by hand. Auth, payments, file uploads, anything that touches user input.

Sources

  1. Veracode, 2026 GenAI Code Security Report (vendor), 28 Jul 2026
  2. Debt Behind the AI Boom, arXiv 2603.28592 (preprint), 30 Mar 2026, revised 13 Oct 2026