Join our Newsletter — 33% off our NHI Course
Home› FAQ› Architecture & Implementation› What should teams do first when a CI…
Architecture & Implementation

What should teams do first when a CI workflow can mint publish credentials?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 12, 2026 Domain: Architecture & Implementation

Start by identifying every workflow that can exchange build context for external credentials, especially release jobs and pull_request_target paths. Then remove unnecessary secret access, pin workflow references to immutable SHAs, and separate build permissions from publish permissions so one compromised runner cannot impersonate the release process.

What to do first when a workflow can mint publish credentials

Start with a credential path inventory, not a permissions tweak. The urgent question is which workflows can exchange build context for external authority, then which of those paths can reach a publish or release trust boundary. That is where compromise becomes publication, so the first pass should map every minting path before changing controls.

Look specifically at release jobs, fork-triggered flows, and any path that can inject or inherit secrets at runtime. A workflow that can mint publish credentials is not just a build step, it is a production access path, so it needs the same scrutiny as any other authentication and privilege boundary.

That first inventory should also establish where build logic, signing logic, and publishing logic are mixed together. If one runner can both compile untrusted code and obtain publish authority, the workflow is already over-permissioned even if no exploit has been observed.

Why the publish path must be separated from build execution

Build runners are exposed to untrusted inputs by design, while publish credentials represent downstream authority. Mixing the two makes compromise cheap: an attacker who influences the build can often pivot into release actions, package publication, or secret exfiltration. The Secret Sprawl Challenge is useful background here because CI/CD secret exposure is rarely a single leak, it is usually a pattern of unnecessary availability.

The practical fix is separation of duties. The build job should produce an artifact, while a tightly controlled release job should decide whether that artifact may be published. Where possible, use short-lived, scoped credentials for the release step instead of long-lived secrets that can be reused outside the intended trust boundary. Secrets Management Guide explains why centralised, short-lived secret handling reduces blast radius when automation is compromised.

Teams should also pin workflow and action references to immutable SHAs so the publish path cannot silently change under them. If a workflow file or reusable action can be updated by reference drift, the minting path itself becomes mutable infrastructure, which weakens any claim that publish authority is actually constrained. API Key Management Guide reinforces the broader lifecycle principle: authority should be scoped, revocable, and bounded to the minimum required use case.

How teams should decide whether a workflow is allowed to mint credentials

The decision rule is simple: if a workflow can run on untrusted code or unreviewed event context, it should not directly mint publish credentials. Treat that as a release-only capability, or move the minting step behind a stronger approval and identity boundary. A path that is safe for building is not automatically safe for publishing.

Where release automation is necessary, keep the credential scope narrow enough that a leaked token cannot be reused for general account access or cross-environment actions. That means explicit environment separation, minimal permissions, and a clear distinction between artifact creation, artifact validation, and artifact publication. The aim is not to remove automation, but to ensure the automation cannot impersonate the release process from an ordinary runner.

When teams need a deeper model for credential lifecycle and rotation in automation-heavy environments, Guide to NHI Rotation Challenges and Ultimate Guide to NHIs, Static vs Dynamic Secrets both point to the same operational lesson: publish authority should be ephemeral wherever practical, and rotation is only effective when the dependency chain is understood.

Risk and Threat Considerations

The main risk is privilege crossover. If the same workflow can build from untrusted inputs and mint publish credentials, an attacker needs only one foothold in the pipeline to turn code execution into release authority, package tampering, or secret theft. That makes the publish path an attractive target even when the original compromise looks like an ordinary build issue.

Failure mechanism: A compromised or attacker-influenced workflow uses its build context to request, inherit, or replay credentials that were meant only for release operations, then abuses those credentials before detection.

Impact: Malicious code, poisoned artifacts, or unauthorised package publication can reach consumers under a trusted release identity, expanding the blast radius from one job to the wider supply chain.

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 and OWASP API Security Top 10 address the attack and risk surface, while SLSA and NIST SP 800-53 Rev 5 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
SLSASupply chain integrityCI workflows that mint publish creds directly affect artifact provenance and release trust.
Recommendation — Separate build and release duties so only trusted release steps can publish artifacts.
OWASP Non-Human Identity Top 10NHI-02 — Secret LeakagePublish credentials in CI are exposed when workflows over-share or inherit secrets.
Recommendation — Reduce secret exposure in workflows and scope credentials to the minimum publish step.
NIST SP 800-53 Rev 5IA-5 — Authenticator ManagementWorkflow-minted publish credentials need lifecycle control, rotation, and revocation.
AC-6 — Least PrivilegeBuild jobs should not hold publish authority or broad secret access.
Recommendation — Enforce short-lived credentials and revoke any publish token that outlives its intended use. Split build and publish permissions so runners only get the access they need.
OWASP API Security Top 10API2 — Broken AuthenticationMinting publish credentials from workflow context is an authentication boundary that can be abused.
Recommendation — Treat credential issuance as a protected auth flow and block untrusted issuance paths.

Practitioner Guidance

What to prioritise: Start by enumerating every workflow trigger and secret exposure path, then classify which ones can reach publish authority without human review. The highest-risk cases are release jobs, reusable workflows, and any event path that can be influenced by external contributors or mutable references.

What to verify: Confirm that build jobs cannot mint production-scoped credentials, that release credentials are isolated from normal runner permissions, and that workflow references resolve to pinned immutable versions. If a workflow needs publish capability, verify that the release boundary is explicit and auditable rather than inherited from the build step.

Common mistake: Teams often focus on secret storage while leaving the workflow trust model unchanged. A well-stored secret is still unsafe if too many jobs can reach it, or if a compromised runner can ask for fresh credentials on demand.

Practitioner takeaway: Treat credential minting as a release privilege, not a build convenience, and design the workflow so untrusted execution can never become publication authority.

Free weekly newsletter

Subscribe to the NHI & AI Identity Journal

The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.

Bonus 33% off our NHI Course when you subscribe.

NHIMG Editorial Note
Reviewed and updated by the NHIMG editorial team on October 12, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org