Summer

GenAI Code Security Report

ASSESSING THE SECURITY OF USING LLMS FOR CODING

Read the Report Now

Introduction

Since our inaugural GenAI Code Security Report, every new model generation has brought new capabilities, new benchmarks, and new bold claims. The security pass rate for AI-generated code has not kept pace. Across every model we tested for the 2026 GenAI Code Security Report, roughly 44% of all AI code generation tasks produced code with a known vulnerability – nearly identical to where the series began. The ceiling won't break.

What's changed is what's underneath it. AI coding assistants have crossed from experiment to infrastructure. As of 2026, AI authors roughly half of all committed code across teams that have adopted these tools. The same failure rate that looked concerning when we published our first report now applies to half a codebase, at a pace no security team can match. The failure rate hasn't moved. The volume underneath it has exploded.

The 2026 GenAI Code Security Report data also reveals something more actionable than a flat average suggests. Inside the 56% pass rate mean, the field is split. A handful of models are pushing toward 70% while the majority clusters near 50%. OpenAI’s GPT-5.5 leads this snapshot at 68%, while more than half the models sit at 50–53%. And the model you pick matters in ways that aren't obvious: coding-specialized models averaged a 51% security pass rate, marginally behind general-purpose models at 52%. Being built to write code faster doesn't mean writing it safer. Model selection has quietly become a security decision; this report gives you the data to make it an informed decision.

The highlights of our findings are as follows:

56% average security pass rate

56%

The security ceiling holds but the field is splitting: The average security pass rate sits at 56%, barely changed across every snapshot in this series. Underneath that average, GPT-5.5 reaches 68% while six of 11 Summer 2026 models cluster at 50–53%.

Click Here to Read the Methodology

2

Results and Analysis

Overall, models have made enormous strides in their ability to generate syntactically correct code. Security is a different story. Across all languages, CWEs, tasks, and models, the average security pass rate sits at approximately 56% in Summer 2026, a number that has barely moved since we began tracking (55% in the first report). In roughly 44% of cases, these models introduce a detectable OWASP Top 10 vulnerability into the code.

Syntax is effectively a solved problem; security is not. Modern models generate compilable code nearly 100% of the time. The security pass rate has crept up slightly since 2023, but remains flat across recent model generations with no sign of a breakthrough.

Means:

99.9%

56.3%

The graph below shows the overall syntactic and security pass rates for all models tested. Each point represents one model's pass rate across all 80 tasks. The X axis plots models by release date; the Y axis is the pass rate. Syntax and security are tracked separately.

Syntax pass rate

Security pass rate

Security and Syntax Pass Rates vs LLM Release Date

Pass rate

Syntax pass rate trend by LLM release date

Release date

Note: Security rate only shown for dates/groups with syntax pass rate > 50%

The following sections explore our findings in more detail and answer the research questions set out in the previous section.

3

Performance across languages

RQ 2: Security performance remains consistent across most languages. Java is still the outlier, but it shows the clearest trend in the right direction.

Security Pass Rate vs LLM Release Date, Stratified by Language

Show All languages

Python

Csharp

Javascript

Java

Release date

Pass rate

Means:

62.53%

58.24%

56.75%

30.00%

Note: Security rate only shown for dates/groups with syntax pass rate > 50%

Each dot represents the security performance of one model for one language-specific set of tasks (e.g., all of the CWEs and task instances for Java), 20 tasks per point. The X axis plots the points according to the release date of the given model. The Y axis is the security pass rate. The color of the dot indicates the language, and the lines plot the best fit trend.

The graph highlights three interesting points:

Python performance shows the most consistency throughout the years with the pass rate staying remarkably flat.

Java remains a significant exception, with a mean pass rate of only 30% – nearly half the performance of the other languages.

Java is the only language with a clear trajectory of moving in the right direction, yet it has the furthest to go. C# took a dip a few years ago but is improving gradually.

4

Performance across CWEs

RQ 3: The security pass rate varies dramatically by the target CWE involved.

Security Pass Rate vs LLM Release Date, Stratified by CWE ID

Show All CWEs

CWE-327

