By NHI Mgmt Group Editorial TeamBased on Pixee: “The 2.74× Problem: New Data Shows AI Code Ships With Nearly 3× More Security Flaws” (December 29, 2025)

TL;DR: AI-assisted development is shipping more security defects, with CodeRabbit finding 2.74× more cross-site scripting issues and 10.83 issues per pull request versus 6.45 in human-only code, while five studies collectively point to a widening gap between code generation speed and remediation capacity, according to Pixee. The practical lesson is that organisations need automated review and fix pipelines that can keep pace with AI output, not just more manual gates.


At a glance

What this is: Pixee's analysis says AI-assisted code is shipping more security defects than human-written code, with validation and authorization gaps clustering around the places AI cannot infer from local syntax alone.

Why it matters: For AppSec, IAM, and platform teams, the issue is not just faster delivery but faster production of defects that depend on context, policy, and authorization models to catch.

By the numbers:

  • AI-assisted code averages 10.83 issues per pull request compared to 6.45 for human-only code, according to Pixee.
  • Pixee reports that AI-assisted pull requests contain 2.74× more cross-site scripting vulnerabilities than human-only pull requests.
  • Pixee says its sample covered 470 pull requests across open-source GitHub repositories, including 320 AI-assisted and 150 human-only.
  • Checkmarx surveyed 900 security and development professionals and found that 34% of code in enterprise repositories is now AI-generated, according to Pixee.

Context

AI-generated code is changing the speed and shape of application risk faster than most security programmes can absorb. When code production accelerates, review, remediation, and governance need to shift from manual inspection toward policy-aware automation, or the backlog becomes the control.

The AppSec problem here is not that AI writes obviously broken code. It is that it writes locally plausible code that misses context such as output handling, authorization boundaries, and security policy. That creates a governance gap across application security, IAM-adjacent authorization logic, and secrets handling, which is typical rather than exceptional in fast-moving development pipelines.


Key questions

Q: What breaks when AI-generated code is reviewed without security gates?

A: What breaks is the assumption that a clean-looking diff is a safe diff. AI-generated code can hide unsafe defaults, dependency issues, and weak validation that basic review misses. Without CI-enforced tests and security checks, the merge process becomes a distribution channel for defects rather than a control point.

Q: Why do AI-generated pull requests need different security handling than human-written code?

A: AI-generated changes are often broader, faster and less obviously traceable than human-written edits, so the security model has to account for agent identity, generation rules and automatic reproduction of insecure patterns. Human review alone does not reliably catch those issues early enough. The safer model is to govern the agent, then scan the output, then route findings to the current owner.

Q: How should security teams evaluate whether an AI-assisted code review workflow is actually improving review quality?

A: Measure both speed and detection quality together. A useful workflow should reduce review time without reducing the reviewer’s ability to catch real issues. Track precision, recall, median time per review, and token efficiency over the same sample set. If reviews get faster but miss more defects, the workflow is trading throughput for weaker assurance and should be tuned before wider rollout.

Q: What should AppSec teams do when AI code output exceeds remediation capacity?

A: They should move predictable issues into automated remediation and reserve human reviewers for architecture-sensitive exceptions. If the queue keeps growing, the process is failing to scale with generation speed. The decision is not to stop using AI coding assistants. It is to redesign review so routine flaws are handled mechanically and scarce expertise is applied where judgment matters most.


Technical breakdown

Why AI-generated code misses security context

AI coding assistants pattern-match from examples, but they do not truly understand the application’s security architecture, threat model, or deployment context. That matters because many defects are contextual: XSS depends on output context, IDOR depends on the authorization model, and password handling depends on policy. The result is code that can be syntactically correct and still insecure in production. This is not random failure. It is a predictable limitation of code generation without full system context.

Practical implication: Treat generated code as incomplete until it is checked against the application’s security context, not just its syntax.

Why validation and authorization are the recurring failure zones

The article’s core pattern is that AI-generated defects cluster around validation and authorization, two areas where the code alone is not enough. Validation protects inputs and outputs from being interpreted in unsafe ways. Authorization determines whether a caller may access a given object, function, or data path. AI tools often produce the immediate feature logic, but they do not reliably carry forward the application’s security model, so the same classes of mistakes repeat across pull requests.

Practical implication: Make validation and authorization explicit review gates for AI-assisted changes, especially in code paths that touch user input or access control.

How security automation changes the review bottleneck

When AI can produce code faster than humans can review it, manual AppSec becomes the bottleneck. The practical response is to move as much predictable remediation as possible into automated pipelines. If the vulnerability classes are well understood, the organisation should automate detection, suggested fixes, and safe merge paths so that human reviewers focus on edge cases and architecture-sensitive decisions rather than repetitive defect triage.

Practical implication: Shift AppSec effort toward automated detection and fix generation for repetitive flaw types, and reserve human review for policy and design exceptions.


Threat narrative

Attacker objective: Exploit predictable application flaws introduced through accelerated code generation to reach data, sessions, or privileged actions.

  1. Entry occurs when AI-assisted development introduces vulnerable code into pull requests faster than manual review can absorb.
  2. Credential or authorization abuse follows when insecure direct object references, weak password handling, or flawed validation reach production systems.
  3. Impact emerges as these defects accumulate into exploitable application exposure, security debt, and a wider breach surface across the software estate.

NHI Mgmt Group analysis

