Subscribe to the Non-Human & AI Identity Journal
Home FAQ Threats, Abuse & Incident Response What fails when CI/CD workflows can access secrets…
Threats, Abuse & Incident Response

What fails when CI/CD workflows can access secrets and publishing tokens?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated August 2, 2026 Domain: Threats, Abuse & Incident Response

The failure is identity collapse inside the pipeline. A runner that can read secrets, write releases, and publish packages becomes a high-value non-human identity with too much authority. If that runner is compromised, attackers can steal credentials and propagate malicious code through trusted automation rather than needing separate account compromises.

Why This Matters for Security Teams

When CI/CD workflows can read secrets and publish artifacts, the pipeline stops being a helper and becomes a high-trust non-human identity. That matters because build systems often span source, test, release, and deployment, so a single compromised runner can inherit privileges that would never be granted to a human operator. The result is not just credential theft, but trusted delivery of malicious code, poisoned packages, and unauthorized release activity.

This is a recurring theme in the Guide to the Secret Sprawl Challenge and the CI/CD pipeline exploitation case study: once secrets and publishing authority converge in automation, blast radius expands faster than most access reviews can track. OWASP also frames this as a core NHI risk in the OWASP Non-Human Identity Top 10, where exposed or overprivileged machine identities are treated as first-class attack surfaces. In practice, many security teams encounter the failure only after a pipeline has already signed, published, or deployed something it should never have touched.

How It Works in Practice

The secure pattern is to separate what the workflow can do from what it can hold. A CI/CD runner should not carry long-lived publishing tokens if a narrower, short-lived exchange is possible. Current guidance suggests treating the runner as an ephemeral workload identity, then issuing just-in-time credentials only for the exact task being executed. That means short TTLs, automatic revocation, and request-time policy checks rather than static permissions baked into YAML.

In practice, this often looks like workload identity plus runtime authorization. The runner proves what it is through cryptographic identity, such as OIDC-based federation or SPIFFE-style workload identity, then requests narrowly scoped access to a package registry, artifact store, or signing service. Policy engines can evaluate context at request time, including branch, environment, approver status, and the specific action being attempted. NIST’s NIST SP 800-53 Rev 5 Security and Privacy Controls remains useful here for mapping least privilege and separation of duties, but the implementation detail is that the pipeline should never need broad standing access just to build safely.

  • Give build jobs ephemeral tokens per task, not reusable release credentials.
  • Split read, write, sign, and publish duties across separate identities.
  • Store secrets in a vault and inject them only at execution time.
  • Revoke credentials automatically when the job completes or fails.

These controls tend to break down in monolithic release pipelines where one runner is expected to test, sign, publish, and deploy across multiple environments.

Common Variations and Edge Cases

Tighter pipeline controls often increase operational friction, requiring organisations to balance release speed against blast-radius reduction. There is no universal standard for this yet, especially in multi-repo or multi-cloud delivery systems where tooling expects broad token reuse. Best practice is evolving, but the direction is clear: static secrets and “one token for everything” workflows are a liability.

Some environments still rely on long-lived registry tokens because older package managers or signing tools do not support workload federation cleanly. In those cases, the safer interim step is to narrow scope aggressively, isolate publishing jobs, and monitor for anomalous use of release credentials. The 2025 State of NHIs and Secrets in Cybersecurity highlights how often NHI tokens are duplicated or left active after they should have been removed, which is exactly the failure mode that turns CI/CD into a persistence channel. The broader lesson is reinforced by the Shai Hulud npm malware campaign: once automation can both steal and reuse secrets, the supply chain becomes the attacker’s delivery path, not the defender’s control plane.

Standards & Framework Alignment

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

OWASP Agentic AI Top 10, CSA MAESTRO and OWASP Non-Human Identity Top 10 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.

FrameworkControl / ReferenceRelevance
OWASP Agentic AI Top 10A2Pipeline identities can be abused by autonomous tool actions and secret theft.
CSA MAESTROM1Covers identity, secret, and orchestration risks in automated agent workflows.
NIST AI RMFGOVERNGovernance is needed for accountability over autonomous CI/CD behaviour and release authority.
OWASP Non-Human Identity Top 10NHI-03Directly addresses secret exposure and overprivileged non-human identities in pipelines.
NIST CSF 2.0PR.AC-4Least privilege access control is central to CI/CD secret containment.

Replace standing publish tokens with short-lived, task-scoped credentials and rapid revocation.

NHIMG Editorial Note
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