Skip to main content
All posts
DevSecOps19 min read

SLSA Level 3 on GitHub Actions: Provenance to Admission

A SLSA Build Level 3 recipe for GitHub Actions: reusable workflows, artifact attestations, gh verification, admission control and the TanStack lesson.

Published Updated: 15 November 2026

Between 19:20 and 19:26 UTC on 11 May 2026, 84 malicious package versions appeared across 42 @tanstack packages on npm. Every one of them carried a valid SLSA Build Level 3 provenance attestation. The Cloud Security Alliance calls it the first documented case of malicious npm packages with valid Level 3 provenance. The attestations were not forged. They truthfully recorded that TanStack's own release workflow had built and published the packages. The attacker had got into that workflow through a fork pull request and a poisoned build cache.

That is the most useful thing to know before you start a SLSA Level 3 project: the level is a property of the build platform, and it only protects you if you also verify it and keep your release path clean. This guide is for platform leads, DevSecOps engineers and the architects and CISOs who sign off on "we are SLSA L3". It gives the concrete GitHub Actions recipe, what each step costs, and where the guarantees stop.

TL;DR / Key takeaways

  • Attestations alone are Level 2. GitHub's own documentation says artifact attestations provide SLSA Build L2. Level 3 needs the build and signing isolated in a reusable workflow, and a verifier that checks for that workflow.
  • Split build from signing. Run build steps in a job with no id-token permission and sign the digest in a separate job. TanStack's attacker read the OIDC token from the release runner's memory.
  • Verification is the control. Provenance nobody checks is decoration. Gate deployments with gh attestation verify --signer-workflow and enforce the same rule at Kubernetes admission.
  • Caches are part of the build. SLSA v1.2 says the build output must be identical with or without the cache. Release builds should not restore caches that a low-trust trigger could have written.
  • Few publishers do Level 3 today. In our sample of the 200 most-downloaded npm packages, 72 had build provenance on their latest version and only 8 were signed by a separate reusable workflow.
SLSA Build Level 3 on GitHub Actions: source and triggers, the isolated reusable workflow with separate build and attest jobs, the registry, and verification at deploy time. The warm path is the TanStack cache-poisoning route.
SLSA Build Level 3 on GitHub Actions: source and triggers, the isolated reusable workflow with separate build and attest jobs, the registry, and verification at deploy time. The warm path is the TanStack cache-poisoning route.

Download: Editable draw.io file · Open in diagrams.net · Chart data (CSV)

Why this matters now

Three things changed, and together they make Level 3 achievable without running your own signing infrastructure.

First, the specification settled. SLSA v1.2 was announced on 24 November 2025. It keeps the Build track from v1.0 and v1.1 (Levels 1 to 3) and adds a Source track with four levels, from version control up to two-party review.

Second, the tooling became a product. GitHub made artifact attestations generally available on 25 June 2024. The current action is actions/attest, at v4.2.2 since August 2026. actions/attest-build-provenance is now a wrapper around it. npm trusted publishing from GitHub Actions and GitLab CI/CD generates provenance by default for public packages built from public repositories. You no longer need to run your own keys, a Fulcio, or a Rekor.

Third, attackers learned to use the same pipelines. The 2026 npm incidents we dissected in our npm supply-chain teardown moved from stealing tokens to hijacking the release workflow itself. TanStack on 11 May and Red Hat's @redhat-cloud-services packages on 1 June both shipped malicious versions with valid provenance. Provenance cannot tell you a package is benign. It can tell you which workflow, repository, commit and runner produced it, which is exactly what you need to block an artifact that did not come from your hardened path.

What Build Level 3 actually requires

The levels are cumulative. Here is the v1.2 Build track in one table, with the wording that matters.

LevelRequirement in SLSA v1.2What it means on GitHub Actions
Build L1Provenance exists and identifies the output "by cryptographic digest"Run actions/attest after the build. Unsigned provenance would do, but GitHub signs anyway
Build L2Hosted build platform; provenance generated by the control plane and authentic (signed)GitHub-hosted runners plus artifact attestations. GitHub's documentation stops here for attestations alone
Build L3Provenance "strongly resistant to forgery by tenants"; signing secrets "MUST NOT be accessible to the environment running the user-defined build steps"; isolated, ephemeral builds; no cache poisoningBuild and signing in a reusable workflow, verified by signer identity; ephemeral runners; release jobs that do not trust shared caches

