Safeguard
Supply Chain•

Can you publish npm packages with provenance from self-hosted runners?

npm provenance and trusted publishing need cloud-hosted runners on supported CI providers. What the npm docs say, and what to do if you self-host.

Safeguard Security Team
4 min read

According to the npm docs I read on 19 October 2026, publishing with provenance requires a supported cloud CI/CD provider and a cloud-hosted runner, and trusted publishing says self-hosted runners are not currently supported but are planned. If your release job runs on your own runners, check the live docs before you plan around either feature.

What the docs state

Two npm pages are relevant.

The provenance page says that to publish a package with provenance you must build with a supported cloud CI/CD provider using a cloud-hosted runner, and names GitHub Actions and GitLab CI/CD. It also requires npm CLI 9.5.0 or later and a package.json repository field that matches, case-sensitively, where you publish from.

The trusted publishing page lists the supported environments: GitHub Actions on GitHub-hosted runners, GitLab CI/CD on GitLab.com shared runners, and CircleCI cloud. It says self-hosted runners are not currently supported but are planned. It also requires npm CLI 11.5.1 or later and Node 22.14.0 or higher.

FeatureSupported today per docsSelf-hosted runners
Provenance with the provenance flagGitHub Actions, GitLab CI/CD, cloud-hosted runnersNot supported
Trusted publishing (OIDC, no long-lived token)GitHub-hosted, GitLab.com shared, CircleCI cloudNot currently supported, planned

Pages change. These facts are dated, so confirm them before you rely on them.

Why the restriction exists

Provenance rests on an identity the build system proves to Sigstore through an OIDC token. A cloud-hosted runner gives a verifiable statement about the environment. A machine you run yourself is harder for an outside party to vouch for. Our post on who you trust when you verify SLSA provenance explains that trust question in general.

Options if you self-host

  1. Split the pipeline. Build and test on your own runners, and run the publish step as a separate job on a supported cloud-hosted runner. Be careful that the artifact you hand over is the one you tested, for example by publishing from the tagged commit and rebuilding there.
  2. Keep token publishing, harden it. Use a granular, short-lived token, restrict it to one package, and keep it in a protected environment. See which npm token settings for a CI publish job.
  3. Wait and watch. The docs say self-hosted support is planned. Build your workflow so switching is a small change.
  4. Add your own record. Generate and archive your own SBOM and build record per release, even without npm's attestation. See archiving SBOMs and provenance for every release.

What not to do

Do not copy an attestation or fake the repository field to make a badge appear. A provenance statement that claims a build it did not describe is worse than none. And do not read the absence of provenance as proof of compromise: many safe packages do not publish with it.

For consumers

If you consume packages, you can check what is available with the audit signatures command, which verifies registry signatures and attestations for packages that have them. If you adopt a pnpm trust policy, remember it only fails on a decrease in trust evidence, as covered in pnpm trustPolicy.

Where Safeguard fits

Safeguard's SBOM and dependency scanning, and compliance and evidence automation, help you keep per-release component records that you can show a customer, whatever your CI setup. A free scan is at https://gold.safeguard.sh/scan.

Quick check

Do I need provenance to use trusted publishing?

No. They are related. The npm docs note that trusted publishing generates provenance attestations automatically without the provenance flag, and it removes the need for long-lived tokens.

Is the self-hosted limitation permanent?

The docs say self-hosted runners are not currently supported but are planned. Check the live page before deciding.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.