TL;DR: AI-generated and AI-assisted code now accounts for 42% of committed code, while Sonar says its users are 24% more likely to report lower vulnerability rates and 20% more likely to report lower defect rates, underscoring that verification has become the real bottleneck in modern software delivery, according to Sonar. The security shift is no longer about producing more code faster, but about embedding automated guardrails for human and agentic workflows before defects, secrets, and architectural drift reach production.
At a glance
What this is: This is Sonar’s 2025 year-in-review analysis of AI code assurance, agentic analysis, supply chain security, and architecture governance for modern software delivery.
Why it matters: It matters because development velocity now depends on verification, and identity-adjacent controls around tool access, agent behaviour, secrets, and workflow trust increasingly shape software risk.
By the numbers:
- AI-generated or AI-assisted code now accounts for 42% of all committed code, according to Sonar.
- SonarQube analyzes over 750 billion lines of code daily for more than 7 million developers and 400,000 organizations.
- Sonar says its users are 24% more likely to report lower vulnerability rates.
👉 Read Sonar’s year-in-review analysis of AI code assurance, MCP, and advanced security
Context
AI code generation has changed the security problem from simple defect detection to governed verification at speed. When a large share of code is produced or assisted by models and agents, traditional review gates are no longer enough unless they are embedded directly into the development workflow, including IDEs, CI/CD, and pull-request controls.
The identity implication is real even in a software quality story: AI coding agents, MCP-connected tools, and secret-bearing pipelines all rely on access, scope, and authorization boundaries. That makes this topic relevant to IAM, PAM, NHI governance, and agentic AI security as much as to application security.
Sonar’s starting position is typical of the broader market: enterprises want faster delivery, but many still treat verification as a downstream activity rather than a runtime control point. The article shows how that assumption is breaking under AI-driven development.
Key questions
Q: How should security teams secure AI-assisted development without overwhelming AppSec workflows?
A: Start with continuous discovery, then connect findings to exposure, criticality, and data sensitivity before remediation begins. AI-assisted development increases the pace of change, so the control problem becomes deciding what matters fast enough to act on it. Teams that keep relying on scan volume alone will stay busy without reducing real risk.
Q: Why do AI coding agents create access and governance risk even when they are not autonomous?
A: Because they already operate with tool access, repository access, and execution permissions inside a live workflow. That means the risk comes from delegated authority, not just independence. Even partially supervised agents can still manipulate sensitive code, secrets, or deployment paths if their permissions and review boundaries are loose.
Q: What breaks when secret scanning only covers public repositories?
A: Repository-scoped scanning misses secrets that leak through forks, issues, comments, build logs, open source contributions, and attacker-controlled exfiltration paths. That creates a false sense of coverage because the credential may already be validated and abused before the platform ever sees public exposure. Effective governance needs scanning plus containment, rotation, and revocation.
Q: How should teams govern architecture drift when AI agents can change code continuously?
A: Teams should turn architectural intent into automated policy checks that run on every change, not periodic reviews. That lets them catch dependency violations, trust path expansion, and layering drift while the code is still moving, which is the only point where governance can keep pace with agentic delivery.
Technical breakdown
Why AI code assurance is becoming a control plane
AI code assurance is the practice of verifying code quality, security, and architectural fit at the point where code is created and changed, not only at release time. In AI-assisted development, this includes human-written code, model-generated code, and agent-produced remediation. The shift matters because defects, insecure patterns, and leaked secrets can now be introduced at machine speed. That makes static checkpoints insufficient unless they are connected to IDEs, CI/CD, and pull-request workflows.
Practical implication: move verification earlier and bind it to the same workflow where code is generated.
How MCP-connected tools change governance boundaries
The Model Context Protocol lets AI agents connect to tools and data sources in a structured way, which makes security and governance questions more urgent. When a code analysis engine is exposed to an agent through MCP, the control issue is not just whether the agent can call the tool, but what the agent can learn, trigger, or remediate based on that access. That creates a governance layer around identity, authorization, and auditability for AI-assisted workflows.
Practical implication: treat MCP connections as governed access paths, not harmless integrations.
Why architecture drift is a security problem
Architecture drift occurs when the implemented codebase slowly diverges from the intended design. In high-velocity and AI-assisted environments, this is not just a maintainability issue. It can create hidden trust paths, violate dependency boundaries, and make security controls harder to reason about. Continuous architecture verification turns the blueprint into an enforceable policy, which is useful when teams need evidence that code changes still fit approved patterns.
Practical implication: enforce architecture rules as automated checks before drift becomes technical debt.
NHI Mgmt Group analysis
AI code generation has turned verification into the primary security bottleneck. The article’s core finding is not that teams need more code faster, but that they need stronger verification where code is produced and remediated. That is a meaningful shift for application security and identity governance alike, because the tooling layer now includes agents, IDEs, and workflow integrations that must be scoped and audited. Practitioners should treat AI-driven delivery as a governance problem, not only a developer productivity problem.
Agentic coding tools introduce a new trust boundary around remediation. When an autonomous or semi-autonomous agent can inspect, propose, or change code, the security question becomes who authorises the action, what context the agent can see, and how those actions are traced. That intersects directly with NHI and agentic AI governance because tool-linked agents behave like non-human identities with delegated capabilities. The practical conclusion is that access scope, evidence capture, and approval policy must be designed together.
Secrets detection is only useful when it is embedded before commit and before build. The article reinforces a familiar but often under-enforced truth: credential exposure is a pipeline problem, not just a repository problem. Expanded pattern matching helps, but the real control is preventing secrets from ever reaching production code paths. That is especially relevant for NHI governance because leaked API keys, tokens, and certificates are non-human identities in their most exposed form. Teams should measure whether prevention and revocation are happening at workflow speed.
Architecture management is becoming part of security governance, not a separate discipline. Continuous checks against an intended blueprint help constrain drift created by both developers and AI agents. This matters because structural violations can create unreviewed dependencies and ungoverned trust relationships. The most useful concept here is architecture drift: the longer code diverges from approved structure, the harder it becomes to reason about privilege, blast radius, and secure change. Practitioners should fold architecture enforcement into release governance.
The market is moving toward integrated SDLC governance rather than point security tools. The article shows a clear direction of travel: code quality, security, supply chain controls, and developer workflow integration are converging into one control plane. That does not eliminate the need for specialist tools, but it does raise the bar for orchestration, evidence, and policy consistency. For identity teams, the implication is that software delivery environments are now identity-rich control surfaces that need lifecycle, access, and delegation governance.
From our research:
- 96% of organisations store secrets outside of secrets managers in vulnerable locations including code, config files, and CI/CD tools, according to the Ultimate Guide to NHIs.
- Only 20% have formal processes for offboarding and revoking API keys, and even fewer have procedures for rotating them.
- For lifecycle governance across secrets and service accounts, see Ultimate Guide to NHIs , 2025 Outlook and Predictions.
What this signals
AI-assisted development is collapsing the distance between code creation and security decision-making. That means development, AppSec, and identity teams need a shared operating model for tool access, evidence capture, and workflow policy. The control point is no longer the final scan, it is the governed path from prompt to commit to release.
Secrets management now sits inside the software factory, not beside it. When credentials appear in IDEs, pipelines, and agent workflows, the programme needs faster detection-to-revocation loops and stronger linkage to the Ultimate Guide to NHIs. Teams that still treat secrets as a post-commit clean-up problem will keep absorbing avoidable exposure.
The broader signal is that agentic AI will push security programmes toward runtime evidence, not periodic assurances. That aligns closely with the direction of NIST AI Risk Management Framework and OWASP Agentic AI Top 10 thinking, where governance must follow behaviour, not assume it.
For practitioners
- Embed verification at the point of creation Shift security checks into the IDE, pull request, and CI/CD stages so insecure code is blocked before merge, not after release. This is where AI-assisted development changes the control model.
- Govern agent access to remediation tools Treat AI coding agents as delegated non-human identities. Define what they can inspect, change, and execute, and require audit trails for every tool call and code modification.
- Harden secrets prevention and revocation Scan for API keys, passwords, and tokens before commit, rotate exposed credentials immediately, and connect detection to revocation workflows so leaked secrets do not remain valid.
- Make architecture rules enforceable Convert approved architectural boundaries into automated checks that fail builds when dependency or layering rules are violated. Use those failures as governance evidence, not just developer feedback.
Key takeaways
- AI-generated code is forcing verification to become a first-class control, not a final checkpoint.
- The biggest identity risk in this workflow is delegated agent access to tools, secrets, and remediation paths.
- Teams that cannot govern secrets, architecture, and agent actions at workflow speed will accumulate security debt faster than review can remove it.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
OWASP Agentic AI Top 10, OWASP Non-Human Identity Top 10 and MITRE ATT&CK address the attack and risk surface, while NIST CSF 2.0 and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Agentic AI Top 10 | Agentic coding workflows and MCP connections raise tool-use and delegation risks. | |
| OWASP Non-Human Identity Top 10 | NHI-03 | Secrets exposure and lifecycle gaps are central to the article’s security posture. |
| NIST CSF 2.0 | PR.AC-4 | Workflow access and least privilege are central to AI-assisted development governance. |
| NIST SP 800-53 Rev 5 | IA-5 | Credential management is directly implicated by the article’s secrets detection discussion. |
| MITRE ATT&CK | TA0006 , Credential Access; TA0003 , Persistence | Leaked secrets and reused credentials support credential access and persistence outcomes. |
Constrain developer and agent access paths with least-privilege permissions and reviewed scopes.
Key terms
- AI Code Security: AI code security is the practice of finding and controlling vulnerabilities introduced by generative coding tools and AI-assisted development workflows. It combines AppSec, policy enforcement, and runtime validation so machine-generated code is checked for unsafe logic, hallucinated dependencies, and secret exposure before production.
- Model Context Protocol: Model Context Protocol is an open protocol that lets AI agents connect to tools and data sources. It expands what an agent can reach, so governance has to cover not only the model and its prompts, but also every system that can receive or return agent-driven data.
- Architectural Drift: The gradual divergence between the system structure a team intends and the structure that the codebase actually expresses. It usually emerges through shortcuts, duplicated logic, and boundary violations that accumulate over time until the code becomes harder to understand and change safely.
- Secrets detection: Secrets detection is the identification of credentials such as API keys, tokens, certificates, and passwords in code, configuration files, or pipelines. In mature programmes, detection is paired with rotation, revocation, and ownership so exposed secrets do not remain usable.
What's in the full article
Sonar’s full year-in-review post covers the operational detail this analysis intentionally leaves for the source:
- Specific product changes across AI Code Assurance, Advanced Security, and MCP Server integration for real-world deployment decisions
- Expanded support details for AI-native IDEs and agentic coding workflows, including where the controls sit in the development lifecycle
- Implementation context for secrets detection, architecture management, and SDLC governance inside SonarQube environments
- Release-specific milestones such as the 2025.1 LTA and compliance coverage additions for teams tracking platform maturity
Deepen your knowledge
The NHI Foundation Level course, the industry's only accredited NHI security programme, covers NHI governance, machine identity security, secrets management, and agentic AI identity. It helps practitioners connect identity controls to modern delivery pipelines and delegated tool use.
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