CWE-89

CWE-80

CWE-117

Release date

Pass rate

Means:

86.71%

82.51%

15.36%

12.43%

Note: Security rate only shown for dates/groups with syntax pass rate > 50%

Each point on the graph represents the security performance of one model for one CWE-specific set of tasks (e.g., the SQL query generation tasks for all languages). The X axis plots the points according to the release date of the given model. The Y axis is the security pass rate. The color of the dot indicates the CWE.

Two important trends emerge from this data:

For SQL injection (CWE-89) and cryptographic algorithms (CWE-327), models perform well with means of 83% and 87% respectively. Both trendlines saw some increases until around late 2024 and have stayed essentially flat since then.

For cross-site scripting (CWE-80) and log injection (CWE-117), models perform catastrophically poorly with means of 15% and 12%. Log injection is flat to declining with no sign of recovery. XXS shows a modest uptick in the most recent models, but from a floor so low it barely registers.

5

Performance across model sizes

RQ 4: Security performance does not improve significantly as models get larger.

Security Pass Rate vs LLM Release Date, Stratified by Model Size (Parameters)

Show All Models

Large (>100B)

Medium (20-100B)

Small (<20B)

Syntax Pass Rate

Release date

Pass rate

Means:

53.30%

51.33%

51.10%

Note: Security rate only shown for dates/groups with syntax pass rate > 50%

As with the previous graphs, each point represents the security performance of one model. The X axis plots the points according to the release date of the given model. The Y axis is the security pass rate. The color of the dot indicates the size class of the model. We divide sizes into three categories:

Small: less than 20 billion parameters

Medium: between 20 and 100 billion parameters

Large: more than 100 billion parameters

The results show that model size has essentially no effect on security performance. Large models average 53%, medium 51%, and small 51%. More striking: small models started with the lowest scores but have shown the sharpest improvement, nearly surpassing large models by 2026. Scaling up doesn't solve the security problem.

6

Performance across reasoning vs. non-reasoning models

RQ5: Reasoning models maintain a consistent security edge over non-reasoning models.

Security Pass Rate vs LLM Release Date, Stratified by Reasoning vs. Non-Reasoning

Show All Models

Security: True

Security: False

Syntax Pass Rate

Release date

Pass rate

Means:

56.29%

50.61%

Note: Security rate only shown for dates/groups with syntax pass rate > 50%

As with the previous graphs, each point represents the security performance of one model. The X axis plots the points according to model release date. The Y axis is the security pass rate. Dot color indicates whether the model uses reasoning (blue) or not (orange).

Reasoning models maintain a consistent security edge across the full dataset, with a mean of 56% versus 51% for non-reasoning models. The hypothesis is that reasoning steps function like an internal code review and increase the chance of catching insecure constructs before output. At a mean of 56%, even the stronger category still fails on nearly 44% of all tasks. Keep in mind these tests were run against raw models, not agents.

7

Performance by coding-specific models

RQ6: Models built for coding are not more secure than general-purpose models.

Security Pass Rate vs LLM Release Date, Stratified by Reasoning vs. Non-Reasoning

Show All Models

Security: General

Security: Coding

Syntax Pass Rate

Release date

Pass rate

Means:

52.38%

51.34%

Note: Security rate only shown for dates/groups with syntax pass rate > 50%

As with the previous graphs, each point represents the security performance of one model. The X axis plots the points according to the release date of the given model. The Y axis is the security pass rate. Dot color indicates whether the model was purpose-built for coding tasks (orange) or is a general-purpose model (blue).

General-purpose models average 52% on security tasks. Coding-specialized models average 51%. The gap between them is 1 point and has narrowed further in recent model generations, with coding models trending upward sharply since mid-2024. Being optimized to write code faster does not translate to writing it more securely. Security is not a byproduct of coding fluency; it requires a deliberate, specialized training emphasis that neither category has fully delivered.

8

The Leaderboard of Mostly Still Failing

