If the model is the smallest security lever, what actually makes AI-generated code safer?

2026 has really been the year the AI agent was truly unleashed, with corporations, especially in the tech industry, starting to go all-in, trying their hand at implementing agentic, automated workflows within their software development life cycle (SDLC). Gartner’s 2026 Hype Cycle for Agentic AI revealed that while just 17% of organizations had deployed AI agents, 60% planned to do so in the next 24 months.
While AI tools have been disruptive across many sectors, their impact on software development has been widespread, rapid, and quite jarring from the perspective of a security expert. The highly publicized Medicare breach involving rogue OpenAI agents brought some of the major security issues into the mainstream, with several highly regarded experts calling for urgent safety guardrails around AI usage.
There’s a small (read: large) problem with that: most organizations are unclear on their stage of AI adoption, what suite of AI tools are in use (and who is using them), and, critically, the security issues they may be dealing with that are specific to the model. Those who are flying blind on these elements will seriously struggle to implement and maintain an AI-ready security program.
Earlier this year, we released the SCW AI Trust Index, and, in conjunction with RMIT University, assessed 16 leading AI models from OpenAI, Anthropic, Google, and others, generating 1760 codebases and finding 15 vulnerabilities on average in each one. This data, using our original methodology, allowed us to ultimately identify that security risk is predictable by model and framework.
Today, we are releasing version two of the SCW AI Trust Index, with an updated, more comprehensive methodology that incorporates other helpful data points in assigning both ranking and risk score to each model. For the first time, we also assess the functional completeness of the AI-generated code we tested, to give an indication of its overall viability, in conjunction with its security indicators.
What’s new in the SCW AI Trust Index?
For version two, we put 30 models from eight vendors through the same neutral agent harness, across 11 language and framework stacks. The vendors run from OpenAI, Anthropic and Google through to Mistral, Alibaba, Moonshot, Zhipu AI and xAI. Each model built 10 apps per stack, and in total the v2 harness generated and scanned 15,000 apps and 41.3 million lines of code.
The field moves quickly: 22 of the 28 models we could plot by release date shipped in 2026, nine of them in September alone. That’s why the Index is a living benchmark, not a one-off ranking.
The clearest finding is what happens when a model is given curated security rules. Across 284 comparable model-and-stack combinations from 26 models, the two curated rulesets we tested cut summed measured risk by 33% and 46%. A generic “follow security best practices” instruction cut it by just 18%, and it actively raised risk in 83 of those 284 combinations. The same pattern appears when we account for how much code each model writes. We found there was obvious progress and the models improved a lot in the last 12 months.
Rules aren’t the cure-all we all hoped for, though. They did the most for models that were already lower-risk, cutting risk by 54–56% on the 13 lower-risk baselines, compared with 25–43% on the 14 higher-risk ones. Some models still produced high-risk findings with rules applied.
Model choice still matters, but price alone is a poor guide to the model that will ultimately be the safer choice in your organization. Additionally, no single model is safest everywhere. For example, GPT 6 Astra has the lowest average risk per app overall, yet Sonnet 5.5 carried less risk on Java EE JSP. Spending more doesn’t, in most cases, reliably buy safer code either.
While it is true that newer models are safer on average, it is dangerous to assume every release is automatically an upgrade: this run, by way of example, showed that Gemini 3.8 Flash carries more risk than Gemini 3.5 Flash.
You can see these, plus the new methodology and full findings on our website.
How can I use this data for better security outcomes?
Put simply, you can't keep flying blind about the impact of AI tools on your company’s overall cybersecurity risk profile. This data gives you real points of comparison to determine the security viability of the models in use, or that may be implemented in the future, within your teams.
We also need to make something clear about developer model use: Don’t expect them to change from their favorite one just because you show them data on the security implications of their use. This is very unlikely to drive change, and security leaders need to understand that implicitly and work with it.
This is where the SCW AI Trust Index can help you understand where the shortcomings of the models you use exist, and give you options to add viable security controls, whether harnesses, detailed rulesets, or both, to mitigate the inherent risks they are known to possess.
Ready for next steps?
If you want to see how the SCW AI Trust Index is helping leaders like you shape their security programs around AI tools and processes, get in touch, and we can share a few secrets about what’s to come.
Govern AI-driven development before it ships
Measure AI-assisted risk, enforce secure coding policy at commit, and accelerate secure delivery across your SDLC.
Explore more blogs
Access expert content on secure coding, AI governance, and software risk management.

If the model is the smallest security lever, what actually makes AI-generated code safer?
Earlier this year, we released the SCW AI Trust Index, and, in conjunction with RMIT University, assessed 16 leading AI models from OpenAI, Anthropic, Google, and others, generating 1760 codebases and finding 15 vulnerabilities on average in each one. This data, using our original methodology, allowed us to ultimately identify that security risk is predictable by model and framework.
Secure AI-driven development before it ships
See developer risk, enforce policy, and prevent vulnerabilities across your software development lifecycle.

