Safeguard
Supply Chain•

Hermetic vs reproducible builds: what is the difference?

Hermetic means isolated from the host machine; reproducible means identical output bits. See how the two relate and which one to work on first.

Safeguard Security Team
3 min read

A hermetic build is isolated from the machine it runs on, so the same inputs give the same result. A reproducible build produces bit for bit identical output when rebuilt. Hermeticity is about the process, reproducibility is about the artifact, and the first usually has to come before the second.

Two words, two different promises

People swap these terms constantly, which causes real planning mistakes. Here is the short version.

Hermetic buildReproducible build
Core ideaIsolation from host tools and stateSame output bits every time
What you checkDoes it depend on anything undeclared?Do two builds hash the same?
Typical blockerHost compilers, absolute paths, network fetchesTimestamps, build IDs, file ordering
Main payoffTrustworthy caching, clear input listIndependent verification of an artifact

Bazel's documentation defines a hermetic build as one that returns the same output for the same source and configuration by isolating the build from changes to the host system. Its troubleshooting advice includes a hash comparison: if you run steps twice or on different systems and the content hashes differ, the build is not reproducible.

Why you can be hermetic without being reproducible

Isolation controls what the build can see. It does not control what the tools write. A compiler may embed a timestamp or a random identifier, and an archive tool may order files differently on each run. The build still used only declared inputs, so it is hermetic, but two outputs hash differently.

The reverse also happens. A build can look reproducible on one machine because the host is stable, while quietly depending on a system compiler. Move it to a new host and the bits change.

Which one to chase first

For most teams, work in this order:

  1. Pin the inputs: tools, dependencies, base images, with checksums.
  2. Remove host leakage: use declared toolchains and a clean build environment.
  3. Hunt non-determinism: timestamps, ordering, embedded paths.
  4. Only then compare hashes across independent builders.

Step 4 is where reproducibility pays off for security, because a second party can rebuild and confirm the artifact matches what you shipped. Steps 1 and 2 pay off sooner, because they make shared build caches safe to trust.

What neither one proves

Neither property says the code is free of vulnerabilities. A reproducible build of a vulnerable library is still vulnerable. Treat both as ways to make the question "what exactly is in this artifact?" answerable, then pair them with dependency scanning and advisory monitoring.

Where Safeguard fits

Safeguard can inventory the dependencies your repository declares through SBOM and dependency scanning, and reachability analysis helps you decide which findings matter first. You can try a free scan on a repository to see what it finds. Check coverage for your specific build files before relying on it.

Quick check

Can a hermetic build still produce different output each time?

Yes, if a tool embeds timestamps or random identifiers. Isolation fixes what the build reads, not what the tools write.

Do I need reproducible builds to use a remote cache safely?

You need the build to be deterministic enough that a cached output is correct for the same inputs. The Bazel documentation says outputs from one machine can be safely reused on another if the build is reproducible.

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.