AI code security pass rates hit 73% for top models
New testing shows that while AI-generated code is becoming safer, even the best models still fail more than one in four security tasks.
The short version
- Average security pass rate for AI-generated code rose from 56% to 62% in the latest fall 2026 report.
- Claude Opus 5.5 and GPT-6-Sol tied for the highest security pass rate at 73%.
- The share of AI-generated code containing vulnerabilities dropped from 44% to 38%.
- Top models now achieve nearly 100% syntax accuracy, making it harder to spot security flaws by sight alone.
Why it matters
For developers, this means that 'clean' looking code is no longer a reliable indicator of safety. Security leaders now have concrete benchmarks to weigh the risks of using AI assistants in production environments.
A measurable shift in safety
AI-generated code has shown measurable improvements in security over the last year. According to a report by Veracode, the average security pass rate for these models climbed from 56% to 62%. This shift indicates that newer frontier releases are beginning to handle common security weaknesses more effectively than previous versions.
The data shows that the share of results containing vulnerabilities fell from 44% to 38%. While these are significant gains for a metric that had previously remained stagnant, the progress is not uniform across all models. The report highlights a long tail of weaker results, suggesting that choosing the right model still matters significantly for security-conscious teams.
The most advanced models from two rival labs reached a new ceiling in the fall 2026 testing. Claude Opus 5.5 from Anthropic and GPT-6-Sol from OpenAI both tied for the top spot with a 73% security pass rate. This represents a five-point increase over the previous high of 68% set by GPT-5.5 in July 2026.
The gap between syntax and security
One of the most striking findings in the report is the disparity between a model's ability to write functional code and its ability to write secure code. Five of the top six models scored 100% on syntax, meaning the code they generate almost always compiles and runs correctly. This is a major leap from the early days of code models, where simple errors like missing brackets were common.
However, high syntax scores can be deceptive for human reviewers. Because the code looks finished and functional, developers might be less likely to scrutinize it for hidden flaws. A model that never emits a syntax error removes one of the natural alarms that used to flag low-quality or poorly constructed output for human eyes.
The gap between these two metrics remains wide for the leading models. For example, Claude Opus 5.5 achieved a perfect 100% syntax rate but only a 73% security pass rate. This 27-point gap serves as a practical warning: a passing build does not guarantee that the code is safe from hostile input or other common exploits.
How the models were tested
Veracode evaluated 18 different models across four major programming languages, including Python, C#, JavaScript, and Java. The testing focused on four specific categories of weaknesses identified by Common Weakness Enumeration (CWE) numbers. These categories include well-known flaws like CWE-89, CWE-327, CWE-80, and CWE-117.
The test design was intended to see how models apply security habits across different coding environments. Because models are trained on massive amounts of public code, they often learn common shortcuts found in tutorials and forums. These shortcuts can lead to insecure patterns that the models replicate when generating new code for users.
The results showed that model performance varies significantly even within the same product family. For instance, GPT-6-Luna tied for seventh place with a 66% score, trailing its sibling GPT-6-Sol by seven points. Similarly, Claude Sonnet 5 also scored 66%, trailing the Claude Opus 5.5 model by the same margin. This suggests that choosing a mid-tier or older model can result in a noticeable drop in security quality.
Implications for engineering teams
For organizations already shipping AI-assisted code, these results provide a concrete baseline for risk management. Security leaders now have a named, vendor-specific number to weigh against the productivity gains promised by AI coding assistants. A 73% pass rate at the top of the leaderboard means that even the best tools still fail more than one in four security tasks.
This data may change how procurement teams evaluate different AI tools. Buyers who handle sensitive payment data may prioritize models that perform better on specific weakness classes rather than looking at blended averages. They may also begin to demand more granular breakdowns of how models perform across different programming languages.
The findings also strengthen the case for using automated security tools alongside AI. Since AI-generated code still has a 27% failure rate at the highest level, static analysis and dependency scanning remain essential. Companies can use these benchmarks to justify the cost of maintaining a robust security pipeline to catch the flaws that the AI models miss.
The future of AI security benchmarks
The shift toward measurable security metrics may change how AI labs develop their models. Once a leaderboard becomes public, security pass rates can become a competitive metric that sales teams use to differentiate their products. This could lead to more intentional tuning of models to avoid common vulnerabilities like those listed in the CWE categories.
However, there is a risk that models could be over-optimized for specific benchmark tests. A model tuned to ace four specific categories might still struggle with others that are not included in the current evaluation. Experts suggest that future editions of the test may need to broaden their coverage to see if these security gains generalize to real-world risks.
As the market matures, the conversation will likely move toward the trade-offs between cost, latency, and security. While the top-performing models in the Veracode test are more expensive, teams must decide if paying a premium for a 73% pass rate is better than using a cheaper model with a lower score. For now, the results show that while AI is getting smarter, human oversight remains a requirement.
What to watch
- Whether future Veracode reports expand the number of CWE categories tested.
- How vendors respond to the specific naming of their models in security leaderboards.
- If the gap between syntax accuracy and security pass rates continues to widen as models improve.
Try it
Check your team's current AI coding assistant's documentation to see if they provide any specific security benchmarks or pass rates for common vulnerabilities.
Sources and links
- Officialaverage security pass rate for AI-generated code rose from 56% to 62% veracode.com
- Reportingshattered.io: the article we sourced
Liked it? Say why
Add a line for other readers.
No account needed. We never show your email. Comments with links, ads or abuse are held and not shown. Your comment shows after a quick check.
Listen to the AI Wire headlines
Listen to the AI WireListen to our daily AI shows every morning: on your commute, in the shower, wherever you are
Listen to the daily showsFirst reported by shattered.io · Read the original. Written by the SI Agent News Desk from the reporting above.Written with AI from the source above. Every number is checked against the source. Spot a mistake? Corrections.