GPT-5.5 leads the Summer 2026 dataset at 68%. It also means the best model available still fails on nearly one in three security tasks. That's the leaderboard in a sentence: a small group pulling ahead, stagnation everywhere else. Four models clear 60%. Six sit between 50 and 53%. The 18-point spread between first and last place isn't noise; it's a meaningful and persistent stratification that has shown up in every snapshot we've run.

Whether the top of that spread represents genuine progress is a different question. Last year's leader, GPT-5 Mini, posted a 72% pass rate – four points higher than this year's leader.

Model

Security Pass Rate

Syntax Pass Rate

OpenAI: GPT-5.5

68%

100%

OpenAI: GPT-5.3-Codex

62%

100%

Anthropic: Claude-Opus-4.8

62%

99%

Google: Gemini-3.5-Flash

61%

100%

Moonshot AI: Kimi-K2.6

57%

100%

Xiaomi: MiMo-V2.5

53%

100%

Google: Gemini-3-Flash

52%

100%

Google: Gemini-3.1-Pro

52%

100%

Anthropic: Claude-Opus-4.7

51%

100%

DeepSeek: DeepSeek-V4-Flash

51%

100%

Alibaba: Qwen3.7-max

50%

100%

Syntax is no longer a differentiator; 10 of 11 models hit 100%, with Claude-Opus-4.8 at 99% the only exception. Security is where models separate. And for the majority of this leaderboard, "separation" means the difference between failing half the time and failing once every three times. No model in this dataset generates secure code reliably, but given the volume of code entering pipelines, that separation makes a big impact.

9

Key Takeaways

The security floor isn't moving, but the field is splitting

The security floor isn't moving, but the field is splitting

Syntax is solved. Security is not.

Java: the most improved language is still the worst one

Why the CWE gap isn't closing

The leaderboard has globalized

Across four snapshots and over 100 models, the average security pass rate has stayed within a few points of 55%. The field average for Summer 2026 is 56%, despite massive advances in model capability, reasoning architecture, size, and specialization. Models that can reason through complex problems, write fluent code in four languages, and pass syntax checks almost 100% of the time still fail on nearly 44% of security tasks when given no security-specific guidance. The ceiling that won't break isn't a failure of effort. It's evidence that security requires deliberate, targeted training, and that general capability gains don't transfer to it automatically.

What the average obscures is more interesting than the average itself. The field is bifurcating. GPT-5.5 reaches 68%. Six of 11 Summer 2026 models sit at 50–53%. This isn't a story about a field stagnating uniformly; it's a story about model selection becoming a security decision. Models that produce vulnerabilities every 1 in 3 outputs rather than every 1 in 2 outputs will lower the work of fixing and retesting, even if that fixing and retesting is AI-based.

Conclusion

The code teams ship is increasingly code that no human wrote in the traditional sense, and that shift is happening faster than most security programs have adapted to. What's changed in this research cycle isn't the failure rate; it's the scale at which that failure rate operates. A 56% average security pass rate across four snapshots and over 100 models is not a number that should move anyone to complacency. At half a codebase, it's a number that should move organizations to treat AI model selection, deployment guardrails, and code verification as core components of software trust, not afterthoughts.

That model selection decision has measurable downstream consequences. The difference between a model that fails one in three security tasks and one that fails one in two isn't just a percentage point on a leaderboard; it's the volume of vulnerabilities entering your codebase that need to be found, fixed, and retested. Even as AI-assisted remediation matures, less vulnerable output means less remediation work. The models at the top of this leaderboard don't solve the problem, but they meaningfully reduce the load.

The pace of AI-generated code entering production isn't slowing down. The gap between how fast vulnerabilities are introduced and how fast they're closed is widening. Finding them accurately is the prerequisite. Governing how they enter, closing them at speed, and proving your software posture to the stakeholders who are now asking... that's the harder problem, and the one the industry needs to be building toward.

Looking to protect yourself from the risks of AI-generated code?

Schedule a demo

Veracode is a global leader in Application Risk Management for the AI era.
Learn more at veracode.com

© Veracode 2027. All rights reserved.

This report is for informational purposes only and does not constitute legal, technical, or other professional advice.

The information contained herein is based on data available to Veracode as of the date of publication and is subject to change without notice.