Two lines in the L3 isolation requirement deserve to be printed out. "An ephemeral build environment MUST be provisioned for each build." And, on caches, "the output of the build MUST be identical whether or not the cache is used." The specification is honest about its scope: L3 ensures a well-intentioned build runs securely, not that a producer cannot run a risky one.

The recipe, step by step

The numbers below match the callouts in the hero diagram.

① Source and trigger: decide what may start a release

A release should start from one place: a protected tag or release branch, behind repository rulesets and review. That is SLSA Source track territory (Source L3 is "continuous technical controls" on named references), and it is cheap on GitHub.

The harder part is what else runs in the same repository. TanStack's entry point was a workflow called bundle-size.yml. According to Snyk's analysis, it used the pull_request_target trigger and "checked out the fork's merge ref and executed fork-controlled code". pull_request_target runs in the context of the base repository, which is why our GitHub Actions hardening guide covers it in depth. For SLSA purposes the rule is narrower: nothing a low-trust trigger can write may reach the release build.

② Isolated build: the reusable workflow

GitHub's guidance for Level 3 is to move the build into a reusable workflow, ideally one that many repositories share. The caller can choose inputs, but cannot change the build and signing steps. The short-lived Sigstore certificate then names the reusable workflow as the signer, and the verifier can insist on it.

Three details decide whether this is real isolation or theatre:

  • Put the reusable workflow in a separate repository with few maintainers, and call it by full commit SHA. In the application repository, anyone who can push could change the build.
  • Use ephemeral runners. GitHub-hosted runners are a fresh VM per job. Self-hosted runners qualify only if ephemeral, one job each; the verifier can reject the rest with --deny-self-hosted-runners.
  • Do not restore shared caches in release builds. GitHub's caching documentation now gives low-trust triggers such as pull_request_target, issue_comment and workflow_run read-only access to the default branch's cache scope. It warns that setting a write-capable cache-mode "reintroduces the risk of cache-poisoning". In TanStack's case, the fork's code poisoned the pnpm store "under the exact cache key that release.yml would later look up", and Snyk notes that permissions: contents: read did not prevent the cache write.

③ Provenance: sign outside the build steps

Here we go one step further than GitHub's guidance, which builds and attests in the same reusable workflow; the actions/attest examples do both in one job. That job then holds id-token: write while it runs npm install, compilers and whatever your build scripts pull in. TanStack's attacker extracted the OIDC token from runner process memory during the release job and published with it.

The SLSA text is clear that signing material "MUST NOT be accessible to the environment running the user-defined build steps". On GitHub the OIDC token is that material: it is what Sigstore exchanges for the signing certificate. So split the reusable workflow into two jobs on two runners:

YAML
# my-org/build-templates/.github/workflows/oci-build.yml
on:
  workflow_call:
    inputs:
      image: { type: string, required: true }
jobs:
  build:                      # runs untrusted build steps; no id-token
    runs-on: ubuntu-latest
    permissions:
      contents: read
      packages: write
    outputs:
      digest: ${{ steps.push.outputs.digest }}
    steps:
      - uses: actions/checkout@<full-sha>
        with: { persist-credentials: false }
      - uses: docker/login-action@<full-sha>
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - id: push
        uses: docker/build-push-action@<full-sha>
        with:
          push: true
          tags: ${{ inputs.image }}:${{ github.ref_name }}
  attest:                     # signs the digest only; runs no build code
    needs: build
    runs-on: ubuntu-latest
    permissions:
      id-token: write
      attestations: write
      packages: write
    steps:
      - uses: docker/login-action@<full-sha>
        with:
          registry: ghcr.io
          username: ${{ github.actor }}
          password: ${{ secrets.GITHUB_TOKEN }}
      - uses: actions/attest@<full-sha>   # v4
        with:
          subject-name: ${{ inputs.image }}
          subject-digest: ${{ needs.build.outputs.digest }}
          push-to-registry: true

