AI-generated code: it’s not better models, but better guardrails that give the competitive edge.

AI coding assistants now write syntactically correct code over 95% of the time but only 55% of that code is actually secure. Better models aren't and won't be the fix. This article shows how the real solution is a "delivery harness": human accountability, risk-based governance, and automated quality gates built into every stage of development. It's a practical look at how organisations can scale AI-assisted development without scaling their risk.

Generative AI is transforming software development at remarkable speed. AI coding assistants are accelerating delivery, increasing productivity and reshaping engineering workflows. 

But a question remains: how can organisations scale AI-assisted development without increasing their security risk? 

The next generation of AI models alone isn’t the answer. As they continue to improve, governance, human validation and automated controls are becoming more critical 

 

The evidence: AI writes increasingly correct code, but not consistently secure code. 

Before rolling out AI across development teams, every CIO should understand one statistic: only 55% of code generated by large language models is secure. 

Since 2025, Veracode has measured the security of code generated by large language models using a consistent benchmark of 80 programming tasks. Its March 2026 update, covering more than 150 models, paints a clear picture: only 55% of generated code is secure. In the remaining 45% of cases, the model introduces a vulnerability from the OWASP Top 10. 

While syntactic correctness now exceeds 95%, security performance has remained largely unchanged over the past two years. GPT-5.1 and GPT-5.2, Gemini 3, Claude 4.5 and 4.6—all evaluated in spring 2026—continue to cluster between 55% and 60% secure code. Only OpenAI’s reasoning models perform significantly better, reaching 70–72%, yet even those leave roughly one in three code samples vulnerable. 

The lesson is straightforward: model performance is improving, but organisations cannot assume that future advances will eliminate the need for security controls. 

Why code security is an operational problem, not just a model problem. 

The benchmark results become even more revealing when broken down by vulnerability type. 

Models perform well on SQL injection and cryptography, achieving success rates of 82% and 86% respectively because the secure implementation is generally the obvious one. Performance drops dramatically, however, for cross-site scripting (15%) and log injection (13%). These vulnerabilities require understanding how user-controlled data flows through an application, context the model simply does not have. 

Results also vary significantly by programming language. Python reaches 62%, JavaScript 57%, while Java falls to just 29%, weighed down by decades of legacy code in its training corpus. PHP is not included in the benchmark, but the same underlying dynamics are likely to apply. 

Modern frameworks provide valuable protection. Doctrine’s prepared statements in Symfony, Twig’s automatic output escaping and Angular’s template sanitisation all reduce risk. Those safeguards disappear, however, when a model generates raw SQL, applies a raw filter or uses methods such as bypassSecurityTrust. 

The root cause is structural. These models have been trained on publicly available code, much of which contains vulnerabilities that were never corrected. As a result, insecure implementations become part of what the model learns as acceptable practice. 

Even model providers recognise that raw model capability is not enough. Anthropic makes only the classifier-protected version of its latest model, Fable 5, publicly available, while restricting the unrestricted version, Mythos 5, to a small number of approved organisations. 

Independent evaluations reinforce the point. Endor Labs ranks Fable 5 in the middle of the field for secure code remediation. Sonar identified a high-severity vulnerability in a Java module generated in just thirteen minutes—a flaw ultimately intercepted by a quality gate before deployment. 

If model providers surround their own systems with guardrails, enterprise organisations should do the same. 

An agentic delivery harness is the solution for AI-generated code. 

Rather than asking which model is safest, organisations should ask a different question: 

What operating model allows us to use AI safely at scale? 

The answer is an agentic delivery harness: a combination of governance, human oversight and automated controls that surrounds AI-generated code throughout the software delivery lifecycle. 

The first layer is human accountability. 

The rules are deliberately simple: 

1/  100% of the code may be generated by AI. 

2/  100% of the code must be understood and validated by a human. 

Nothing is merged without understanding. Developers remain accountable for every increment they deliver. A senior technical expert performs a systematic technical review. Contractual acceptance of deliverables is never delegated to an AI agent. Whenever uncertainty arises, it is escalated rather than resolved through an unverified exchange with an LLM. 

This approach does not replace experienced engineers; it amplifies them. Recognising unsafe SQL concatenation or missing output escaping is precisely the expertise today’s benchmarks show remains indispensable. 

Governance enables speed. 

Security, access rights, sensitive business logic, data models and core architectural components belong to red zones, where AI-generated code is either prohibited or subject to enhanced validation before implementation. Lower-risk areas can benefit from the speed of agentic development. 

This deliberate asymmetry is what makes high development velocity sustainable rather than dangerous. 

Quality gates reinforce that governance throughout the delivery lifecycle instead of being added at the end. Specifications and acceptance criteria are reviewed before generation begins. Sensitive information is filtered before prompts are submitted. Test coverage must reach at least 80%. Every generated artifact remains fully traceable, including the model that produced it. 

Turning governance into engineering:

Governance must also be implemented technically. 

A dedicated agentic configuration equips development teams with specialised agents for code generation, unit testing, end-to-end testing and merge review. Before a human makes the final decision, the merge reviewer evaluates every pull request against security, performance, maintainability and engineering best practices. 

Skills and rules inject security, accessibility and performance requirements directly into the generation context, allowing the model to produce prepared statements by design rather than by chance. 

Pre-prompt and post-generation hooks automatically block outputs that fail required controls before they can progress further through the delivery process. 

Together, these capabilities create a deterministic engineering loop: generate code, execute tests, run static analysis and linters, apply corrections and repeat until compliance is achieved. 

The final automated safeguard is the CI/CD pipeline. 

Local hooks can be bypassed. The pipeline can’t. 

By embedding Static Application Security Testing (SAST), dependency analysis, automated testing and minimum coverage thresholds as mandatory conditions for merging and deployment, no code reaches production without passing every required control, regardless of which agent or model generated it. 

This layered approach reflects Veracode’s own recommendation: security controls applied throughout the delivery process remain irreplaceable. Human experts retain ultimate accountability. 

Don’t choose a better model. Build a better harness. 

AI accelerates everything, including failure. If development velocity triples, an unchecked vulnerability can spread three times faster. 

Adopting AI-assisted development safely, consistently and at scale requires: 

-responsible people 

-clearly defined risk zones 

-deterministic quality gates 

-a secure CI/CD pipeline, and  

-complete traceability. 

In other words, it requires a delivery harness. 

That discipline is what transforms AI-driven development from faster software delivery into sustainable business value.