TL;DR: AI-assisted coding now spreads secrets across code, endpoints and agent workflows, according to GitGuardian. Security teams have to map where those credentials live and revoke them without breaking the systems that still trust them.
Editorial analysis by NHI Mgmt Group, based on content published by GitGuardian: “Claude Code Security: Why the Real Risk Lies Beyond Code”.
By the numbers:
- AI-generated commits grew by a 10x factor over the past year, according to GitGuardian.
Key questions
Q: When does a leaked secret become a broader IAM problem?
A: A leaked secret becomes a broader IAM problem when ownership, scope, and revocation are unclear.
Q: What are the signs that NHI governance is failing in agentic AI environments?
A: NHI governance is failing when security teams cannot answer basic questions about ownership, approval, and shutdown.
Q: What breaks when AI-generated code starts spreading secrets beyond the repository?
A: Repository scanning alone stops being sufficient because the real trust boundary moves into endpoints, agent workflows, and downstream services.
Practitioner guidance
- Map AI-assisted code to identity exposure paths Track where generated code introduces API keys, tokens, certificates, or service credentials, and assign ownership for each exposed secret before it spreads into downstream systems.
- Build remediation around blast-radius analysis When a secret is found, determine which servers, apps, vaults, and agents trust it before revocation so production impact is understood and controlled.
- Inventory agent authentication separately Create a dedicated inventory for AI agents and other non-human actors that authenticate to tools, data sources, and services, then tie that inventory to offboarding and review.
Bottom line: AI-generated code does not just increase vulnerability volume. It accelerates the spread of credentials and delegated access across systems that source-code tools do not fully govern.
Glossary terms: Non-Human Identity (NHI), Secrets Management, Blast Radius, Agentic security
Explore further
View Full Forum → | NHI Foundation Course → | Our Services → | Read the full analysis →
AI code generation creates identity exposure faster than code review can contain. The core issue is not whether AI-written code is syntactically safer, but whether it introduces secrets and delegated access faster than governance teams can inventory them. That makes NHI lifecycle control the limiting factor, because exposed credentials become a standing trust problem the moment they leave the commit. Practitioners should treat generated code as an identity distribution channel, not just a software delivery artefact.
A few things that frame the scale:
- Claude Code-assisted commits leaked secrets at a rate of 3.2%, more than double the human-only baseline of 1.5%, with peaks reaching 31 secrets per 1,000 commits in August 2025, according to the State of Secrets Sprawl 2026.
A question worth separating out:
Q: Should teams prioritise secrets detection or non-human identity inventory first?
A: If exposures are already recurring, inventory and ownership usually come first because you cannot safely remediate what you cannot map. Detection still matters, but without inventory it only produces alerts, not controlled recovery across the systems that trust the secret.
👉 Read our full editorial: AI code generation expands NHI risk beyond source code security