Opinion · Security & Fraud

AI Code Still Fails Security Checks Nearly Half the Time. Keep Humans in Charge

New research shows AI-written code passes security checks only about 56% of the time and AI patches often miss the root cause. Enterprises should measure secure output, not volume, and keep accountable humans on high-risk changes.

By The AI Enterprise Magazine Team4 min readOpinion · Weekly briefing

Illustration of a security shield over lines of AI-generated code under review
Illustration of a security shield over lines of AI-generated code under review

Key takeaways

  • Security is flat. Veracode found AI models passed security checks on about 56% of coding tasks, with little improvement over the past year, per eSecurity Planet.
  • AI fixes are unreliable. 1Password found only 26% of AI-generated patches fixed flaws cleanly across 6,080 attempts.
  • Volume is the new risk. Faster code generation at a flat vulnerability rate means more findings to triage, not fewer.
  • Tier review by risk. Put accountable humans on high-risk code, measure vulnerabilities per change and lock down coding agent permissions.

AI coding tools have become very good at writing code that runs. They have not become much better at writing code that is safe. That gap, documented again this week, should change how enterprises measure the value of AI-assisted development. Our position: the right goal is not more code per developer. It is more secure code shipped per review hour, and that requires keeping skilled humans in charge of what gets merged.

What did the new research show?

Veracode's 2026 GenAI Code Security Report tested more than 100 AI models on standard coding tasks, according to eSecurity Planet's August 12 coverage. Code compiled almost every time, but only about 56% of tasks passed security checks. Roughly 44% produced code with a detectable vulnerability from the OWASP Top 10 list. The best model on Veracode's leaderboard scored 68%. Results for cross-site scripting and log injection were especially weak, at roughly 15% and 12%. The report found security has "barely improved over the past year," even as syntax accuracy approached perfection.

The week before, 1Password tested the reverse problem: whether frontier models can fix known flaws. Its researchers analyzed 6,080 patch attempts on six recently disclosed vulnerabilities in projects including Linux, Chrome and Exim. 1Password reported on August 6 that only 26% of patches fixed the flaw cleanly, while 53.9% left it unresolved, introduced a new vulnerability, or both. Guidance quality mattered a great deal. Accurate instructions produced a 65% fix rate, while incorrect guidance dropped it to about 15%, eSecurity Planet noted.

The tools around the models have problems too. At Black Hat earlier in August, researchers from Novee showed how prompt injection and weak trust assumptions in the harnesses of Claude Code, Gemini CLI and Codex could lead to code execution or credential theft, eSecurity Planet reported. Anthropic, Google and OpenAI each patched or changed their designs.

Isn't human-written code insecure too?

Yes, and that is the strongest argument on the other side. Human developers ship vulnerabilities every day. AI assistants clearly speed up routine work, and Veracode's results show reasoning models scoring better than others and some vulnerability classes, such as SQL injection, handled well. Requiring a senior engineer to read every AI-generated line would erase much of the productivity gain. Some leaders will reasonably argue that automated scanners, not people, should be the gate.

We agree that scanners belong in every pipeline. But the evidence this week points to a specific risk that is new: volume. When an assistant can produce in an hour what a team once wrote in a week, a flat 44% vulnerability rate becomes far more findings to triage. And 1Password's results show that asking the same models to fix their own flaws does not close the loop. Patches that look correct often miss the root cause.

Where should humans sit in AI-assisted development?

The answer is not a human reading every diff. It is a human accountable for each change that matters, with review effort scaled to risk. That idea came up at a AI Connect expert panel on agent governance this week. "The goal isn't to keep a human in the loop. It is to make sure the human is a step away from the loop where it matters," said Shubham Trivedi, Digital Solution Advisor at SAP, as we covered in where humans belong in agentic AI governance.

In practice, that means:

  • Tier code by risk. Authentication, payments, data access and anything touching customer records get mandatory human security review. Internal scripts and test scaffolding can rely more on automated checks.
  • Measure security, not output. Track vulnerabilities per merged change and time to fix, alongside throughput. If AI raises output but also raises findings, the productivity claim is incomplete.
  • Treat AI patches as drafts. 1Password's data suggests AI-assisted remediation needs validation in your own codebase before teams automate it.
  • Lock down the agent harness. Coding agents need least-privilege permissions, isolated workspaces and untrusted handling of inputs such as issues and config files, the same discipline teams apply to agent builders and their tools.

AI Connect practitioners have warned about the shortcut of shipping whatever looks right. In a AI Connect webinar on taking AI from prototype to production, DataHub co-founder John Joyce said an app that is merely AI-enabled "just means it runs on vibes": the output looks reasonable, so it ships. His test for enterprise grade was whether someone is clearly accountable for the feature and its quality. Code is no different.

The bottom line

AI coding assistants are worth using. But the week's research shows their security quality is flat while their speed keeps rising. Enterprises that count lines generated will overstate their gains. Those that fund review capacity, tier risk and measure secure output will get the productivity without inheriting a backlog of vulnerabilities their attackers find first.

Frequently asked questions

How secure is AI-generated code?

Veracode's 2026 GenAI Code Security Report found that across more than 100 models, about 56% of coding tasks passed security checks, while roughly 44% produced code with an OWASP Top 10 vulnerability.

Can AI reliably patch security vulnerabilities?

Not yet on its own. In 1Password's study of 6,080 patch attempts by frontier models, only 26% fixed the vulnerability cleanly, and 53.9% left it unresolved, introduced a new flaw, or both.

Does every AI-generated line need human review?

No. A risk-tiered approach works better: mandatory human security review for code touching authentication, payments and sensitive data, with automated checks for lower-risk changes.

Opinion pieces reflect the views of The AI Enterprise Magazine Team.

Filed under: Security & Fraud, AI Governance & Trust, Agentic AI

More from AI Enterprise Magazine

Read the magazine