> ## Content Index
> Fetch the complete content index at: https://www.cybrsecmedia.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# Is AI writing secure code? What the 2026 data actually shows
- URL: https://www.cybrsecmedia.com/is-ai-writing-secure-code-what-the-2026-data-actually-shows/
- Published: 2026-11-25T13:01:51.000Z
- Updated: 2026-11-25T13:04:14.000Z
- Description: Is AI-generated code secure? Research from Sonar, GitHub and Veracode reveals software vulnerabilities, verification gaps and AI coding risks.
- Author: George V. Hulme
- Tags: AI Coding, Agentic AI, Article

Enterprise development crossed the line from AI-assisted to AI-authored while secure coding discipline is stuck in the pre-AI era.

That's according to Sonar’s [2027 State of Code Developer Survey](https://www.sonarsource.com/company/press-releases/sonar-releases-2027-developer-survey-report/?ref=cybrsecmedia.com) of 1,026 developers and engineering managers. Respondents to the maker of agentic code verification and governance tools reported that AI now generates or significantly assists an average of 65% of the code they commit. That is a level those same respondents had not expected to reach until next year. The same survey also found that three in four teams use AI coding tools on business-critical or mission-critical services.

GitHub's [2026 Octoverse report](https://github.blog/news-insights/octoverse/octoverse-commits-pushes-reach-new-highs-in-2026-as-developers-build-with-agents/?ref=cybrsecmedia.com) found the same shift: by September of 2026, more than 40% of pull requests on the platform started with an agent's first draft, up from 17% in March. There were 110 million such pull requests initiated in September.

[Subscribe to the CYBR.SEC.Media newsletter](#/portal/signup/free)

Secure code development practices appear to be unable to keep pace with the rate of new code generation. Veracode's [2026 GenAI Code Security Report](https://www.cybrsecmedia.com/ai-generated-code-still-fails-38-of-security-tests-despite-gains-veracode-finds/), which tests leading models against secure-coding tasks, found they introduce a detectable OWASP Top 10 vulnerability in roughly 44% of generation tasks, with an average security pass rate of 56%. That finding is essentially flat year over year. Veracode’s [October 2026 update](https://www.veracode.com/press-release/veracode-finds-first-meaningful-gain-in-ai-code-security-since-2025-as-average-pass-rate-hits-62?ref=cybrsecmedia.com) showed a 62% average pass rate and a vulnerability rate around 38%, led by the newest frontier models at 73%. Much of the gain came from improved pattern-based flaw identification, such as cross-site scripting. However, more challenging contextual flaw classes, such as log injection, barely budged.

Andrew Storms, director of engineering AI security and guardrails at Anaconda, contends that while AI-generated code creates a lot of vulnerabilities, it is essentially because the models have been trained on a highly insecure codebase. “Coding tools are trained on our code, and our code has always had flaws,” Storms says. “XSS and SQL injection didn't start with AI. What's new is volume. A steady flaw rate on far more code, with review capacity that hasn't grown, is a governance problem more than a model problem,” he says.

However, AI code quality and security are improving slowly and unevenly, and few practitioners trust AI-developed code. That could be because only 39% completely agreed that their AI code is always checked before being committed, according to Sonar’s survey. A year earlier, the same survey series put those figures at 96% distrust and 48% always verifying. Seventy-six percent of teams now say they generate AI code faster than they can verify it. That’s a considerable slip in testing, largely due to increased AI code generation.

Also, when it comes to black box testing, AI’s record is mixed. Autonomous agents have found real vulnerabilities in live production systems; one agent even topped HackerOne's leaderboard and has CVE credits to its name, but independent testing by NetSPI and Synack found that no agent configuration consistently matched human penetration testers working alone, and agents still miss the business-logic flaws and multi-step attack chains that humans catch.

In every study we reviewed, the strongest results came from AI and humans working together.

Anaconda’s Storms shared how his team handles the AI flaws:

The first is record provenance. They note the tool and model used to produce each change. If a particular model or workflow turns out to leak a certain class of bug, they can identify everything that model touched.

“Don't let the author grade its own work,” he adds. Code reviews are done by a human or by a different model, so the code reviewer doesn't share the author's blind spots. “A model reviewing its own output tends to repeat its own mistakes, and diversity is the cheapest way to break that,” he says.

Some of Anaconda’s teams are going further with a council of agents. “They spawn three to five reviewers, each focused on one area such as security, correctness, performance, dependencies, or documentation. The results get combined, and the council votes on whether the change passes,” he says.

The voting policy is where the AI-generated governance occurs, as any member of the council can veto and a majority rules. The council also has weighted rules, such as allowing the documentation reviewer to fail while the security reviewer must always pass. “That makes review policy explicit and auditable instead of a judgment call made under deadline pressure,” Storms says.

Storms shares how they keep their AI council honest. First, the council only works with real model diversity. Five agents running the same model with different prompts are less independent than they look, he says, which is the same logic as using a different model than the author. “Mixing models, and keeping deterministic scanners (SAST, dependency checks) as members that can't be argued out of a finding, gives you more than five opinions from one source,” he says.

“Second, a council pass is evidence, not accountability. Someone still owns the decision on high-risk paths such as auth, payments, and data handling, so the humans stay in the loop where the stakes are highest,” he concludes.

Hopefully, more organizations instill such discipline into their development lifecycles. In the meantime, the models will keep improving, and Veracode's October numbers show the models are improving at identifying more flaws. But the gap between what AI writes and what organizations verify is, for now, growing faster than the models' security gains. Closing it is a budget, ownership, and discipline challenge.

[![](https://storage.ghost.io/c/ab/67/ab676516-71e3-473d-8f73-9e0692f5aaee/content/images/2026/11/2027-Events-Banner-56.png)](https://www.cybrsecmedia.com/conference/)