By NHI Mgmt Group Editorial TeamPublished 2026-02-27Domain: Agentic AI & NHIsSource: GitGuardian

TL;DR: AI-assisted coding has grown 10x in the past year, while GitGuardian says leaked secrets, mismanaged NHIs, and broader agent access are now the real control problem as code generation shifts left and spreads across systems. The security question is no longer only code quality; it is identity, privilege, and blast-radius control.


At a glance

What this is: GitGuardian argues that AI-driven code generation is pushing security risk beyond application vulnerabilities and into leaked secrets, mismanaged NHIs, and broader agent access.

Why it matters: For IAM and NHI practitioners, the shift means code scanning alone is insufficient unless identity inventory, secret remediation, and access governance move together.

By the numbers:

👉 Read GitGuardian's analysis of Claude Code Security and NHI exposure


Context

AI-generated code is changing where security risk accumulates. As more code is produced by models and more software interactions are mediated by agents, the governance problem shifts from simply finding vulnerabilities in code to controlling the secrets, service accounts, tokens, and permissions that code and agents use to act.

For IAM and NHI teams, that means the main failure mode is no longer only insecure code paths. It is untracked identity sprawl, overprivileged access, and delayed remediation when a secret leaks or an agent inherits excessive authority. GitGuardian's framing reflects a broader pattern: the starting point is common, but the operational response must be wider than static analysis.

The article's starting position is not unusual. Many organisations still treat secrets exposure and NHI governance as adjacent problems rather than the same control domain, which leaves gaps in inventory, rotation, and blast-radius reduction.


Key questions

Q: How should security teams handle secrets in AI-generated code?

A: Security teams should treat AI-generated code as another source of credential exposure, not as a special case. The right response is broad secrets discovery, fast remediation, and ownership mapping across repositories, pipelines, chat systems, and endpoints. If the organisation cannot inventory where a secret exists, it cannot safely rotate or revoke it.

Q: Why do AI agents complicate NHI governance?

A: AI agents complicate NHI governance because they combine context, authentication, and action authority. That means each agent can inherit access to multiple systems, and any excess privilege becomes a scaling risk. Governance must define which tools an agent can reach, how long access lasts, and who can revoke it.

Q: What is the difference between secrets detection and NHI governance?

A: Secrets detection finds exposed credentials, while NHI governance tracks how those credentials are issued, reused, rotated, and retired. Detection answers whether a secret is visible. Governance answers whether the identity behind that secret is controlled throughout its lifecycle. Mature programmes need both because exposure without lifecycle control leaves the same risk open.

Q: When should teams move from code scanning to identity governance?

A: Teams should move immediately when credentials begin appearing outside code, when AI agents are given tool access, or when the same secret is reused across systems. Those are signs that code scanning alone cannot manage the blast radius. Identity governance becomes necessary once access, not syntax, is the main control problem.


Technical breakdown

Why AI-generated code changes the secrets exposure model

When code is generated faster, reviewed less consistently, and merged across more repositories, the number of places where credentials can appear increases. Secrets are not just hardcoded strings. They also surface in logs, configs, CI pipelines, chat tools, container images, and copied snippets. AI-assisted development can reduce some syntax errors, but it does not remove the structural risk that developers and agents still need authentication data to access systems and tools. That means the real problem becomes discovery and lifecycle control, not only code inspection.

Practical implication: Security teams need detection coverage across repositories, pipelines, and adjacent collaboration systems, not only source code.

Identity inventory as the missing layer in NHI governance

NHI governance depends on knowing where non-human identities exist, what they can access, and where they are reused. A secret becomes a governance issue when it is shared across environments, embedded in automation, or left active after its original purpose ends. Inventory is the control plane for remediation because you cannot safely rotate, revoke, or scope access if you do not know every place the credential lives. That is especially true when agents and workloads can chain actions across multiple tools.

Practical implication: Build a live inventory of secrets and machine identities before attempting broad remediation or rotation.

How agentic access changes the blast radius of compromise

An AI agent often combines model output, context from data sources, and the ability to take actions. Each of those components requires authentication. If that authentication is broad or persistent, the agent can cross boundaries that a human reviewer would not normally cross. The security problem is not just whether the agent is malicious. It is whether its effective privilege matches the task it is performing. This is where least privilege, short-lived access, and continuous review matter more than one-time approval.

Practical implication: Treat agent permissions as task-scoped and time-bound, with explicit review of every tool connection.


Threat narrative

Attacker objective: The attacker wants durable access through trusted non-human identities rather than noisy exploitation of code flaws.

  1. Entry occurs when leaked secrets, overprivileged tokens, or exposed credentials are discovered in code, logs, laptops, or shared systems.
  2. Escalation follows when those credentials grant access to multiple services, allowing the attacker or rogue agent to expand beyond the original target.
  3. Impact is achieved when the compromised identity is used to read data, modify systems, or persist through reused automation credentials.

Read our 52 NHI Breaches Analysis report for a comprehensive view of breaches impacting Non-Human Identities including AI Agents.


NHI Mgmt Group analysis

