By NHI Mgmt Group Editorial TeamDomain: Cyber SecuritySource: SonarPublished January 8, 2026

TL;DR: AI now accounts for 42% of committed code and is expected to reach 65% by 2027, according to Sonar's 2026 State of Code Developer Survey of more than 1,100 developers, yet 96% of developers do not fully trust it and only 48% always verify it before committing. The result is a verification bottleneck that shifts risk from creation speed to review quality, where automated checks and disciplined code security become the difference between productivity and hidden defects, according to Sonar.


At a glance

What this is: Sonar's developer survey shows AI-generated code is already a major share of commits, but verification and trust have become the limiting control point.

Why it matters: This matters because IAM, NHI, and broader security teams increasingly depend on engineering workflows where identity, secrets, and code trust are now intertwined with AI-assisted development.

By the numbers:

👉 Read Sonar's full State of Code Developer Survey on AI coding and verification


Context

AI-generated code is no longer an edge case in software delivery. When almost half of committed code can come from AI assistance, the governance problem shifts from whether teams will adopt these tools to whether they can reliably verify what is being introduced into production codebases. That creates a code security and software supply chain issue, but it also touches identity controls where secrets, service accounts, and access paths are embedded into development workflows.

The central failure is not just speed. It is the assumption that human review alone can absorb the volume, complexity, and trust deficit created by AI-assisted coding. For security and platform teams, that means code scanning, secret detection, and release gating must operate as control layers, not after-the-fact hygiene. In identity-heavy environments, the same logic applies to machine credentials and privileged automation that are increasingly created or modified through code.

Sonar's findings describe a pattern that is becoming typical rather than exceptional: widespread AI use paired with weak verification confidence. That combination is now a design constraint for modern engineering governance.


Key questions

Q: How should security teams govern AI-generated code in production pipelines?

A: Security teams should treat AI-generated code as a controlled identity event, not just a development artifact. Require human approval, traceable authorship, scoped workload identities, and evidence of intent before production promotion. The goal is to preserve provenance and limit blast radius when generated logic behaves unexpectedly.

Q: Why does AI-assisted development increase security risk even when developers use familiar controls?

A: Because familiar controls often assume code behaves predictably, while LLM-influenced systems can vary by prompt, context, and input shape. That creates gaps around validation, output handling, and hidden data flows. Teams may pass SAST and still ship an application that accepts unsafe model output or exposes secrets through an API path.

Q: How do teams know if AI-assisted IaC review is actually working?

A: Look for shorter pull-request cycles, fewer rollback events, less on-call noise, and a measurable drop in unmanaged drift. If the assistant is only producing more commentary without reducing exceptions or review friction, it is adding noise rather than control value.

Q: What should organisations do when AI-generated code touches credentials or service accounts?

A: Apply stricter review and approval rules whenever generated code creates, stores, rotates, or calls machine credentials. Those paths can expand NHI exposure quickly, so the code should be treated like privileged automation. Require explicit ownership, logging, and pre-merge checks for credential handling.


Technical breakdown

AI code generation creates a review bottleneck

AI-assisted development changes the economics of review. Instead of spending effort only on writing code, teams now spend substantial time checking code that may be syntactically correct but contextually wrong, insecure, or inconsistent with architectural intent. A verification bottleneck appears when generation speed exceeds the team’s ability to evaluate correctness, security, and maintainability. That is especially acute in large codebases where AI can rapidly produce boilerplate, refactors, and tests that look plausible but introduce hidden coupling or insecure defaults.

Practical implication: treat AI code review as a capacity planning problem and pair adoption with automated quality gates.

Why AI-generated code changes the security model

AI-generated code does not only affect developer productivity. It alters the control surface because code now becomes a higher-volume source of security defects, secrets exposure, and unreviewed logic paths. In identity-rich systems, generated code may create or misuse credentials, permissions, API calls, or service integrations in ways that are hard to spot in manual review. The risk is not that every AI-generated file is unsafe, but that the rate of change increases the chance that weaknesses slip through before security tools or reviewers catch them.

Practical implication: expand pipeline checks for secrets, access patterns, and policy violations before merge, not after deployment.

Verification is becoming a software supply chain control

The supply chain issue is not limited to third-party libraries. AI assistance can introduce unvetted logic directly into first-party code, which means the supply chain now includes the model, prompt, repository context, and review process. Controls such as static analysis, secret detection, dependency checks, and policy enforcement become part of a single assurance chain. Where those checks are fragmented, teams inherit blind spots that AI can amplify because it generates code faster than humans can inspect it thoroughly.

Practical implication: unify code, dependency, and secret checks into one release decision rather than separate advisory tools.


Threat narrative

Attacker objective: The objective is to turn trusted development automation into a path for defects, credential exposure, and operational failure at production scale.

  1. Entry occurs when AI-generated or AI-assisted code is introduced into the development workflow and moved toward commit without sufficient scrutiny.
  2. Escalation follows when insecure logic, hardcoded secrets, or weak access patterns pass review because the team cannot inspect every generated change deeply enough.
  3. Impact emerges when those flaws reach production, creating outages, secret exposure, or paths for abuse in systems that depend on the generated code.

NHI Mgmt Group analysis

AI-generated code has become a governance problem, not just a productivity story. When 42% of committed code is already AI-generated or assisted, teams are no longer evaluating isolated experiments. They are governing a new default workflow where trust, review, and release control must scale with machine output. That makes code assurance a standing operating model issue, not a developer preference.