The caller in the application repository is short:

YAML
# app repo: .github/workflows/release.yml
on:
  push:
    tags: ['v*']
permissions: {}
jobs:
  release:
    permissions:
      contents: read
      packages: write
      id-token: write
      attestations: write
    uses: my-org/build-templates/.github/workflows/oci-build.yml@<full-sha>
    with:
      image: ghcr.io/my-org/app

The caller has to grant id-token: write, because a reusable workflow can only narrow the permissions it receives. The split decides which job actually gets the permission. The older slsa-github-generator (last release v2.1.0, February 2025) used the same separation. For public repositories the signature lands in the public Rekor transparency log. Private repositories use GitHub's own Sigstore instance, which has no transparency log, and need GitHub Enterprise Cloud.

Loading diagram...

④ Registry: publish the attestation with the artifact

Attestations are stored through GitHub's attestations API. For container images, push-to-registry: true also pushes the attestation to the registry next to the image, which is what an admission controller needs. Keep images addressed by digest all the way to deployment: a tag can move after you verified it.

For npm, trusted publishing does the work: provenance is generated automatically, and you can restrict the trusted publisher to one workflow file and an optional environment. Then set the package to "Require two-factor authentication and disallow tokens", so a stolen token cannot publish around your pipeline.

⑤ Verification: the step that makes it a control

GitHub's own SLSA Level 3 post puts it plainly: "Simply having attestations does not provide any security advantages if they are not verified." In CI, verify the exact identity you expect:

Bash
gh attestation verify oci://ghcr.io/my-org/app@sha256:<digest> \
  --owner my-org \
  --signer-workflow my-org/build-templates/.github/workflows/oci-build.yml \
  --source-ref refs/tags/v1.4.2 \
  --deny-self-hosted-runners

The command enforces the https://slsa.dev/provenance/v1 predicate type by default. --signer-workflow turns L2 attestations into an L3 check: an artifact signed by any other workflow, even a valid one in your organisation, fails.

At deploy time, GitHub documents the Sigstore policy-controller with a GitHub trust root: install the controller and GitHub's trust-policies chart, set policy.enabled=true and policy.organization, and label each enforced namespace policy.sigstore.dev/include=true. Nothing is enforced without that label. The default policy only checks that an image came from your organisation, so tighten the ClusterImagePolicy to the reusable workflow's identity before you call it L3. If you already run Kyverno, its ImageValidatingPolicy, stable since Kyverno 1.20.0, can check keyless Sigstore identities with the GitHub Actions OIDC issuer. We compare the policy engines in our policy-as-code guide.

What the numbers say

What each SLSA Build level costs on GitHub Actions, effort per task
What each SLSA Build level costs on GitHub Actions, effort per task

The effort grid is our assessment, not measured data. It shows why programmes stall at L2. L1 and L2 are close to free on GitHub-hosted runners. L3 is where the work is, and almost none of it is cryptography: shared build templates, untangled caches and triggers, and a verification path someone owns. Verification is the one row that is never optional.

Build provenance on the 200 most-downloaded npm packages, latest version
Build provenance on the 200 most-downloaded npm packages, latest version

To see where real publishers are, we sampled the 200 most-downloaded npm packages (packages.ecosyste.ms ranking) on 15 November 2026. For each, we fetched the latest version's attestations from the npm registry and decoded the Sigstore certificate, which records the triggered workflow (Build Config URI) and the signing workflow (Build Signer URI). When they differ, a separate reusable workflow signed: GitHub's L3 pattern. Raw rows are in the CSV.

The results: 72 of 200 latest versions (36%) had SLSA build provenance, all from GitHub-hosted runners. Only 8 were signed by a separate reusable workflow. Five of those lived in another repository, and four were pinned to a commit SHA. The other 64 were signed inside the publishing workflow itself. It is one version per package on one day, and a proxy rather than an L3 audit. Still: provenance is mainstream at the top of npm. Level 3 isolation is not.

In a recent engagement…

A European software vendor asked us to confirm its "SLSA Level 3" claim before it went into a customer questionnaire. On paper it held: GitHub-hosted runners, an attestation on every image, a central template repository.

