Safeguard
Supply Chain•

How do you verify a signed git tag before you build from it?

Run git tag with the verify option against a trusted public key. A good signature shows who tagged the commit, not that the code is safe to run.

Safeguard Security Team
3 min read

Import the maintainer's public key from a source you trust, then run git tag -v with the tag name. Git checks the tag signature and prints the result. A good signature shows that the key holder created that tag. It does not show the code is free of flaws.

Steps

  1. Get the key from more than one place. Look for a fingerprint on the project's website, in its repository, and in any release notes. If they all match, you have more confidence than from a single copy.
  2. Import the key into your keyring using the tool matching the signing format the project uses.
  3. Fetch the tags. Run git fetch with the tags option in your clone.
  4. Verify.
git tag -v v2.4.0

The git manual describes the verify option as checking the cryptographic signature of the given tags. Read the output: it should name the signer and state the signature is good.

  1. Check out the tagged commit and build from that, not from a branch tip.

What the result can say

OutputWhat it meansWhat to do
Good signature, key you recogniseTag was created by that keyContinue, keep other checks
Good signature, key you never verifiedSigned by some key, trust unknownVerify the fingerprint first
Bad signatureTag object does not match its signatureStop and ask the maintainers
No signature foundTag is unsigned or lightweightUse another check, such as published checksums

The trust question is the hard part

A signature check answers "was this signed by that key?" You still have to decide whether that key belongs to the people you think it does. That is why step 1 matters. If the only place you found the fingerprint is the same repository an attacker could have altered, it adds little.

Also remember that a tag can be signed while the commit it points at contains a bad change made by a legitimate but compromised account. Signing records who tagged. It cannot read the code for you.

Combine with other checks

  • Compare your clone's tagged commit hash with the one in the project's release notes.
  • Verify published checksums or signatures on the built files, not only the tag.
  • Scan the dependencies of the tagged commit before you deploy.

Safeguard dependency scanning can help with the last item, and the free scan is at gold.safeguard.sh/scan.

Try it yourself

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

Click into a component and note how many dependencies a tagged release pulls in that a signature on the tag says nothing about.

Quick check

The tag verifies, so is the release safe?

Not necessarily. It shows the tag came from the key holder. The code can still contain bugs or a malicious change from a compromised account.

What if the project does not sign tags?

Look for signed or checksummed release files, or build provenance. If there is nothing, treat the source as unverified and review accordingly.

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.