GitHub Artifact Attestations: Verify Build Provenance Before Release

A checksum can show that a downloaded file matches a known digest, but it does not explain who built the file or from which source. An artifact attestation links a subject digest to signed provenance claims about a build. GitHub Actions can create attestations for artifacts, and GitHub CLI can verify them. Verification is useful only when the consumer checks the identity and claims it expects; a valid signature from an untrusted repository is still not proof that the artifact is approved.

The practical goal is to bind a release artifact to a trusted repository, workflow, source revision, and build process, then verify that binding before publishing or deploying it. Attestation complements code review, dependency controls, and reproducible build practices. It does not prove that source code is benign, that the builder was uncompromised, or that every dependency is safe.

Define what provenance must prove

Before enabling generation, write down the release policy. For example: accept only artifacts produced by the release.yml workflow in the canonical repository, from a protected release tag or reviewed commit, with an approved build environment and a digest matching the file being deployed. Decide whether forks, pull request workflows, manual dispatches, and reusable workflows can produce releasable artifacts. The verifier must check these claims rather than simply accepting any attestation.

GitHub documentation describes permissions needed for attestation creation, including attestations: write and id-token: write in the relevant workflow. Grant those permissions at the narrowest job that needs them. Avoid broad write permissions at workflow scope. Pin third-party actions to a full commit SHA, protect release branches and tags, and restrict who can change the workflow that issues release artifacts. A provenance system cannot compensate for a workflow that an attacker can freely edit.

Generate an attestation with a controlled workflow

Build the artifact in a named job, compute or retain its digest, and run the official attestation action against the exact file. Keep build and publish steps connected so the attested file is the one uploaded and released; do not rebuild a second artifact after attestation and assume its provenance carries over. Store the artifact immutably with the release and preserve the run identifier, source commit, and digest in release records.

Scope the permissions to the relevant job. Use a supported action release pinned by immutable SHA, and review the action's inputs and outputs before adoption. Treat the provenance statement as a claim from the build platform: protect runner images, toolchains, dependencies, secrets, and workflow definitions. For self-hosted runners, isolate jobs and avoid sharing persistent credentials across untrusted pull requests and release builds.

Verify the artifact at the point of use

For a binary from a known release, GitHub documents a command shaped like:

gh attestation verify ./release.tar.gz -R OWNER/REPOSITORY

Use the real repository and artifact path, then inspect the verified predicate and identity claims required by your policy. For container images, verify the image reference in its registry rather than a local tag alone. Use a digest-pinned image reference in deployment configuration so a mutable tag cannot silently point to a different artifact after verification.

A successful cryptographic check means the attestation chain validates according to the verifier's trust material. It does not automatically mean the workflow identity is authorized for production. Add explicit policy checks for repository, workflow path, source ref or commit, signer identity, and expected artifact digest. If offline verification is required, manage trusted root material and revocation or rotation procedures using the documented offline verification process.

Test the verifier with both accepted and rejected cases: correct artifact and repository, artifact modified by one byte, valid attestation from an unexpected repository, an untrusted workflow identity, a wrong source revision, and an artifact with no attestation. The deployment must fail closed for the cases your release policy marks as mandatory. Store verification results with the release or deployment record, but avoid retaining unnecessary tokens or private build logs.

Avoid common provenance mistakes

Do not verify only the repository name and ignore the workflow identity. Do not accept an attestation just because GitHub signed it. Do not build from an unreviewed branch and then treat provenance as a code review substitute. Do not use a tag as a unique artifact identity when tags can be moved. Do not skip verification on emergency releases; define a documented break-glass path with approval, a time limit, and follow-up evidence instead.

SLSA provenance provides a vocabulary for describing build provenance and levels of assurance. The specific guarantees depend on the builder and implementation. Compare the claims your workflow emits with the threat model you are trying to address. If the artifact can be rebuilt from different source or dependencies, capture those inputs and improve repeatability rather than overstating what the attestation proves.

Roll out across the supply chain

Start with one non-critical release and record generation and verification behavior. Add enforcement to a staging deployment, then production after the organization can investigate failures. Inventory consumers that download artifacts outside the main deployment pipeline, such as support engineers, package consumers, and disaster-recovery processes. Provide the verification command and trusted repository identity alongside each release.

Monitor failed verification by reason and alert on unexpected signer or workflow changes. Rotate actions and runner images through normal review. Revisit the policy when repository ownership, workflow structure, or hosting changes. A policy that pins a workflow path which has moved may fail safely, but it still needs a clear maintenance owner.

Safe-testing and maintenance note

Verify only artifacts and repositories you are authorized to access. Do not publish a test signing key or grant release permissions to untrusted workflows. Version-specific action and CLI syntax can change, so confirm the official documentation used by your deployed versions. Last updated: 2026-11-09. Change log: Initial publication; verification example checked against GitHub documentation.

References