Code written by AI models is getting harder to hack, at least a little. Veracode's latest GenAI Code Security Report puts the security score for AI-generated code at 62%, up from 56% in its previous study, with vulnerability rates dropping from 44% to 38%. The firm calls it the first real improvement it has measured in more than a year of tracking the problem.
"We've been analyzing code generated by multiple LLMs for more than a year. Until now, we have not seen a marked improvement in AI code security, despite consistently near-perfect functionality," said Chris Wysopal, Veracode's co-founder and chief security evangelist. "This is the first time since running our study that we've been able to report a meaningful move on the security dial."
Anthropic's Claude Opus 5.5 and OpenAI's GPT-6-Sol are tied for the top spot at 73%, ahead of the previous high of 68% set by GPT-5.5 back in July 2026. Veracode tested 18 models in total, writing code in Python, C#, JavaScript and Java, and checking it against four categories of known weakness: SQL injection, weak cryptography, cross-site scripting and log injection. Ten of those 18 models now clear the 60% mark, compared with just four in the last round. The weakest models still sit between 44% and 50%.
The gains are concentrated in one place
Most of that improvement traces back to a single category: cross-site scripting, or XSS, where attackers slip malicious script into a web page through unvalidated input. Scores there jumped 18 percentage points, the single biggest swing in Veracode's dataset. The company's explanation is blunt: XSS is "the easiest vulnerability to fix through pattern recognition," and pattern recognition is exactly what large language models are good at.
The harder problems haven't moved much. Flaws like log injection require a model to track how data flows across multiple functions in a program, not just spot a risky-looking line of code. Models are still stalling there, which suggests the gain is more about models learning to avoid one common, well-documented mistake than any deeper improvement in how they reason about security.
Paying more doesn't fix it
Veracode also found that the models producing the safest code are the ones that cost the most to run at scale, and that still isn't a reliable fix on its own. "The models that produce the most secure code are the ones that cost the most to run at scale, yet they still fail on more than one in four security tasks," Wysopal said. "The answer should never be to use the most expensive model and hope for the best."
His recommendation runs against the instinct to just buy the best frontier model available: a mid-tier model paired with independent security scanning, he argues, beats a top-tier model with no verification at all, on cost, accuracy and scale.
With roughly half of all code now estimated to be AI-generated, Veracode's conclusion is less a victory lap than a warning. The improvement, the company says, "mends a small part of a larger wound." Expect Veracode to keep publishing this report at regular intervals, and expect the next one to show whether model makers can crack the harder bugs or just keep polishing the easy ones.
ADFiled by The AI Desk
Models, assistants and the companies and chips behind them, reported from what was released and what was claimed, with the difference kept clear.
More from this desk →
Be the first to comment
Join the argument. No password, just your email or a passkey.