Safeguard
Supply Chain•

Why should you sign and verify the image digest, not the tag?

Tags can be moved, digests cannot. Signing and verifying by digest ties trust to exact bytes. Why it matters and how to pin it in your pipeline.

Safeguard Security Team
3 min read

Sign and verify the digest because a tag is a movable label, while a digest is a hash of the exact content. A signature tied to a tag name proves little once the tag points somewhere else. A signature tied to a digest stays attached to those exact bytes.

Tag versus digest

Docker's documentation on digests puts it plainly: tags can be reused or changed, while a digest is a SHA-256 hash of the image content, so any change to the image produces a different digest. That is the property a signature needs.

TagDigest
Example formname:1.4name@sha256 followed by the hash
Can it point to new content later?YesNo
Safe as a trust anchor?NoYes
Good for humans to read?YesNo

Multi platform images add a detail. A tag usually points to a manifest list, which references a separate digest for each platform. The manifest list digest identifies the whole multi platform image. To pin one platform, use that platform's digest.

What cosign does with the digest

The cosign documentation says signature payloads include the image digest and that, by default, cosign checks that the digest matches the container during verification. Its container signing examples set the image variable to a digest reference. Signatures are stored in the registry using the OCI 1.1 referrer specification, and the cosign tree command shows what is attached to an image.

The docs I reviewed did not include an explicit warning about signing by tag, so treat this as good practice backed by how digests work rather than a quoted rule.

A safe routine

  1. In CI, build and push, then capture the digest from the push result.
  2. Sign the digest reference, not the tag.
  3. Record the digest in your deployment manifest.
  4. At deploy time, verify the signature and the expected identity against that same digest.
  5. Reject manifests that reference a bare tag in production.

A short example of the shape, in a shell:

IMAGE=registry.example.com/app@sha256:<digest>
cosign sign "$IMAGE"
cosign verify "$IMAGE" \
  --certificate-identity=name@example.com \
  --certificate-oidc-issuer=https://accounts.example.com

The failure this prevents

Imagine you verify a tag at 9am and deploy at 10am. If the tag moved in between, you deployed something you never checked. Verifying and deploying the same digest closes that gap, because both steps refer to bytes rather than a name.

Where Safeguard fits

Safeguard can scan container images for vulnerabilities, and policy gates can stop a release that fails your rules. Try the demo below or run the free scan.

Try it yourself

Click through it at your own pace, or open it full screen.

Scan an image in the demo and notice that findings attach to a specific image build, which is the same idea as pinning a digest.

Quick check

Is it enough to verify a signature on latest?

No. The tag can move after you check it. Resolve to a digest, verify that, and deploy that same digest.

Do I need a digest per platform?

If you must pin one platform, yes. The manifest list digest identifies the full multi platform image, and each platform has its own digest.

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.