By NHI Mgmt Group Editorial TeamBased on Sonar: “State of Code Developer Survey report: The current reality of AI coding” (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 reports that AI-generated code has become a routine part of development, but verification is now lagging behind generation as trust and review effort diverge.

Why it matters: This matters because engineering teams need controls that validate code quality, security, and reliability at commit time, especially as AI output enters production systems and human review becomes the bottleneck.

By the numbers:

  • AI now accounts for 42% of committed code today, according to Sonar’s 2026 State of Code Developer Survey.
  • AI-generated code is expected to reach 65% by 2027, according to Sonar’s 2026 State of Code Developer Survey.
  • 96% of developers do not fully trust AI-generated code, according to Sonar’s 2026 State of Code Developer Survey.
  • Only 48% of developers always verify AI-generated code before committing, according to Sonar’s 2026 State of Code Developer Survey.

Context

AI-generated code is no longer a niche experiment. The governance problem is that creation speed has started to outrun verification capacity, so teams can ship faster while understanding less about what is entering the codebase.

For identity and security practitioners, this is not just a developer productivity story. AI-assisted coding changes the assurance model around source code, secrets exposure, vulnerable dependencies, and review accountability, especially where code feeds CI/CD and production release pipelines.

Sonar’s findings suggest the starting position is already typical rather than exceptional, which means the control gap is becoming mainstream rather than confined to a few early adopters.


Key questions

Q: What breaks when AI-generated code is only checked after commit?

A: Post-commit controls miss the moment when risky code is created, so secrets, insecure patterns, and policy violations can enter the repository before security ever sees them. That makes audit evidence incomplete and weakens defensibility. The practical failure is timing, because detection after commit cannot prove that policy was enforced at generation time.

Q: Why do AI coding tools create a security risk even when code looks correct?

A: They optimise for syntax and pattern completion, not contextual security reasoning. Code can compile, satisfy tests, and still mishandle input, logging, or trust boundaries in ways that create exploitable flaws. That is why functional correctness and security correctness must be measured separately in governed pipelines.

Q: What are the warning signs that AI code review is failing?

A: Look for large pull requests approved with minimal discussion, reviewers unable to explain the change, repeated exceptions to standards, and security checks treated as ceremonial. Those signals show that acceptance is drifting from evidence-based review toward confidence in the model’s output.

Q: Should engineering teams treat AI-generated code differently from human-written code?

A: Yes. AI-generated code should pass the same security and quality standards, but it often needs stricter provenance, deeper review on sensitive paths, and stronger automated controls because volume and ambiguity increase the chance of missed defects. The right response is not special treatment, but stronger governance where risk is highest.


Technical breakdown

Why AI-generated code creates a verification bottleneck

AI coding tools compress the time required to produce syntax, boilerplate, and even functional logic, but they do not remove the need to validate intent, security, and correctness. That shifts the burden from creation to review. In practice, developers must inspect more output with less context, and the review task becomes harder because AI-generated code often appears plausible even when it is subtly wrong. The bottleneck is therefore not computational capacity, but human and automated assurance capacity. As AI adoption rises, teams that still rely on manual review alone will struggle to keep pace with the volume and complexity of changes.

Practical implication: move verification earlier and automate as much code review and policy checking as possible.

Where trust, quality, and security checks intersect

The article shows that trust is not binary. Developers may use AI widely while still doubting its output, which means organisations need separate controls for acceptance, review, and release. Security checks, static analysis, testing, and policy gates are not interchangeable, but they reinforce one another when AI-generated changes are entering the pipeline at scale. This is especially relevant when code touches authentication, authorization, secrets handling, or cloud permissions, because seemingly small defects can create disproportionate exposure. The real architectural issue is whether review controls can detect errors before a commit becomes an operational dependency.

Practical implication: align code quality gates with security gates so AI-generated changes cannot bypass either.

Why AI coding changes the assurance model for production systems

When AI contributes a large share of committed code, the assurance problem becomes a supply-chain issue inside the software factory itself. Developers are no longer reviewing only human-authored logic, so teams need stronger provenance, traceability, and testing discipline around what entered the repository and why it was accepted. That matters for production systems because the damage from a flawed commit is often delayed, distributed, and expensive to unwind. In that sense, AI coding is not just a productivity feature. It is a change in how engineering organisations must govern software trust boundaries from prompt to merge to deployment.

Practical implication: treat AI-generated code as a governed input with traceability, not as ordinary developer output.


Threat narrative

Attacker objective: The practical objective is not necessarily a targeted intrusion, but the normalisation of unsafe code paths that degrade reliability and expand attack surface.

  1. Entry occurs through AI-generated code entering the development workflow as a normal part of daily engineering activity.
  2. Credential or logic flaws can then be introduced into repositories, where they survive review if teams rely on trust rather than verification.
  3. Impact emerges downstream when defective or insecure code reaches production, causing outages, rework, or security exposure.

Read and download The State of NHI & AI Agent Breach Report 2026, covering 200+ breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

Verification has become the new control plane for AI-assisted development. The article shows that generation is now cheap while assurance remains expensive, which flips the traditional productivity narrative. Security and quality teams need to treat review capacity, automated test coverage, and policy enforcement as primary controls rather than downstream hygiene. The practitioner conclusion is simple: if verification does not scale, AI code adoption scales risk faster than value.

AI-generated code creates an assurance gap that looks like a developer issue but behaves like a governance issue. Once a meaningful share of committed code is machine-assisted, the question is no longer whether developers trust the output, but whether the organisation can prove what passed review and why. That shifts responsibility toward engineering governance, release controls, and evidence-bearing pipelines. The practitioner conclusion is to govern AI output as part of software assurance, not as an optional developer preference.

Code security now depends on the quality of the review system, not just the quality of the code generator. The article’s 44% behaviour gap from Sonar’s own reference statistics reinforces that many developers still do not follow safe secrets practices, which makes AI output more dangerous when it is merged without disciplined checks. This is where AI-generated code intersects with identity and secrets governance: leaked credentials, overbroad permissions, and insecure integrations often enter through ordinary development workflows. The practitioner conclusion is to tighten pipeline controls around secrets, permissions, and change approval.

AI-assisted development is normalising shadow risk inside the software factory. When AI becomes routine, organisations can lose visibility into which changes are human-authored, machine-assisted, or fully generated, and that ambiguity weakens accountability. This is not solved by asking developers to be more careful. It requires clear provenance, mandatory scanning, and release gating that make every commit attributable and inspectable. The practitioner conclusion is to assume AI code will keep expanding and build governance accordingly.

Verification bottleneck: the point where faster code generation outpaces the organisation’s ability to inspect, test, and approve it. This bottleneck is already changing how engineering teams must allocate control ownership across development, security, and platform operations. The practitioner conclusion is to measure assurance throughput as seriously as delivery velocity.

From our research library:

What this signals

AI-generated code is now a governance problem, not just a developer convenience. The more code that arrives through machine assistance, the more an engineering organisation must rely on automated verification, secrets scanning, and release controls to preserve trust in the pipeline. That is especially true when the review bottleneck is already visible to developers themselves.

Verification capacity will become a differentiator between teams that gain speed and teams that accumulate hidden risk. Once AI output is normalized, the winning operating model is the one that can prove what passed review, what was tested, and what was blocked. Teams that cannot demonstrate that control trail will struggle to justify broader AI adoption.


For practitioners

  • Implement mandatory AI-code verification gates Require static analysis, secret scanning, dependency checks, and test coverage thresholds before AI-assisted code can merge.
  • Tighten review for privileged code paths Apply deeper human review to code that touches authentication, authorization, secrets management, and cloud permissions.
  • Track AI-generated change provenance Tag AI-assisted commits, retain prompt or tool metadata where feasible, and preserve evidence of who approved the change.
  • Measure verification throughput, not just velocity Monitor review backlog, defect escape rate, and the percentage of AI-generated changes that pass automated controls without manual exception.

Key takeaways

  • AI-assisted development has shifted the critical bottleneck from code creation to code verification, where review quality now determines whether speed is an asset or a liability.
  • The survey data shows a large trust gap between AI usage and developer confidence, which means organisations cannot assume adoption equals assurance.
  • Teams that want AI productivity without hidden defects need stronger automated checks, better provenance, and tighter review of privileged code paths.

Standards & Framework Alignment

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

OWASP API Security Top 10 and OWASP Non-Human Identity Top 10 address the attack and risk surface, while CIS Controls v8 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP API Security Top 10API10 — Unsafe Consumption of APIsAI-generated code often embeds risky API usage and unsafe integration patterns.
Recommendation — Review AI-generated integrations for unsafe API consumption before code reaches production.
CIS Controls v8CIS-16 — Application Software SecurityThe article centers on securing code before it is released, which maps to application software security.
Recommendation — Apply application security controls to AI-assisted code paths and block merges that fail security checks.
NIST CSF 2.0PR.DS-01 — Data-at-rest is protectedAI code can introduce data-handling defects and exposure paths that affect software trust.
Recommendation — Protect data handling in the development pipeline and verify that AI-assisted changes do not weaken safeguards.
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakageThe article’s verification problem directly intersects with secrets exposure in developer workflows.
Recommendation — Scan AI-generated changes for secret leakage and revoke any exposed credentials immediately.

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: Code produced wholly or partly by an AI system and then reviewed, edited, or committed by a developer. The security issue is not the source alone, but the fact that machine-generated code can carry subtle defects, insecure patterns, or hidden dependencies into production workflows.
  • Software Assurance: A Microsoft licensing program that provides customers with rights and benefits tied to active maintenance coverage. In this context, it affects how many core licenses are granted on renewal and can change the effort required to stay compliant across existing servers.
  • Secrets Management: The discipline of securely storing, distributing, rotating, and auditing secrets across an organisation's systems and pipelines, typically implemented via a centralised secrets vault such as HashiCorp Vault, AWS Secrets Manager, or Akeyless.

Deepen your knowledge

The NHI Foundation Level course covers NHI governance, secrets management, and identity lifecycle fundamentals in the context of modern security programmes. It helps practitioners connect code, credentials, and governance across the systems their teams build and operate.
NHIMG Editorial Note
Published by the NHIMG editorial team on August 20, 2026.
Updated on October 12, 2026.
NHI Mgmt Group, the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org