security.txt generator and validator for RFC 9116
This tool writes a security.txt file that follows RFC 9116, with the required Contact and Expires fields and the optional ones, and warns when Expires is more than a year ahead. Switch to check mode to paste an existing file, signed or not, and see which rule it breaks.
Updated
Expires
2027-10-10
2 contacts, 5 lines in all
security.txt
# Security contact for the site that serves this file. # Generated 2026-11-14. Regenerate before the Expires date. Contact: mailto:security@example.com Contact: https://example.com/security/report Expires: 2027-10-10T06:15:27.000Z Preferred-Languages: en Canonical: https://example.com/.well-known/security.txt
- Where to host it
- /.well-known/security.txtHTTPS only, text/plain; charset=utf-8
- Fields written
- Contact, Expires, Preferred-Languages, Canonical
- Host the file at https://your-domain/.well-known/security.txt over HTTPS with Content-Type text/plain; charset=utf-8. A copy or redirect at /security.txt is allowed for old tools, and the /.well-known/ one wins if both exist.
- Signing is recommended: gpg --clearsign security.txt writes an OpenPGP cleartext signature, and the Canonical field lets readers confirm which URL the signed file belongs to. Paste a signed file into the check mode to see it is read correctly.
- Expiry is 2027-10-10. Put a reminder around 2027-09-10 to regenerate the file.
Code Audit: from ₹90,000 / $950
A security.txt tells researchers where to send what they find. Our code audit includes a dependency and security review, so you can find those issues first. It is not a penetration test.
What goes in a security.txt file?
security.txt (RFC 9116) is a small text file that tells security researchers how to report a vulnerability to you. Each line is a field name, a colon and a value; lines starting with # are comments, and field names are case-insensitive. Two fields are required. Contact says where to report (a mailto:, tel: or https:// URI, listed in order of preference, repeatable), and Expires says when the file stops being trustworthy, as an RFC 3339 date-time, exactly once.
The rest are optional: Encryption (a URL to your public key, never the key itself), Acknowledgments (a thank-you page), Preferred-Languages (RFC 5646 tags, once), Canonical (where this copy lives), Policy (your disclosure policy) and Hiring (security jobs). Web URIs in any field must use https. Readers must ignore fields they don't know, so a typo in a name isn't an error, just a field nobody reads. RFC 9116 recommends an Expires less than a year ahead, which this tool warns about.
The file goes at /.well-known/security.txt on the host, over HTTPS, as text/plain with the utf-8 charset. A /security.txt copy is allowed for older tooling. The RFC recommends signing it with an OpenPGP cleartext signature; the check mode strips that wrapper and validates the text inside.
Contact: mailto:security@example.com Expires: 2027-06-30T18:37:07.000Z Preferred-Languages: en, hi Canonical: https://example.com/.well-known/security.txt
Which security.txt fields are required, and how many times can each appear?
| Field | Required | Repeatable | Value |
|---|---|---|---|
| Contact | Yes | Yes | mailto:, tel: or https:// URI, most preferred first |
| Expires | Yes | No, exactly once | RFC 3339 date-time; recommended less than a year ahead |
| Encryption | No | Yes | https:// URL to the key; keys must not appear in the field |
| Acknowledgments | No | Yes | https:// URL |
| Preferred-Languages | No | No, at most once | Comma-separated RFC 5646 tags, at least one |
| Canonical | No | Yes | https:// URL of this file; each applies to its own location only |
| Policy | No | Yes | https:// URL |
| Hiring | No | Yes | https:// URL |
How to publish a security.txt file
- 1Enter a contact and an expiryGive at least one reporting address. Emails become mailto:, phones become tel:, web pages must be https. Choose how many days ahead the file should expire, under a year.
- 2Add the optional fields you can keep upAdd a key URL, disclosure policy, languages and your canonical URL. Only add what you maintain; an empty promise is worse than no field.
- 3Upload it and check the headersSave it as /.well-known/security.txt on every host you want covered, then run curl -I on it and confirm HTTP 200 and Content-Type text/plain; charset=utf-8.
- 4Calendar the renewalSet a reminder 30 days before Expires. Paste the live file into check mode to confirm it still passes.
Frequently asked questions
Does security.txt have to expire?
Can I put my PGP key in the Encryption field?
Where do I host security.txt, and does /security.txt still work?
Should I sign my security.txt with PGP?
Is a bare email address allowed in Contact?
What happens to unknown fields in a security.txt file?
Sources
- RFC 9116: A File Format to Aid in Security Vulnerability Disclosure (IETF) (checked 11 Nov 2026)
- RFC 3339: Date and Time on the Internet: Timestamps (Expires format) (checked 11 Nov 2026)
- RFC 5646: Tags for Identifying Languages (Preferred-Languages) (checked 11 Nov 2026)
Need a custom dev tool for your team?
We build internal tools, dashboards, APIs, and SaaS platforms. If you can describe it, we can ship it.
Built by CountryDevs · No signup · No ads · We count visits, never what you enter