Join our Newsletter — 33% off our NHI Course
Home› FAQ› Governance, Ownership & Risk› Should organisations separate package publishing identity from CI…
Governance, Ownership & Risk

Should organisations separate package publishing identity from CI runtime identity?

← Back to all FAQ
By NHI Mgmt Group Editorial Team Updated October 12, 2026 Domain: Governance, Ownership & Risk

Yes. Publishing, build execution and deployment should use distinct identities with narrow scopes, because a compromise in one should not automatically expose the others. Separation limits how far an attacker can move when a maintainer account, workflow file or CI secret is abused.

Why separation matters for publishing, builds and deployment

package publishing identity is the principal actor that signs, uploads, or releases an artifact. CI runtime identity is the actor that executes tests, builds, and pipeline steps. Those duties should not collapse into one account or one secret set, because the trust boundary is different: publishing needs authority over release actions, while build execution needs controlled access to source, dependencies, and ephemeral tooling.

That separation reduces blast radius. If a maintainer token, CI runner, or workflow file is compromised, the attacker should not automatically gain the ability to publish a trusted package, impersonate release automation, or reuse the same credential elsewhere. Distinct identities also make audit trails clearer, because release activity and build activity can be reviewed independently.

Publishing identities are best treated as narrow release authorities, not general-purpose automation users. Build identities should be short-lived, scoped to the minimum repositories and registries they need, and isolated from the tokens that can create public artifacts. In practice, that means the person or system that can trigger a build should not be the same principal that can publish the resulting package.

A useful way to think about this is to separate the trust you grant to the build path from the trust you grant to the release path. A compromised build can be noisy and recoverable, but a compromised publishing identity can turn a clean build into a malicious release. A compromise of either path should not let an attacker cross directly into the other path.

Where the boundary usually fails

Separation fails when teams reuse the same token across local development, CI, and publication, or when a pipeline holds a long-lived publishing secret just because it is convenient. That creates a single point of failure: once the secret leaks, the attacker inherits both the ability to run pipeline actions and the ability to ship artifacts.

It also fails when build workflows are allowed to mint or retrieve release credentials on demand without a strong trust condition, such as protected branches, signed provenance, or narrowly delegated federation. If the runtime environment can reach the same publishing authority as the release process, then a poisoned workflow, dependency substitution, or malicious pull request may become a release event.

Supply-chain guidance consistently treats build and release trust as different problems, not one combined identity problem. The stronger pattern is to keep CI ephemeral and low privilege, then let a separate publishing identity act only when the pipeline has crossed the required assurance gates. That is the model described in CI/CD Pipeline Identity Security Guide, and it aligns with artifact-integrity guidance from NIST SP 800-190 Container Security and provenance controls described by OpenSSF.

What good separation looks like in practice

Good separation usually has three properties. First, build identities are ephemeral and do not carry publishing permissions. Second, publishing identities are distinct, narrowly scoped, and used only after the pipeline has produced a verifiable artifact. Third, the handoff between the two is explicit, so the release step can verify what was built before anything is published.

That model is easier to operate when you treat the release identity as a controlled delivery function, not as a shared automation convenience account. It should have access to the registry or package repository, but not broad access to source code, runner infrastructure, or unrelated cloud services. Build runners should be able to build, test, and prepare attestations, but not silently publish on their own.

This is also where provenance and trust policy matter. If your build identity can only assume publishing authority after a specific branch, tag, signature, or attestation check, then the publishing step becomes a conscious control point rather than a hidden side effect of CI execution. The distinction is especially important in ecosystems where packages are consumed automatically and a compromised release can spread quickly.

For organisations that also manage broader identity lifecycle and governance, the pattern maps cleanly to standard identity hygiene: separate ownership, separate credentials, separate rotation, and separate review. NHIMG’s NHI Lifecycle Management Guide and Top 10 NHI Issues reinforce the same operational principle, that the lifecycle and privilege of an automation identity must match its exact role. For teams standardising the control model, Ultimate Guide to NHIs, Standards is a useful reference point for the surrounding control set.

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 NIST SP 800-53 Rev 5 and NIST CSF 2.0 set the governance and control requirements practitioners need to meet.

FrameworkControl / ReferenceRelevance
NIST SP 800-53 Rev 5IA-9 — Identifier and Authentication (Service, Devices and Other Non-Organizational Users)CI and publishing identities are machine/service actors that need distinct authentication control.
AC-6 — Least PrivilegeThe answer depends on narrowing build and publish permissions to different principals.
IA-5 — Authenticator ManagementSeparation relies on managing CI and publishing secrets, tokens, and their rotation lifecycle.
Recommendation — Use IA-9 to separate and authenticate CI and publishing identities independently. Apply AC-6 so build and publish identities each retain only the permissions they need. Use IA-5 to manage, rotate, and restrict the authenticators assigned to each identity.
OWASP Non-Human Identity Top 10NHI-05 — Overprivileged NHIA shared publish-and-build identity is an overprivileged non-human identity pattern.
NHI-07 — Long-Lived SecretsCI and publishing separation is weakened when durable tokens are reused across both paths.
NHI-01 — Improper OffboardingSeparate identities make it safer to revoke one path without disrupting the other.
Recommendation — Remove shared privileges and split publishing from runtime access. Replace long-lived shared secrets with short-lived credentials per identity. Ensure each automation identity can be revoked independently when its role ends.
OWASP API Security Top 10API2 — Broken AuthenticationPublishing and runtime automation both depend on strong authentication to prevent token abuse.
API5 — Broken Function Level AuthorizationThe publishing function should be authorized separately from build execution.
Recommendation — Harden authentication so CI tokens cannot be reused as publishing credentials. Authorize publishing as a distinct function from build execution.
NIST CSF 2.0PR.AA-05 — Managed identities and credentials are issued, maintained, and verifiedThe topic is about issuing separate identities and verifying their credential scope.
Recommendation — Issue and verify separate credentials for build and publishing workflows.

Practitioner Guidance

What to prioritise: Separate the credential that can publish from the credential that can build, then review whether either one has broader access than its job requires. If a single identity can both execute untrusted pipeline code and release a package, treat that as a design defect rather than an optimisation.

What to verify: Confirm that publishing requires a distinct principal, short-lived access where possible, and an explicit trust gate tied to a verified build output. Also verify that revoking the CI runtime identity would not break the ability to rotate or recover publishing access, because dependency between the two is the failure mode you are trying to eliminate.

Common mistake: Teams often protect the package registry but leave the CI path overpowered. That leaves the attacker one stolen workflow secret or one poisoned runner away from converting build compromise into release compromise.

Practitioner takeaway: The question is not whether CI can reach the publisher, it is whether a compromised CI path can cross the release boundary without an additional, independently controlled trust decision.

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