A monitor with a code terminal and the reflection of an open padlock on the screen

AI code compiles. But is it secure?

By Leonel Rocha · Product Designer

· 4 min read

Short answerData

Most of the time, you can't tell without checking. Veracode's July 2026 report shows that AI-generated code compiles in almost 100% of cases but passes security tests only 56% of the time, a number that has barely moved in a year. AI code needs to be reviewed and scanned like any code no one has reviewed.

Short answer

Most of the time, you can't tell without checking. Veracode's July 2026 report shows that AI-generated code compiles in almost 100% of cases but passes security tests only 56% of the time, a number that has barely moved in a year. AI code needs to be reviewed and scanned like any code no one has reviewed.

56%
of AI-generated code passes security tests
~100%
of generated code compiles without syntax errors
100+
AI models evaluated since the program began

AI models that write code get better every few months. They write faster, make fewer syntax errors and solve bigger problems. But one question still lacks the answer everyone wanted: is this code secure?

On July 28, 2026, Veracode, a US application security company, released its 2026 GenAI Code Security report. The short answer: a little over half the time.

What Veracode measured

The company tracks more than 100 AI models, across four rounds of testing since the program began. The mid-2026 ranking covers 11 models. The main results:

  • Generated code compiles in roughly 100% of cases.
  • The average pass rate on security tests is 56%.
  • Without explicitly asking for security in the prompt, the failure rate nears 44%.
  • The number is “virtually unchanged since last year's report.”

In other words: the code almost always runs and is secure a little over half the time. And that half isn't improving.

Close-up of a mechanical keyboard with a blue shield-shaped reflection
Compiling is the start; security takes review and scanning.

A bigger model doesn't fix it

The report knocks down a few common assumptions.

  • The top model in the ranking, OpenAI's GPT-5.5, passed 68% of tests. The worst, Alibaba's Qwen3.7-max, passed 50%.
  • Six of the 11 models landed between 50% and 53%.
  • Code-specialized models scored 51%. General-purpose models, 52%.
  • Large models, with more than 100 billion parameters, scored 53%. Medium and small ones, 51%.
  • Reasoning models did better: 56% versus 51%.

Language matters too. Python code passed 63% of tests. Java, only 30%, though it's the only language with consistent improvement over the past year.

Chris Wysopal, Veracode's co-founder, sums up the problem: models can be “nearly perfect at syntax” but still fail almost half the tasks.

Why this matters if you're launching

A founder building a product with AI sees the app open, the button work and the signup save. Everything compiles. It's natural to conclude it's ready.

The report shows why that conclusion is dangerous. Compiling is the easiest test. Security is invisible until the day someone exploits the flaw. And when that happens to a product holding customer data, the damage isn't just technical. It's about trust, and sometimes legal.

Many of the rescues that reach the Studio start like this: the product works, but nobody can say whether it's secure, as in the case of the Lovable showcase app that exposed 18,000 records.

Why the number won't move

The most uncomfortable data point in the report isn't the 56%. It's the stagnation. In a year, models got faster, cheaper and better at long tasks. The security rate stood still.

One reading is that models learn from code already on the internet, and a lot of that code has the same flaws. Another is that security depends on context: who the user is, what data they can see, what happens if a bad actor sends strange input. AI writes what you ask for. If you don't ask for security or describe that context, it has no way to guess.

For a founder, the practical takeaway is simple: waiting for the next model to fix it isn't a plan. The check has to be part of the process.

What we check before going live

Wysopal recommends treating AI code “like any unreviewed code: scan it, fix it and never ship it blind.” At the Studio, we use Claude Code every day. That's exactly why nothing AI writes goes to production without passing these checks:

  1. Login and permissions. Who can see what. Can one user reach another's data by changing a number in the URL?
  2. User input. Is every field the user fills in handled before it reaches the database or the screen?
  3. Secrets. API keys, passwords and tokens stay out of the code and out of the browser.
  4. Dependencies. Are the libraries the AI picked up to date and free of known flaws?
  5. Prompts that ask for security. The report itself shows failures rise when you don't ask. We always ask.
  6. Human review. Someone on the team reads and owns the code that goes to production. Automated analysis tools help, but they don't replace that read.

After launch, every system ships with an AI agent that runs daily, flags issues, suggests improvements and checks that the data makes sense. Checking doesn't end the day the product goes live.

What this means for you

If your product was built with AI, by you, a freelancer or another studio, ask three questions:

  1. Has anyone besides the AI reviewed the code?
  2. Has anyone tested what happens when a user tries to access what they shouldn't?
  3. Where are the system's keys and passwords stored?

If the answer to any of them is “I don't know,” the product can work perfectly and still be exposed.

If you have a product built with AI and want to know what's underneath before you grow, our project rescue service starts with that discovery.

Common questions

If my app was built with AI and it works, is it insecure?

Not necessarily, but working proves nothing about security. Based on Veracode's data, nearly half of tasks fail security tests. A review is worth it before you grow your user base.

Does using the most expensive AI model fix it?

Barely. The top model in the ranking passed 68% of tests; six of eleven landed between 50% and 53%. None of them removes the need for review.

What should you review first in an AI-built product?

Login and permissions, user input, secrets and keys in the code, and dependencies. Those are the spots where one flaw exposes customer data.

Sources

  1. Veracode 2026 GenAI Code Security Report Finds AI-Generated Code Security Has Stalled at 56% Pass RateVeracode · 2026-07-28 · EN

Related service

Project rescue

Stalled project, code with no owner or a system rushed out with AI: we audit it and ship it

View the service

Written by Leonel Rocha, Product Designer and founder of Studio Responsivo

Adobe Certified Expert · Adobe Instructor Design & Layout · Google UX Designer

News Responsivo

Get the next article in your inbox

Cost, timelines, AI and behind the scenes of shipping products. No spam.

Newsletter

News Responsivo

New articles in your inbox: cost, timelines and AI. No spam.

New Studio articles in your inbox: cost, timelines, AI and what we've learned shipping products. No spam. Unsubscribe anytime.

Check your email.

Your data stays with the Studio. Privacy