Subscribe to the Non-Human & AI Identity Journal

Why do service tokens in CI pipelines create more risk than ordinary application secrets?

CI tokens often carry broad trust, long lifetimes, and access to source control, registries, or cloud APIs. That makes them high-value non-human identities rather than simple configuration values. When one is stolen, the attacker can publish code, modify workflows, or move into cloud accounts without needing further phishing or malware.

Why This Matters for Security Teams

Service tokens in CI pipelines are not ordinary application secrets because they often sit at the intersection of source code, build automation, package publishing, and cloud administration. A single token may let a runner clone private repositories, push artifacts, update deployment manifests, or call infrastructure APIs. That turns a routine credential into a high-trust non-human identity with blast radius far beyond one application.

This risk is amplified by secrets sprawl and long-lived access. NHIMG research on The State of Secrets Sprawl 2026 shows that 64% of valid secrets leaked in 2022 were still valid and exploitable today, which is exactly why detection alone is not enough. The OWASP Non-Human Identity Top 10 treats these identities as governance objects, not convenience strings.

Security teams often underestimate how quickly a compromised CI token becomes supply chain access, because the first visible symptom is usually a successful build, not a failed login.

How It Works in Practice

A CI token becomes dangerous when it inherits broad permissions, travels through multiple systems, and outlives the job that needs it. In practice, pipeline credentials are often reused across repositories, injected into runners, and stored in configuration or logs. That means a token stolen from one build can be replayed against registries, Git hosting, secret managers, or cloud control planes.

Current guidance suggests treating these tokens as workload identities with tightly scoped, short-lived access rather than static secrets. That is why Static vs Dynamic Secrets is such a useful lens: ephemeral credentials reduce the window of abuse and make rotation practical. In modern pipelines, the preferred pattern is JIT issuance from a trusted identity provider, followed by automatic revocation when the job ends. Where available, OIDC-based federation, SPIFFE-style workload identity, and policy-as-code enforcement can replace hardcoded tokens with request-time authorization.

  • Scope each token to one pipeline, one repository, or one artifact action.
  • Use short TTLs and auto-revocation instead of manual rotation schedules.
  • Separate read, build, publish, and deploy privileges rather than reusing one credential.
  • Log token issuance and use so abnormal pipeline behavior can be detected quickly.

For real-world abuse patterns, NHIMG’s CI/CD pipeline exploitation case study shows how attackers chain a stolen token into code tampering and cloud movement, while NIST’s Cybersecurity Framework 2.0 reinforces asset visibility, least privilege, and continuous monitoring as baseline controls. These controls tend to break down when shared runners, broad repository org-wide secrets, and cross-account cloud trust are combined in the same delivery path.

Common Variations and Edge Cases

Tighter token controls often increase operational overhead, so teams have to balance build reliability against reduced credential exposure. The right pattern depends on whether the pipeline is public or private, ephemeral or persistent, and whether it publishes artifacts or also performs deployment.

One edge case is legacy automation that cannot yet support OIDC federation or per-job token exchange. In those environments, best practice is evolving, but the safest interim approach is still to isolate the credential, shorten its TTL, and constrain it to one narrow action. Another common exception is third-party CI integrations that require outbound access to vendor APIs. Those tokens should be treated as external NHIs with separate lifecycle controls, not bundled into the same secret scope as internal build credentials.

NHIMG’s Guide to the Secret Sprawl Challenge is relevant here because pipeline tokens frequently become duplicated across runners, tickets, and config files, which defeats any theoretical least-privilege model. The practical test is simple: if a token can publish code, deploy infrastructure, or alter build logic, it should be governed like a privileged identity, not stored like an ordinary application setting. In environments with shared runners and high-frequency releases, that distinction often gets lost until a token is reused outside its intended job context.

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-03 CI tokens are non-human identities that need tight lifecycle and rotation control.
OWASP Agentic AI Top 10 A2 CI pipelines act autonomously enough that tool-use permissions must be tightly constrained.
CSA MAESTRO IAM-04 MAESTRO addresses machine identity governance for automated cloud workloads.
NIST AI RMF GOVERN Governance is needed because automated pipelines can change behavior and reach unexpectedly.
NIST CSF 2.0 PR.AC-4 Least privilege and access management are central to reducing token blast radius.

Manage pipeline identities as machine identities with least privilege and workload-specific trust boundaries.