Verification bottlenecks expose a broader identity and secrets risk. AI-written code often interacts with service accounts, tokens, and deployment credentials, which means weak review can become an identity control failure as much as a software defect. This is where application security intersects with NHI governance: machine credentials and automation paths may be introduced faster than lifecycle controls can validate them. Practitioners should treat generated code as part of identity attack surface management.

Verification debt is the right named concept for this shift. It describes the gap between how quickly code is produced and how thoroughly it can be trusted before release. The more teams rely on AI to accelerate delivery, the more they accumulate unresolved review burden that shows up later as defects, outages, and rework. The practical conclusion is that AI adoption must be paired with measurable assurance capacity.

Security tooling needs to move from detection after commit to prevention before merge. Sonar's findings reinforce that human review alone is already insufficient at current adoption levels, and that gap will widen as AI-generated code increases. Automated checks for secrets, insecure patterns, and policy violations are becoming baseline governance controls. For practitioners, the question is no longer whether to adopt AI coding tools, but whether release controls are strong enough to absorb them.

Developer trust is now an operational signal. The fact that most developers do not fully trust AI-generated code tells security leaders that adoption has outrun confidence, which usually predicts inconsistent control behaviour. When confidence is low, teams either over-review and slow down or under-review and accept risk. The practical conclusion is to measure review quality and not just AI usage volume.

What this signals

Verification debt will become a measurable programme risk as AI-assisted coding scales. Security leaders should expect more generated code to reach review queues faster than manual controls can process it, which makes automated gating and policy enforcement part of delivery reliability. When generated changes affect credentials or access workflows, the identity implications become immediate, not theoretical.

Machine identity governance now has a development pipeline dependency. As code increasingly creates or modifies service accounts, tokens, and deployment credentials, NHI controls can no longer sit only in IAM or cloud operations. They must be enforced where code is written and merged, with release controls that catch identity misuse before runtime.

Security teams should also watch the balance between adoption and trust. If developers do not trust AI output, they will compensate inconsistently, which usually creates shadow review practices, uneven approvals, and hidden risk acceptance. The better signal is not usage growth alone, but whether review burden, defect escape, and credential handling all remain under control.


For practitioners

  • Measure verification capacity before scaling AI coding Track review time, defect escape rate, and security findings per AI-assisted commit so leadership sees whether verification can absorb generation volume.
  • Gate AI-generated changes with automated security checks Run secret scanning, static analysis, and policy checks before merge so insecure patterns are stopped before they reach shared branches or release pipelines.
  • Map generated code to identity and secrets risk Prioritise repositories that create or modify service account usage, token handling, and deployment automation because those code paths expand machine identity exposure.
  • Create an AI-assisted code review standard Define when human approval is required, which files need deeper review, and what exceptions are acceptable for boilerplate, refactoring, and test generation.
  • Use release controls to prevent verification debt Tie promotion to evidence that the code passed quality, security, and dependency checks, not just that it compiled or was approved by a reviewer.

Key takeaways

  • AI-generated code is now common enough that verification, not generation, has become the limiting security control.
  • The biggest risk is not just defects, but unreviewed code paths that touch secrets, service accounts, and deployment trust.
  • Organisations need automated pre-merge assurance and identity-aware review rules before AI coding volume outpaces control capacity.

Standards & Framework Alignment

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

NIST CSF 2.0, NIST SP 800-53 Rev 5, CIS Controls v8 and NIST-800-207 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST CSF 2.0PR.DS-6AI-generated code can introduce untrusted logic and secrets into software delivery.
NIST SP 800-53 Rev 5SI-2Change monitoring and controlled review fit AI-assisted code promotion risk.
CIS Controls v8CIS-16 , Application Software SecurityThis article is about securing application code as it enters the build and release process.
NIST-800-207Zero Trust principles support continuous verification of code and release trust.

Add automated checks before merge to ensure generated code meets data integrity and security expectations.


Key terms

  • Verification Bottleneck: The point where code generation outpaces the organisation's ability to review and validate what is being produced. In AI-assisted development, this bottleneck shifts security from creation speed to assurance capacity, making automated checks and disciplined review essential.
  • AI-Generated Code Risk: AI-generated code risk is the possibility that model-produced output introduces insecure credential handling, hidden secrets, or repeated patterns that weaken control design. The risk is operational, because the output can be merged quickly and at scale before humans catch the problem.
  • Machine Identity: The digital identity of a machine, device, or workload — such as a server, container, or VM — used to authenticate it within a network. Sometimes used interchangeably with NHI, though NHI is the broader category.
  • Security Debt: Accumulated risk that builds when vulnerabilities, unsafe dependencies, and policy gaps are left unresolved across the software lifecycle. In AI-assisted development, security debt grows quickly because more code is produced, more decisions are made automatically, and remediation often lags behind delivery.

What's in the full report

Sonar's full report covers the operational detail this post intentionally leaves for the source:

  • Survey breakdowns showing how developers use AI across prototypes, internal software, customer-facing applications, and mission-critical services
  • Chapter-level detail on the emerging verification bottleneck and how it changes day-to-day development workflows
  • Findings on the split between junior and senior developer attitudes toward AI-generated code and trust
  • Usage and effectiveness comparisons that show where AI helps most and where teams still need human judgment

👉 Sonar's full report covers the chapter findings on trust, verification bottlenecks, and developer behaviour

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 a way that helps security teams align engineering controls with access risk. It is suitable for practitioners who need to connect identity governance to application delivery and operational assurance.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 20, 2026.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org