Summary is AI-generated, newsdesk-reviewed
  • Veracode reports AI-generated code security rose to 62%, but vulnerabilities remain in 38% of tasks.
  • Claude Opus 5.5 and GPT-6-Sol lead with 73% security, while Java scores only 31%.
  • Use security scanning and remediation; top AI models still fail over one in four tasks.

AI-generated code is becoming more secure, but vulnerabilities remain common, according to Veracode’s latest GenAI Code Security Report. The share of secure code rose from 56% to 62%, while the proportion containing vulnerabilities fell from 44% to 38% — the largest improvement since the report series began in July 2025. Anthropic’s Claude Opus 5.5 and OpenAI’s GPT-6-Sol jointly achieved the highest score, at 73%, ahead of the previous high of 68% recorded by GPT-5.5 in July 2026.

“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, Co-founder & Chief Security Evangelist at Veracode. “This is the first time since running our study that we’ve been able to report a meaningful move on the security dial. Ten models now clear 60 percent, up from four in the last report, and the overall average has jumped six percentage points. With around half of code now generated by AI, today’s results are truly encouraging.”

AI code security varies by model and vulnerability type

Veracode assessed 18 models across Python, C#, JavaScript and Java, testing for four Common Weakness Enumeration (CWE) categories: SQL injection (CWE-89), cryptographic weaknesses (CWE-327), cross-site scripting (CWE-80) and log injection (CWE-117).

Claude Opus 5.5 and GPT-6-Sol tied at 73%, while models from Anthropic and OpenAI both featured among the top seven. In the July 2026 results, six of 11 models scored between 50% and 53%; in the latest analysis, only two remained in that range, while 10 surpassed 60%. However, the lowest scores remained between 44% and 50%, indicating that vulnerability rates still depend on the model selected.

Cross-site scripting was the main contributor to the overall improvement. Its score rose to 18%, making it the largest change in the dataset. By comparison, cryptographic weaknesses scored 87%, SQL injection 84% and log injection 13%, with the latter two categories showing no movement since the previous analysis.

Model size and code verification matter

Veracode attributes the different results partly to the nature of each vulnerability

Veracode attributes the different results partly to the nature of each vulnerability. XSS can be addressed through pattern recognition, while detecting log injection often requires data-flow reasoning across multiple functions — an area where the models continue to struggle.

The highest-scoring models also come with greater computing costs. Large models averaged 55% on security tasks, compared with 51% for small models, reversing the previous year’s finding that size had “essentially no effect” on security.

“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. A mid-tier model at a 60 percent pass rate plus Veracode scanning is more accurate, more cost-effective, and more scalable than a frontier model at 73 percent with no verification. Organizations must look for a combination of coding model, security testing, and remediation to get the highest security outcome.”

Java remains a security outlier

General-purpose models averaged 54% on security tasks, compared with 51% for coding-specialised models. The difference has widened from one percentage point in July to three in the latest report. Overall, around four in 10 AI code tasks still resulted in vulnerable code, despite the fall in the vulnerability rate from 44% to 38%.

Java remained the weakest-performing language, scoring 31%, up only slightly from 30% in July. Python reached 64%, C# 60% and JavaScript 57%, leaving a gap of 26 to 33 percentage points between Java and the other languages.

Security debt remains a wider concern

Veracode said the improvement addresses only part of the wider software security challenge. Its 2026 State of Software Security report found that 82% of organisations have security debt — vulnerabilities left unresolved for more than a year. Third-party code accounts for 66% of the most dangerous long-lived vulnerabilities, which take an average of 358 days to fix.

“Newer LLMs are producing more code that’s both functional and secure, but that does not mean we can start blindly trusting AI-generated code,” Wysopal closed. “The most effective strategy isn't chasing the most expensive model for marginal gains; it's combining AI code generation with continuous, independent security verification that catches what the models miss. That approach covers the full risk surface, from first-party code to third-party dependencies."

In case you missed it

Why Access Control Is Becoming A Governance And Cybersecurity Priority
Why Access Control Is Becoming A Governance And Cybersecurity Priority

Managing access control for a single facility is very different from overseeing dozens of locations across multiple regions. At large, complex organizations, security teams must ma...

Security Sector News For Industry Professionals
Security Sector News For Industry Professionals

Digitalising access presents a specific challenge in heritage buildings: how to protect these premises against 21st-century threats while preserving the unique building fabric? Cho...

Zhonggua River Ecological Monitoring With VIVOTEK
Zhonggua River Ecological Monitoring With VIVOTEK

Located in Nantou County, Taiwan, Zhonggua River was once heavily impacted by river engineering projects that disrupted the natural relationship between the stream and its surround...