security.txt Example: Location, Fields and RFC 9116
TL;DR: Put a plain text file at https://yourdomain.com/.well-known/security.txt with at least these two lines:
Contact: mailto:[email protected]
Expires: 2027-11-30T00:00:00.000Z
Contact and Expires are the only required fields. Keep Expires less than a year away and renew it. Check yours with our security.txt checker.
What is security.txt
security.txt is a small text file that tells security researchers how to report a vulnerability to you. Without it, someone who finds a bug on your site has to guess: a support form, a random email, or a social media post. Many just give up.
It's defined in RFC 9116, published in April 2022. The idea is same as robots.txt: one known place, one simple format.
security.txt location
The RFC is clear:
- The file must be at
/.well-known/security.txt. - It must be served over HTTPS.
- It must have
Content-Type: text/plain; charset=utf-8.
For older tools you can also put it, or a redirect, at /security.txt in the root. That's optional, /.well-known/ is what counts.
One file covers one host. RFC 9116 says the file applies only to the domain or IP it was fetched from, not to subdomains or parent domains. So api.example.com needs its own file, or at least a redirect.
security.txt examples
Minimal
Contact: mailto:[email protected]
Expires: 2027-11-30T00:00:00.000Z
Full example with every field
# Security contact for example.com
Contact: mailto:[email protected]
Contact: https://example.com/security/report
Expires: 2027-11-30T00:00:00.000Z
Encryption: https://example.com/pgp-key.txt
Acknowledgments: https://example.com/security/hall-of-fame
Preferred-Languages: en, de
Canonical: https://example.com/.well-known/security.txt
Policy: https://example.com/security/policy
Hiring: https://example.com/jobs/security
With a bug bounty platform
Contact: https://hackerone.com/example
Expires: 2027-11-30T00:00:00.000Z
Policy: https://hackerone.com/example?type=team
Preferred-Languages: en
The fields
RFC 9116 defines eight fields:
| Field | Required | What it's for |
|---|---|---|
Contact |
Yes, at least one | Where to report. A mailto:, tel: or https:// URI. |
Expires |
Yes, exactly once | Date after which the file should be treated as stale. |
Encryption |
No | Link to your PGP key. |
Acknowledgments |
No | Page that thanks researchers. |
Preferred-Languages |
No | Languages your team reads, comma separated. |
Canonical |
No | The URL(s) where this file officially lives. |
Policy |
No | Your disclosure policy. |
Hiring |
No | Security job openings. |
A few rules worth knowing:
- You can list
Contactmore than once. Put the preferred one first. Expiresmust appear exactly once. The RFC recommends a date less than a year in the future.- The date format is the internet date format from RFC 3339, like
2027-11-30T00:00:00.000Z. - A web URI in
Contactmust usehttps://. - Lines starting with
#are comments.
Real security.txt files (December 5, 2026)
We fetched these on December 5, 2026.
github.com:
Contact: https://hackerone.com/github
Acknowledgments: https://hackerone.com/github/hacktivity
Preferred-Languages: en
Canonical: https://github.com/.well-known/security.txt
Policy: https://bounty.github.com
Hiring: https://github.careers
Expires: 2027-01-04T07:48:20z
www.google.com (google.com redirects here):
Contact: https://g.co/vulnz
Contact: mailto:[email protected]
Encryption: https://services.google.com/corporate/publickey.txt
Acknowledgments: https://bughunters.google.com/
Policy: https://g.co/vrp
Hiring: https://g.co/SecurityPrivacyEngJobs
Expires: 2030-04-01T00:00:00z
securitytxt.org (the project's own site):
Contact: https://hackerone.com/ed
Expires: 2027-09-07T00:00:00.000Z
Acknowledgments: https://hackerone.com/ed/thanks
Preferred-Languages: en, fr, de
Canonical: https://securitytxt.org/.well-known/security.txt
Policy: https://hackerone.com/ed?type=team&view_policy=true
What they show:
- GitHub's
Expiresis about a month away. It looks like they renew it often, which is exactly what the field is for. - Google's
Expiresis more than four years out. It's valid, but it goes against the RFC's advice of less than a year. - www.cloudflare.com has a security.txt with
Contact,PolicyandCanonical, but we found noExpiresline. SinceExpiresis required, a strict checker flags it. Even big sites miss it.
Signing: optional
RFC 9116 recommends signing the file with an OpenPGP cleartext signature, but it's not required. Most sites, including all three above, don't sign.
If you want to sign it:
gpg --clearsign --output security.txt security.txt.unsigned
If you sign, add a Canonical field so nobody can copy your signed file to another site and pass it off as valid there. And re-sign every time you change the Expires date.
Serving it
Most servers already send .txt files as text/plain. Add the charset if yours doesn't. For nginx:
location = /.well-known/security.txt {
default_type text/plain;
charset utf-8;
}
For Caddy, a static file server is enough. Put the file in <webroot>/.well-known/security.txt.
On a site behind a CDN or an app framework, make sure the route isn't caught by your SPA router. A 200 that returns your homepage HTML is not a security.txt.
"security.txt file is missing"
Some scanners and pentest reports list this as a low or informational finding. It's not a vulnerability by itself. It means researchers have no published way to reach you.
The fix takes five minutes:
- Create the file with
ContactandExpires. - Upload it to
/.well-known/security.txt. - Check it's served over HTTPS as
text/plain. - Put a reminder in your calendar a month before
Expires.
If the scanner still flags it, check the response type. An HTML page or a redirect to a login page gets reported as missing.
How to check yours
curl -si https://example.com/.well-known/security.txt | head -20
Look for HTTP/2 200, content-type: text/plain, a Contact: line and an Expires: date in the future.
Or use our checker. It fetches the file, follows up to three redirects, and flags a missing or past Expires: /check/securitytxt/github.com. Swap in your domain, or use the security.txt tool page.
While you're at it, check your CAA record has an iodef contact too. It's another place a CA can reach you.
Common mistakes
- No
Expires. It's required, and easy to forget. Expiresin the past. The file is then treated as stale. Set a reminder.- Wrong path.
/security.txtalone is the legacy spot. Use/.well-known/security.txt. - HTML instead of text. SPA routers and CMS 404 pages return
200with HTML. - A
Contactnobody reads. Test the address. A bounce is worse than no file. - Only on
www. Ifexample.comserves the file butwww.example.comdoesn't, each host is checked on its own.
FAQ
Where is the security.txt location?
At https://yourdomain.com/.well-known/security.txt. The root /security.txt is only a legacy fallback.
Is security.txt required?
No law or browser requires it. But it's an RFC standard, and many scanners and bug bounty programs look for it.
What fields are required in security.txt?
Contact (at least once) and Expires (exactly once). The rest is optional.
How do I fix "security.txt file is missing"?
Create a text file with Contact and Expires, put it at /.well-known/security.txt, and serve it over HTTPS as text/plain.
Do I need to sign security.txt?
No. RFC 9116 recommends a PGP signature but doesn't require it. Most big sites don't sign.
Is your site affected? Run the free P-256 check.