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
Whenever a new public@agent-facets/* package is added to the monorepo. Each new package needs its own trusted publisher entry on npm before CI can publish it. There are two seed scripts depending on the kind of package:
| Seed script | Scope |
|---|---|
bun seed:cli | The 12 CLI platform packages (@agent-facets/cli-*) |
bun seed:adapters | Library/adapter packages (@agent-facets/adapter, adapter-*) |
Setup steps
Seed the package on npm
Configure trusted publishing on npm for each package that was listed
agent-facets), existing platform packages, and the library packages that are already on npm all 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 (bot-context context) |
| VCS Origin | GitHub repository URL (without https://) |
Platform packages
The 12 platform packages that need OIDC configuration:How it works
- Each publish script calls
mintNpmToken()which runscircleci run oidc getto fetch a fresh OIDC JWT and sets it asNPM_ID_TOKEN. - When
npm publishruns, npm exchanges the token with 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.
latest dist-tag. Platform binaries are published first via a matrix workflow (one per executor), verified on the registry, then the CLI package publishes last. This ordering ensures users never see a partial release — the CLI package (agent-facets) is the entry point, and it only appears on latest after all its platform dependencies are confirmed available.
npm’s OIDC trusted publishing only supports
npm publish. Other operations like npm dist-tag add cannot
authenticate via OIDC (npm/cli#8547). This is why we publish directly to
latest instead of publishing to a staging tag and promoting — the promote step would require a static npm token.