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.
NHIMG editorial — based on content published by Sonar: The State of Code Developer Survey
By the numbers:
- Sonar's survey finds that 42% of committed code is currently AI-generated or assisted, and developers expect that share to reach 65% by 2027.
- Sonar reports that 96% of developers do not fully trust AI-generated code, while only 48% always verify it before committing.
- Sonar says 38% of developers find reviewing AI-generated code requires more effort than reviewing human-written code.
Questions worth separating out
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.
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.
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.
Practitioner guidance
- 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.
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
👉 Read Sonar's full State of Code Developer Survey on AI coding and verification →
AI-generated code verification: are your engineering controls keeping up?
Explore further
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.
A question worth separating out:
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.
👉 Read our full editorial: AI-generated code is creating a verification bottleneck for developers