security.txt (RFC 9116): example file, fields and where to publish it
Copy-ready security.txt example under RFC 9116: required Contact and Expires fields, the /.well-known path, signing, and fixing scanner warnings.
security.txt is a small plain-text file that tells researchers how to report a vulnerability to you. Publish it at https://yourdomain.com/.well-known/security.txt, served over HTTPS, with at least two fields: Contact and Expires. That is the whole requirement of RFC 9116, the 2022 specification behind the format.
If a scanner reports "security.txt not configured", it found no file at that path, or found one it could not accept. The fix usually takes ten minutes, and the main work is deciding who reads the mailbox.
A ready-to-copy security.txt example
Replace the domain, address and dates with your own. Lines starting with # are comments.
# Security contact for example.com
Contact: mailto:security@example.com
Contact: https://example.com/report-vulnerability
Expires: 2027-10-31T23:59:59.000Z
Encryption: https://example.com/pgp-key.txt
Acknowledgments: https://example.com/security/thanks
Preferred-Languages: en, uk
Canonical: https://example.com/.well-known/security.txt
Policy: https://example.com/security/disclosure-policy
Hiring: https://example.com/careers/security
Save it as UTF-8 text with the name security.txt, inside a .well-known directory at the web root. Do not copy the example dates: the Expires value above is a placeholder, and a file that expires in the past is treated as stale.
Where to publish it
RFC 9116 sets the location as /.well-known/security.txt. A file at /security.txt is allowed for legacy compatibility, or that path may redirect to the well-known one. If both exist, the well-known location wins, so keep one source of truth and redirect the other.
Three delivery rules matter in practice:
- It must be served over HTTPS. A file reachable only on plain HTTP does not meet the specification.
- The content type should be text/plain with charset utf-8, and the file itself should be UTF-8.
- Each host needs its own file if you want each covered. A file on the main site does not describe a separate domain.
The fields, one by one
Required
- Contact says how to reach you. The value must be a URI: mailto: for an email address, tel: for a phone number, and https:// for a web page (plain http is not accepted). Use several lines if you want, listed in order of preference.
- Expires is a date and time after which the file should be treated as stale. It appears exactly once. The RFC recommends setting it less than a year ahead, which forces you to revisit the file.
Optional
- Encryption links to a public key so reporters can encrypt messages. It holds a URI, never the key itself.
- Acknowledgments links to a page that credits researchers who reported valid issues.
- Preferred-Languages lists language tags, comma separated, all with equal priority. It may appear once, and English is assumed if it is absent.
- Canonical gives the official HTTPS address of the file. If the address a reader fetched is not listed, the contents should not be trusted. This is most useful together with a signature.
- Policy links to your vulnerability disclosure policy: scope, what testing is allowed, and how you treat good-faith research.
- Hiring links to your security-related job openings.
As of the registry's last update on 7 March 2026, the IANA security.txt fields registry also lists CSAF, a link to a provider-metadata.json file for the Common Security Advisory Framework, and Bug-Bounty, which indicates whether a financial reward may be offered. Field names are case-insensitive and field order does not matter, apart from the order of multiple Contact lines.
Signing the file
The RFC recommends an OpenPGP cleartext signature, ideally combined with the Canonical field. A signature lets a researcher confirm the file was not altered on the way. It is optional, but it adds a maintenance task: when the signing key or the Expires date changes, the file has to be re-signed.
The signed file keeps the same fields. The block is wrapped in the standard clear-signed markers, so a parser can still read the plain lines. You can create it with gpg --clearsign security.txt, then publish the resulting .asc content under the security.txt name.
Why scanners say "security.txt not configured"
Attack-surface and compliance scanners look for the file and flag these cases:
- Nothing exists at /.well-known/security.txt, or the server returns the site's HTML 404 page with status 200.
- The file is only on HTTP, or HTTPS redirects somewhere unexpected.
- The Expires date has passed.
- Contact is missing, or its value is not a valid URI such as mailto:, tel: or an https:// link.
- The server sends the wrong content type, such as an HTML or download header.
- Canonical lists a different address from the one the scanner fetched.
Check it by opening the URL in a browser and by running curl -i https://yourdomain.com/.well-known/security.txt. Look at the status line, the Content-Type header and the final URL after redirects. The generator on securitytxt.org builds the file and checks the format of what you enter, and third-party checkers do similar syntax tests. None of them can tell you that nobody reads the mailbox.
Common mistakes
- Letting it expire. Put the renewal date in a calendar or a CI job that fails when Expires is under 60 days away.
- Pointing Contact at an unmonitored mailbox. Use a shared alias that reaches more than one person, and test it.
- Publishing a Policy link that returns an error. Link rot undermines the point of the file.
- Putting a private key or secrets in the file. Everything in it is public by design.
- Forgetting subdomains and staging hosts. Decide which hosts matter and publish where researchers are likely to look.
security.txt and a disclosure policy
The file is a signpost, not a policy. It tells a researcher where to send a report; a vulnerability disclosure policy tells them what is in scope, what testing is acceptable, and what response to expect. Use the Policy field to connect the two.
For US federal executive-branch agencies, CISA Binding Operational Directive 20-01, issued on 2 September 2020, requires a public disclosure policy at the /vulnerability-disclosure-policy path of the agency's main .gov site. CISA's FAQ says security.txt is not required under that directive. Other organisations are not bound by it, but the same elements are a sensible template. For related federal timelines, see our explainer on CISA BOD 26-04 and KEV remediation.
Once reports arrive, you need a way to rate them. Our guides to CVSS 4.0 and the EPSS score cover severity and exploit likelihood. More security reading is under Vulnerabilities, and practical how-tos are collected in Guides.
A short publishing checklist
- Pick a monitored contact (a role address, not a person).
- Write Contact and Expires, then add Policy, Canonical and Encryption if you have them.
- Serve the file at /.well-known/security.txt over HTTPS as text/plain.
- Redirect /security.txt to it if you want legacy support.
- Sign it if you maintain a key, and add a reminder to renew it before Expires.
- Send a test report to the address and confirm someone answers.
Frequently asked questions
Is security.txt mandatory?
No. RFC 9116 is an Informational RFC, not a legal requirement, and CISA says the file is not required under BOD 20-01. Some customers, auditors and scanners do expect it.
What are the required fields in security.txt?
Contact and Expires. Contact must be present at least once, and Expires must appear exactly once. Every other field is optional.
Where does the security.txt file go?
At /.well-known/security.txt on your domain, served over HTTPS. The older /security.txt location is allowed for compatibility, but the well-known path takes priority if both exist.
How long should the Expires date be?
The RFC recommends less than a year ahead. Many teams pick six to twelve months and renew on a schedule.
Does security.txt have to be signed?
No, but an OpenPGP cleartext signature is recommended, ideally together with the Canonical field. Unsigned files are valid.