The walk-through found three ordinary gaps. The template was called by branch name, not SHA, so any template maintainer could change every product's build at once. The release job restored the same dependency cache as the pull-request workflow, because the key was derived only from the lockfile hash. And nothing verified the attestations: the cluster pulled images by tag.

The fixes were unglamorous. We pinned the template by SHA with automated update pull requests, split signing into its own job, gave release builds their own cache key, and put gh attestation verify --signer-workflow in the deployment pipeline. Admission enforcement then went on one namespace at a time. The first one caught images that had been built by hand during an earlier incident and never rebuilt. That ended the debate about whether provenance was just a compliance artefact.

The Level 3 checklist

#ControlHow on GitHub (Nov 2026)SLSA requirement it servesVerify with
1Protected release triggerTag or branch rulesets, required reviewSource track L3Ruleset audit
2No low-trust writes into release inputsNo pull_request_target checkout of fork code; no write-capable cache-mode for low-trust triggersBuild L3 isolation, cache poisoningWorkflow linting in CI
3Reusable build workflow, separate repoCalled by full commit SHA; small maintainer groupBuild L3 isolation--signer-workflow, --signer-repo
4Ephemeral runnersGitHub-hosted, or ephemeral self-hosted (one job each)Build L3 ephemeral environment--deny-self-hosted-runners
5Signing split from build stepsBuild job without id-token; attest job signs the digest onlyBuild L3 signing secrets out of reachWorkflow review
6Provenance published with artifactactions/attest@v4, push-to-registry: true; npm trusted publishingBuild L1–L2 provenance distributiongh attestation verify
7Tokens disallowed for publishingnpm "require 2FA and disallow tokens"; no registry tokens in secretsPrevents bypassing the attested pathPackage settings audit
8Deploy gategh attestation verify with signer workflow and source refConsumer verificationPipeline logs
9Admission enforcementSigstore policy-controller or Kyverno ImageValidatingPolicy, per namespaceConsumer verificationRejected-admission events

If you only have time for three, do 3, 5 and 8. They are the difference between "we have attestations" and "an artifact from any other pipeline cannot reach production".

Governance for European enterprises

No EU regulation names SLSA. It is, however, an efficient way to produce evidence for obligations that do apply.

Cyber Resilience Act. Regulation (EU) 2024/2847 applies in full from 11 December 2027. It requires manufacturers to exercise due diligence when integrating third-party components (Article 13(5)) and to identify and document components in a software bill of materials (Annex I, Part II). Its Article 14 reporting obligations have applied since 11 September 2026. Provenance does not replace an SBOM, but it answers an incident handler's first question: did our pipeline build this release, from which commit? If a compromised build ever forces a 24-hour early warning, our CRA reporting runbook covers that clock.

NIS2. Article 21(2) of Directive (EU) 2022/2555 lists supply-chain security (point d) and security in the acquisition, development and maintenance of systems (point e) among the minimum measures for essential and important entities. A documented L3 build path with enforced verification is a proportionate, auditable measure for both. Our NIS2 supply-chain guide covers the supplier side.

One practical detail: your verifiers deal with two trust roots, Sigstore public-good for open-source dependencies and GitHub's private instance for your own private builds. If you only deploy your own private builds, gh attestation verify --no-public-good makes that explicit.

A pragmatic adoption path

  1. Week 1: attest everything (L2). Add actions/attest to every release workflow on GitHub-hosted runners and move npm packages to trusted publishing. It is cheap and inventories what you ship.
  2. Week 2: verify in log-only mode. Run gh attestation verify --owner in every deployment pipeline and record failures without blocking. The failures are your shadow builds.
  3. Weeks 3–5: build the template. Create a separate build-templates repository: one reusable workflow per artifact type, split build and attest jobs, no shared cache restores, actions pinned by SHA. Migrate critical services first.
  4. Week 6: tighten verification to L3. Switch the pipeline check to --signer-workflow and --source-ref, and turn on blocking. Disallow publishing tokens on npm packages.
  5. Month 2–3: enforce at admission. Install the Sigstore policy-controller or a Kyverno ImageValidatingPolicy, scope it to your signer workflow, and label namespaces one at a time, starting with a low-risk one. Keep an audited break-glass path, and alert on every use of it.

