Subscribe to the Non-Human & AI Identity Journal

Why do leaked secrets remain such a persistent NHI risk?

Leaked secrets persist because they are often embedded in code, pipelines, or collaboration tools, then left valid long enough for reuse. The real problem is not only exposure but weak identity lifecycle management, especially when ownership, rotation, and revocation are not tightly governed.

Why This Matters for Security Teams

Leaked secrets stay dangerous because exposure is only the first failure. The bigger issue is that a credential often outlives the event that exposed it, which gives attackers time to reuse it across pipelines, chat tools, and production systems. NHIMG research shows this is not theoretical: The 2025 State of NHIs and Secrets in Cybersecurity reports that 91% of former employee tokens remain active after offboarding. That means the identity lifecycle is still broken after the leak is discovered.

This problem also crosses beyond source code. Secrets are now routinely shared in collaboration platforms and tickets, so teams that only scan repositories miss a large share of exposure paths. Guidance from OWASP Non-Human Identity Top 10 and NIST Cybersecurity Framework 2.0 both point toward the same operational truth: discovery must be paired with ownership, revocation, and continuous control validation. In practice, many security teams encounter reusable secrets only after lateral movement or pipeline abuse has already occurred, rather than through intentional detection.

How It Works in Practice

Persistent secret risk is usually the result of four compounding failures: duplicated storage, weak ownership, delayed rotation, and absent revocation. A secret is copied from a vault into a pipeline variable, pasted into a ticket, mirrored into a wiki, then forgotten in all four places. If any one location remains valid, the leak still matters. NHIMG’s Guide to the Secret Sprawl Challenge and Top 10 NHI Issues both show why sprawl is a lifecycle problem, not just a scanning problem.

Operationally, teams need to treat every leaked secret as an identity event. That means:

  • Assigning a clear owner for every NHI, token, key, or certificate.
  • Setting short TTLs where possible, then automating renewal only for active workloads.
  • Revoking exposed credentials immediately, not at the next scheduled rotation window.
  • Scanning code, CI/CD logs, chat, ticketing, and documentation systems together.
  • Blocking reuse of the same secret across multiple services or environments.

The evidence base for this approach is strong. Entro Security reports that 62% of all secrets are duplicated in multiple locations and that 44% of NHI tokens are exposed in the wild, while GitGuardian found that 64% of valid secrets leaked in 2022 are still valid today. That combination explains why detection alone fails. The right control is not just finding the leak, but shrinking the credential lifetime so the leak has no usable window. These controls tend to break down in heavily manual environments because ownership, revocation, and exception handling are too slow to keep pace with secret reuse.

Common Variations and Edge Cases

Tighter secret controls often increase operational overhead, so organisations must balance speed of delivery against the cost of automated governance. That tradeoff is especially visible in legacy systems, partner integrations, and emergency access paths, where short-lived credentials may be difficult to issue without breaking workflows.

Current guidance suggests three common exceptions need extra care. First, long-lived machine credentials that cannot yet be replaced should be wrapped in stronger monitoring and narrower scope, but there is no universal standard for this yet. Second, shared service accounts remain common in older estates, even though they weaken accountability and make revocation ambiguous. Third, secrets exposed outside code repositories deserve equal attention: NHIMG research shows that 28% of incidents now originate in Slack, Jira, and Confluence, and those incidents are more likely to be critical than code-based leaks. That is why 52 NHI Breaches Analysis and Shai Hulud npm malware campaign are useful references: they show how quickly exposed secrets become operational access. For teams managing agentic systems, the risk rises again because autonomous tools can chain credentials faster than humans can notice. That is why Anthropic — first AI-orchestrated cyber espionage campaign report is relevant to secret governance as much as threat intelligence. The practical lesson is simple: the more places a secret can live, the more places an attacker can use it.

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 AI RMF set the governance and control requirements practitioners need to meet.

Framework Control / Reference Relevance
OWASP Non-Human Identity Top 10 NHI-03 Secret rotation and revocation failures are the core issue here.
NIST CSF 2.0 PR.AC-1 Leaked secrets are identity proof, so access control must limit misuse quickly.
NIST AI RMF GOVERN Autonomous systems amplify the impact of reusable secrets and weak lifecycle controls.

Set accountability, monitoring, and escalation rules for secret use across automated systems.

Related resources from NHI Mgmt Group