AI code generation is not replacing NHI risk. It is redistributing it. The control problem moves from source-code hygiene alone to the full identity lifecycle around the code, including secret issuance, reuse, rotation, and revocation. That makes NHI governance a first-class programme concern rather than a subtask of application security. Practitioners should plan for broader identity visibility, not narrower code review.

Secrets exposure and NHI mismanagement are now one operating problem. A leaked secret is not just a vulnerable string. It is a live authority object with lifecycle, blast radius, and trust relationships that extend across systems. That means remediation must include inventory, context, and coordinated revocation, not just finding the leak. The practitioner conclusion is simple: treat secret response as identity response.

Ephemeral access reduces dwell time, but it does not solve trust debt. If an agent or workload can mint or reuse access without clear governance, the enterprise inherits a hidden accumulation of privilege that becomes expensive to unwind. The result is an ephemeral credential trust debt: access that looks temporary but behaves like standing privilege in practice. Teams should measure whether access truly expires when the task ends.

Point solutions will not keep pace with agentic attack surface growth. The article's shift toward unified visibility reflects a category-wide reality. Detection, inventory, and response need to work across developer endpoints, CI systems, vaults, and agent toolchains because attackers and accidental exposure move across all of them. Security teams should expect consolidation around control coverage, not more single-purpose tools.

Endpoint visibility is becoming part of NHI governance, not a separate discipline. Developer laptops, local tools, and shadow experimentation can carry production credentials into places that governance teams do not normally inspect. That expands the scope of identity control beyond central systems and makes local discovery part of the core control model. Practitioners should extend NHI oversight to endpoints before attackers do it for them.

From our research:

What this signals

With AI-generated commits rising 10x over the past year, the governance gap is now structural rather than episodic. Existing IAM and code-security models were built for human development workflows, but agentic pipelines create more places where credentials can be copied, reused, or inherited without explicit oversight.

Ephemeral credential trust debt: temporary access often behaves like standing privilege once it spreads across automation, endpoints, and shared tools. The practical response is to measure where access really ends and to align revocation, rotation, and review with that boundary.

For teams following NIST Cybersecurity Framework 2.0, the shift reinforces the need to connect govern, protect, detect, and respond functions across code, identity, and endpoint control. For zero-trust programmes, continuous verification has to extend to machine identities and AI agents, not only users.


For practitioners


Key takeaways

  • AI code generation expands the security problem from source code quality to the identities and secrets that code and agents use.
  • Leaked secrets become operational risk quickly, because remediation is slow and reuse across systems increases blast radius.
  • Teams that want durable control need live inventory, task-scoped access, and endpoint visibility, not only better scanning.

Standards & Framework Alignment

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

OWASP Non-Human Identity Top 10 address the attack and risk surface, while NIST CSF 2.0 and NIST Zero Trust (SP 800-207) set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
OWASP Non-Human Identity Top 10NHI-03Secret rotation and revocation are central to the article's remediation problem.
NIST CSF 2.0PR.AC-4Least-privilege access for agents and workloads fits identity governance under protect.
NIST Zero Trust (SP 800-207)Continuous verification is required when AI agents and NHIs request tool access.

Apply PR.AC-4 to agent and workload access, then verify task-scoped permissions during review.


Key terms

  • Non-Human Identity: A non-human identity is any credentialed digital actor that performs work without a person directly present. That includes service accounts, API keys, tokens, certificates, bots, workloads, and AI agents. The governance challenge is that these identities often outnumber human users and are reused across systems.
  • Secrets Sprawl: Secrets sprawl is the uncontrolled spread of credentials across code, endpoints, pipelines, and collaboration tools. It creates visibility gaps because the same secret may exist in several places at once, each with different ownership and revocation requirements. Effective control requires inventory, context, and lifecycle management.
  • Agentic Access: Agentic access is the ability of an autonomous software entity to authenticate, retrieve context, and take actions through connected tools. It becomes risky when the agent’s permissions are broader than the task it needs to complete. Security teams must govern scope, duration, and revocation together.
  • Blast Radius: Blast radius is the range of systems, data, and workflows that can be affected if a credential or identity is compromised. In NHI programmes, it is shaped by reuse, privilege level, and how widely a secret is embedded. Reducing blast radius is often the fastest way to limit impact.

What's in the full article

GitGuardian's full analysis covers the operational detail this post intentionally leaves for the source:

  • How its large-scale secrets scanning works across more than 30 data sources and developer-facing systems
  • Operational detail on remediation coordination, including blast-radius assessment and production-safe rotation planning
  • Local endpoint scanning and identities inventory for developer laptops in distributed environments
  • How the company frames agentic security and honeytoken deployment at scale

👉 GitGuardian's full post covers secrets remediation, endpoint scanning, and agentic security detail.

Deepen your knowledge

AI agent access, secret lifecycle control, and NHI governance are core topics in our NHI Foundation Level course, the industry's only accredited NHI security programme. If you are building controls for AI-assisted development or agentic workflows, it is worth exploring.
NHIMG Editorial Note
Published by the NHIMG editorial team on 2026-02-27.
NHI Mgmt Group — the independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org