AI code governance has become an application security control problem, not a developer productivity debate. The article shows that the security failure is systematic: generated code repeatedly misses context-dependent safeguards rather than merely introducing noisy bugs. That means review models built for human-paced development are now structurally behind the production rate of defects. Practitioners should treat AI-assisted coding as a governance domain with explicit control ownership.

Validation and authorization are the named failure modes in AI-assisted development. The article’s strongest finding is not simply “more bugs,” but that the defects cluster in places where local code completion cannot infer business rules or access boundaries. That makes the security gap highly repeatable and therefore measurable. Teams should map AI-generated code risk to the controls that govern input handling, object access, and security policy enforcement, not to generic code quality concerns.

AppSec velocity debt is the right concept for this market shift. When code production scales faster than remediation capacity, the organisation accumulates a control deficit even if individual reviews are technically competent. The article’s five-study convergence shows this is not a one-off measurement error but a programme-level pattern. The practical conclusion is that security leaders need a remediation model that scales with generation, or the backlog becomes the control failure.

AI-assisted development widens the identity and entitlement surface whenever code touches access decisions. The article’s references to insecure direct object references and password handling are not just application flaws; they are governance signals that identity and authorization logic must be treated as part of AppSec. Where developers use AI to write access control paths, the organisation needs stronger review of who can act on what, not just whether the code compiles. Practitioners should align AppSec, IAM, and platform engineering around those decision points.

From our research library:

What this signals

AppSec velocity debt: when code generation outruns review and remediation, the organisation accumulates security debt even when individual developers are doing the right thing. That shifts the control objective from inspection alone to a pipeline that can detect, fix, and block repeatable flaw patterns before merge.

The governance implication for IAM and application teams is straightforward: whenever AI-generated code touches authorization paths, access checks, or credential handling, the security model has to be explicit and testable. That means stronger policy-as-code, safer defaults, and fewer opportunities for AI to infer access logic from incomplete context. Companies are dedicating an average of 32.4% of their security budgets to secrets management and code security, with US organisations leading at 40.8%, according to the State of Secrets in AppSec.


For practitioners

  • Add explicit review gates for validation and authorization logic Require human review on any AI-assisted change that touches input handling, object access, session handling, or password policy so context-dependent flaws are not waved through with syntactic approval alone.
  • Automate fixes for repeatable AppSec defect patterns Route common flaws such as XSS, IDOR, and insecure password handling into automated detection and safe-fix workflows so the queue does not depend entirely on manual triage.
  • Measure AI-assisted code separately from human-written code Track defect density, review time, and remediation latency by code origin so security leaders can see whether generated code is outpacing the organisation's ability to secure it.
  • Tie AppSec policy to developer AI usage rules Define when AI-generated code is allowed, what must be reviewed, and which classes of changes cannot be auto-merged without policy-aware checks.

Key takeaways

  • AI-generated code is not just faster code. It is code that more often misses the contextual security decisions that keep applications safe in production.
  • The recurring weak spots are validation, authorization, and password handling, which means the problem is structural rather than incidental.
  • Automated remediation and policy-aware review are now necessary to keep AppSec aligned with code generation velocity.

Standards & Framework Alignment

This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.

MITRE ATT&CK addresses the attack and risk surface, while OWASP ASVS, NIST CSF 2.0 and CIS Controls v8 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP ASVSV1 — Encoding and SanitizationThe article's XSS findings point directly to output encoding and sanitization gaps.
V8 — AuthorizationIDOR findings show access-control decisions are failing in generated application logic.
V6 — AuthenticationImproper password handling and session concerns sit in authentication design.
Recommendation — Enforce V1 review on AI-assisted changes that process or render untrusted input. Apply V8 checks to every AI-generated access path that reads or updates protected objects. Use V6 requirements to review AI-written authentication and credential-handling code.
NIST CSF 2.0PR.AA-05 — Access Permissions, Entitlements and AuthorizationsThe article highlights authorization logic as a recurring security weakness.
Recommendation — Map AI-assisted access-control logic to PR.AA-05 and verify entitlements before merge.
CIS Controls v8CIS-16 — Application Software SecurityThe issue is fundamentally about securing application code as it is produced and changed.
Recommendation — Use CIS-16 to formalize review, testing, and approval controls for AI-assisted code changes.
MITRE ATT&CKTA0009 — CollectionThe article's flaws can expose application data once attackers reach vulnerable code paths.
Recommendation — Map exploitable coding defects to TA0009 when they enable unauthorized data collection.

Key terms

  • AppSec Velocity Debt: The growing gap between how quickly code is produced and how slowly security can review and remediate it. It appears when teams add features faster than they can validate, test, and fix the security consequences, causing risk to compound across releases.
  • Context-Dependent Vulnerability: A flaw that cannot be judged safely from the code fragment alone because the real risk depends on surrounding application policy, data flow, or deployment context. Common examples include output encoding, authorization checks, and credential handling that only work when the wider security model is understood.
  • AI-Assisted Code Review: The use of AI tools to help evaluate code quality, risk, or remediation options. It is useful for prioritisation and explanation, but it should not be confused with independent validation, because code generation systems are not inherently designed to enforce policy or guarantee security.
  • Automated Remediation: A policy-driven process that executes predefined fixes for known security issues without waiting for manual ticket closure. In SaaS security, it is the practical bridge between finding a risky share or integration and actually reducing exposure at scale.

Deepen your knowledge

NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, and secrets management in the context of modern security operations. It is designed for practitioners who need to connect identity control to broader programme decisions.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 21, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org