Because those tokens usually authenticate systems, pipelines, and repositories rather than one person. A stolen token can bypass normal human session controls and keep working until it is revoked, often across multiple environments. That is why non-human identity governance must cover creation, scope, storage, and revocation of tokens, not just user logins.
Why This Matters for Security Teams
npm and GitHub tokens are not just another user credential. They often authorize CI/CD runners, repository automation, package publishing, dependency access, and workflow triggers, which means a single stolen token can cross boundaries that a human account never should. The practical risk is lateral movement across code, build systems, and release pipelines, especially when token scope is broad or revocation is slow. NHI management has to treat these tokens as production identities, not developer convenience artifacts.
This is why incidents like the Shai Hulud npm malware campaign and the JetBrains GitHub plugin token exposure matter beyond the initial compromise. They show how one exposed secret can become a reusable foothold across multiple trust zones. Current guidance from NIST SP 800-53 Rev 5 Security and Privacy Controls supports least privilege and credential lifecycle controls, but teams still underestimate how fast tokens spread once they are embedded in automation. In practice, many security teams encounter token abuse only after a pipeline has already been used to pull source, publish artifacts, or access downstream systems.
How It Works in Practice
The key difference is that token abuse is usually system-to-system, not person-to-person. A stolen npm or GitHub token can authenticate from an attacker-controlled host, a compromised build runner, or a malicious workflow step without tripping the same signals that protect a normal user session. That makes token scope, TTL, storage location, and revocation path the real control points.
Effective governance starts by classifying each token by what it can do, where it can run, and how long it should live. For high-risk automation, best practice is evolving toward short-lived, task-bound credentials rather than static secrets. That means:
- Issue credentials only when a job starts, and revoke them when the job ends.
- Separate human developer access from pipeline and publishing access.
- Use workload identity and federation where possible instead of copying long-lived secrets into runners.
- Apply policy at request time, not only at account creation, so access can reflect context such as repository, branch, environment, and artifact type.
This approach aligns with the practical direction in NIST Cybersecurity Framework 2.0 and with current supply-chain concerns highlighted in the Guide to the Secret Sprawl Challenge. It also helps explain why The State of Secrets Sprawl 2025 reported that 4.6% of public GitHub repositories contain at least one hardcoded secret. These controls tend to break down when tokens are reused across multiple pipelines because one stolen secret then inherits every connected trust path.
Common Variations and Edge Cases
Tighter token controls often increase operational overhead, so organisations have to balance developer velocity against blast-radius reduction. That tradeoff becomes more visible in monorepos, cross-org automation, and legacy CI systems that cannot yet issue short-lived workload tokens.
There is no universal standard for this yet, but current guidance suggests treating the following cases differently:
- Package publish tokens should be more tightly scoped than read-only dependency tokens.
- GitHub automation tokens used by bots should not share lifecycle rules with human PATs.
- Vendor-managed integrations may require separate review because revocation can disrupt upstream delivery.
- Self-hosted runners need stronger isolation because compromised hosts can capture tokens in memory or logs.
When token sprawl is already entrenched, the first priority is inventory and revocation hygiene, not a wholesale platform rewrite. The 52 NHI Breaches Analysis shows that identity compromise often becomes visible only after attackers have chained access across multiple services. In those environments, the model breaks down when one token is reused across repositories, environments, and third-party integrations because blast radius is no longer bounded by a single account.
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, OWASP Agentic AI Top 10 and CSA MAESTRO address the attack and risk surface, while NIST AI RMF and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.
| Framework | Control / Reference | Relevance |
|---|---|---|
| OWASP Non-Human Identity Top 10 | NHI-01 | Stolen tokens are non-human identities and need lifecycle control. |
| OWASP Agentic AI Top 10 | AIA-03 | Automation tokens act like tool-using agents with broad execution authority. |
| CSA MAESTRO | AISEC-04 | Covers runtime authorization and tool access for autonomous workflows. |
| NIST AI RMF | Risk management should include secret exposure and downstream misuse. | |
| NIST CSF 2.0 | PR.AC-4 | Least privilege and access lifecycle controls reduce blast radius. |
Bind automation access to task context and limit each token to one approved action path.
Related resources from NHI Mgmt Group
Deepen Your Knowledge
Reviewed and updated by the NHIMG editorial team on August 2, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org