Safeguard
Security Guides•

Should you sign your security.txt file, and what is Canonical?

RFC 9116 recommends signing security.txt with an OpenPGP cleartext signature and adding a Canonical field. What each does and how to set them up.

Safeguard Security Team
3 min read

Signing is recommended, not required. RFC 9116 recommends that security.txt be digitally signed with an OpenPGP cleartext signature, and that a signed file include the Canonical field. A signature lets a researcher confirm the contact details came from you and were not tampered with.

Definitions

A cleartext signature keeps the file readable as plain text and appends a signature block that a tool can verify. The Canonical field gives the URI where the file is meant to live. With a signature, it lets a reader confirm the file is being served from the location its author intended.

Keep Canonical identical to the address where you actually serve the file.

Why bother

A security.txt file tells strangers where to send vulnerability reports. If an attacker could alter it, reports might go to the wrong place. HTTPS already protects the transfer. A signature adds protection that survives copying, caching or mirroring.

For a small team the cost is low. For a buyer reviewing your security page, a signed file with a valid date is a quiet sign of care.

What the RFC says in brief

TopicStatement
SigningRecommended, using an OpenPGP cleartext signature
CanonicalOptional field holding the file's own URI
EncryptionOptional URI pointing to a key; keys must not appear inline
LocationUnder /.well-known/, served over https as text/plain with UTF-8
ExpiresRequired, and recommended to be under a year ahead

Steps to sign

  1. Create or choose an OpenPGP key controlled by your security team, not one person's personal key.
  2. Write the file with Contact, Expires and Canonical, plus Policy and Encryption if you have them.
  3. Produce a cleartext signature over the whole file.
  4. Publish it at /.well-known/security.txt over https.
  5. Fetch the live file from outside your network and verify the signature.
  6. Put key rotation and Expires renewal on one shared calendar. See what Expires means.

Pitfalls

  • Editing the file after signing, which breaks verification.
  • Letting the signing key expire before the file does.
  • Putting the public key inline. The RFC says keys must not appear inline, so link to it with Encryption instead.
  • Leaving a different copy at the top level path. The RFC says the /.well-known/ copy takes precedence if both exist, so keep them identical or redirect.

Quick check

Is signing mandatory?

No. It is recommended. Only Contact and Expires are mandatory.

What does Canonical do?

It states the URI where the file is located, so that with a signature a reader can confirm the file is where its author put it.

Safeguard's SBOM and dependency scanning help teams keep track of what they ship and where it came from. Try the free scan at gold.safeguard.sh/scan.

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.