The verdict

SLSA Level 3 on GitHub Actions is no longer a research project. The platform gives you ephemeral runners, keyless signing and a verifier in the CLI. It cannot give you the discipline around them: a build template nobody can quietly change, release jobs that trust nothing a fork touched, and a deployment path that refuses everything else.

TanStack is the case to remember: its provenance was valid, and that was the problem. Treat attestations as an identity check, not a safety certificate. Split signing from build steps, keep caches out of release builds, and verify the signer workflow everywhere you deploy. Then a hijacked pull-request workflow produces an artifact your clusters reject.

If you want a second pair of eyes on your build path, our DevSecOps team runs a fixed-scope SLSA review. You leave with the checklist above filled in for your own pipelines and a migration plan for the gaps.

FAQ

What does SLSA Build Level 3 require?

In SLSA v1.2, Build Level 3 adds two things to Level 2's hosted build and signed provenance. Provenance must be unforgeable: the signing secret must not be accessible to the environment running the user-defined build steps. And builds must be isolated: an ephemeral environment per build, no influence between concurrent builds, no access to platform secrets, and no cache poisoning. It describes the build platform, not whether your code is safe.

Do GitHub artifact attestations give us SLSA Level 3 out of the box?

No. GitHub's documentation says artifact attestations by themselves provide SLSA Build Level 2. To reach Level 3, GitHub recommends running the build in a reusable workflow, ideally one shared across repositories, so the build and signing are isolated from the calling workflow, and then verifying that the attestation was signed by that specific workflow.

How do we verify SLSA provenance before deploying?

Use gh attestation verify in the pipeline with --owner or --repo plus --signer-workflow, so only attestations signed by your reusable build workflow pass. Add --source-ref to pin the tag or branch and --deny-self-hosted-runners if you only trust GitHub-hosted runners. In Kubernetes, enforce the same rule at admission with the Sigstore policy-controller or a Kyverno ImageValidatingPolicy.

If TanStack had valid SLSA Level 3 provenance, what is the point?

Provenance proves where and how an artifact was built. In May 2026 an attacker poisoned the GitHub Actions cache from a fork pull request and took the OIDC token from TanStack's own release job, so the provenance truthfully named the real pipeline. The lesson is to verify provenance and also isolate release builds: no shared caches with low-trust triggers, no id-token permission in jobs that run build steps.

Do artifact attestations work for private repositories?

Yes, but only on GitHub Enterprise Cloud. Free, Pro and Team plans support artifact attestations for public repositories only. Public repositories sign through the Sigstore public-good instance and write to the public Rekor transparency log. Private repositories use GitHub's own Sigstore instance, which has no transparency log.

Is SLSA required by the Cyber Resilience Act or NIS2?

Neither names SLSA. The CRA requires manufacturers to exercise due diligence on integrated components and to document them in an SBOM, and NIS2 Article 21 requires supply-chain security and secure development measures. Signed, verified build provenance is strong evidence for both, and it shortens incident response because you can prove which pipeline built which artifact.

Sources

All sources checked on 15 November 2026.

Tier A: primary, specification and regulatory

Tier B: research and our own data

Tier C: vendor, directional

Topics

SLSA level 3SLSA build level 3 GitHub ActionsGitHub artifact attestationsbuild provenanceactions/attestgh attestation verifySigstore policy-controllersoftware supply chain security

Frequently Asked Questions

In SLSA v1.2, Build Level 3 adds two things to Level 2's hosted build and signed provenance. Provenance must be unforgeable: the signing secret must not be accessible to the environment running the user-defined build steps. And builds must be isolated: an ephemeral environment per build, no influence between concurrent builds, no access to platform secrets, and no cache poisoning. It describes the build platform, not whether your code is safe.

Expert engagement

Need expert guidance?

Our team specializes in cloud architecture, security, AI platforms, and DevSecOps. Let's discuss how we can help your organization.

Get in touchNo commitment · No sales pressure

Related articles

All posts