What is OIDC trusted publishing?
OIDC trusted publishing lets CircleCI publish packages to npm without storing npm auth tokens. Instead, CircleCI provides a short-lived OIDC token ($CIRCLE_OIDC_TOKEN_V2) that npm validates against a trusted publisher configuration on each package. If the token’s claims match (organization, project, pipeline, context), npm accepts the publish.
Trusted publishing vs. provenance attestation — these are different things. Trusted publishing is an
authentication mechanism (how CI proves it’s allowed to publish). Provenance attestation is a supply-chain
security feature (cryptographically linking a package to its source). npm’s
--provenance flag only works on GitHub
Actions and GitLab CI — it is not supported on CircleCI. This project uses OIDC for authentication only.When to configure
After adding a new@agent-facets/cli-* platform target. Each new package needs its own trusted publisher entry on npm before CI can publish it.
Setup steps
Seed the package on npm
Configure trusted publishing on npm for each package that was listed
agent-facets) and existing platform packages already have OIDC configured.
Where to find these values
| Value | Location |
|---|---|
| Organization ID | CircleCI org settings |
| Project ID | CircleCI project settings |
| Pipeline Definition ID | CircleCI project pipeline settings |
| Context IDs | CircleCI context settings (release context) |
| VCS Origin | GitHub repository URL (without https://) |
Platform packages
The 12 platform packages that need OIDC configuration:How it works
- The
releaseCircleCI workflow runs in thereleasecontext, which makes$CIRCLE_OIDC_TOKEN_V2available. - The release script calls
scripts/lib/ci-io.ts:mintOidcToken()to fetch a fresh OIDC token. - The token is set as
NPM_ID_TOKENin the environment. - When
npm publishruns, npm sends the token to the registry. The registry validates the token’s claims against the package’s trusted publisher configuration. - If the claims match, the publish succeeds. No long-lived npm tokens are involved.