They should be pinned by digest because a digest identifies one exact image, while latest can change without warning. Digest pinning prevents accidental upgrades, dependency drift, and tag hijacking from altering the pipeline runtime. It also makes builds repeatable and easier to investigate, since the image used in a run can be matched precisely.
Why digest pinning matters in CI/CD pipelines
Digest pinning makes the image reference immutable. A tag such as latest is only a label, so the same pipeline step can resolve to a different image later, which defeats repeatability and makes a build harder to trust or reproduce. In CI/CD, that instability is especially damaging because the pipeline itself becomes part of the software supply chain.
Using a digest also reduces the chance that a build quietly inherits new behavior from a moving tag. That matters when the pipeline image contains build tools, credentials handling logic, package managers, or scripts that affect what gets compiled, tested, signed, or published. The image should be treated as an input to the build, not as a mutable convenience shortcut.
Digest pinning is especially useful when you want to explain exactly what ran during an incident review or release audit. If a workflow fails, a digest lets you match the runtime image to a specific artifact in registry history, which is much harder when the reference is mutable. For teams building hardened pipelines, the same principle appears in the CI/CD Security Guide and the Container Image Security Guide, where image integrity and provenance are treated as core controls rather than optional hardening steps.
Digest pinning also helps separate the pipeline’s intended state from registry churn. If a mutable tag is repointed, whether accidentally or maliciously, the pipeline can start running a different image without any change in your code. A digest does not stop compromise by itself, but it removes a common ambiguity that attackers and build instability both exploit.
How digest pinning improves repeatability and investigation
Reproducible builds depend on stable inputs. When the pipeline image is pinned by digest, the same workflow definition resolves to the same image content until you deliberately change it. That makes it easier to compare two runs, isolate environment drift, and determine whether a failure came from the application, the pipeline image, or an external dependency.
This precision also improves forensic work. If a pipeline run produces an unexpected artifact, you can inspect the exact image that was used rather than guessing which revision the latest tag happened to point to at the time. That is one reason immutable references are a useful companion to build provenance practices such as SLSA, because provenance is only meaningful when the build inputs are stable enough to verify.
Digest pinning does not remove the need to update images. It does, however, make updates explicit. You promote a new digest after review, scanning, and testing, instead of inheriting change whenever the registry publisher moves a tag. For CI/CD security, that difference is the boundary between controlled change and silent change.
In practice, pinning also narrows the blast radius of upstream drift. If a base image maintainer changes packages, adds or removes utilities, or alters entrypoint behavior, a tag-based pipeline can inherit that change without warning. A digest-based pipeline only changes when your team chooses to move it, which is the safer default for build systems that must be predictable.
What can go wrong with latest tags in build systems
The latest tag creates a mutable trust problem. It may point to a newer image tomorrow, but the pipeline definition still looks unchanged. That means dependency drift can occur without review, and the build environment can diverge from what developers or release managers believe is running.
There is also a supply-chain angle. If an attacker can republish or tamper with a tag, the pipeline may fetch the wrong image while appearing to follow the expected name. That is why immutable references are commonly paired with registry controls, signing, and scanning rather than treated as a standalone defense. When teams need a broader control baseline for image handling, the NIST SP 800-190 Container Security guidance is a strong reference point for image, registry, and runtime risk.
Mutable tags are also a governance problem. If different branches, runners, or environments pull whatever latest means at that moment, two supposedly identical jobs may not actually be comparable. That makes troubleshooting slower and can hide configuration errors, package regressions, or toolchain tampering behind normal build noise.
For teams that need a concise operational rule, the safest assumption is that a tag is for human convenience and a digest is for machine trust. A pipeline should not rely on a label whose meaning can change between runs.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
SLSA, NIST SP 800-53 Rev 5 and CSA Cloud Controls Matrix set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| SLSA | Supply chain provenance and integrity | Digest pinning preserves stable build inputs needed for provenance and repeatable verification. |
| Recommendation — Pin pipeline images by digest to keep build provenance and artifact integrity verifiable. | ||
| NIST SP 800-53 Rev 5 | CM-6 — Configuration Settings | Immutable image references are a controlled configuration baseline for pipeline execution. |
| SI-7 — Software, Firmware, and Information Integrity | Digest pinning helps ensure the exact image content executed is the one intended. | |
| Recommendation — Lock pipeline image references to digests and review changes as controlled configuration updates. Verify image digests before execution to maintain software integrity in the pipeline. | ||
| ISO/IEC 27001:2022 | A.8.9 — Configuration management | Digest pinning is a configuration control that prevents silent drift in build inputs. |
| Recommendation — Manage pipeline image versions as controlled configuration items and approve changes explicitly. | ||
| CSA Cloud Controls Matrix | IAM — Identity and Access Management | Registry access and image trust depend on controlling who can republish or redirect images. |
| Recommendation — Restrict image publishing rights and monitor registry changes that could redirect pipeline pulls. | ||
Practitioner Guidance
What to verify: Confirm that every pipeline image reference resolves to a digest in the workflow definition, not just at deployment time. The important check is whether the build runner can drift to a different image without a deliberate change request.
What good looks like: Release changes to pipeline images are explicit, reviewed, and traceable. Teams can name the exact digest used for any run, and a failed build can be replayed against the same image without ambiguity.
Common mistake: Pinning to a digest once, then allowing a separate process to keep the tag as the real source of truth. If the workflow still follows latest in practice, the apparent control is cosmetic.
Practitioner takeaway: Pinning by digest turns the pipeline image into a verifiable input, while latest turns it into a moving dependency, and build systems should not depend on moving inputs unless that drift is intentionally managed.
Related resources from NHI Mgmt Group
- Why do private container images increase NHI risk in CI/CD environments?
- Why do vulnerable or unapproved container images create more risk when they are allowed through CI/CD?
- What fails when CI/CD actions are pinned by tag but not enforced before execution?
- What breaks when a CI/CD action is pinned to a compromised version tag?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on October 20, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org