security.txt Example: Location, Fields and RFC 9116

, by xura.tools team

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:

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:

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:

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:

  1. Create the file with Contact and Expires.
  2. Upload it to /.well-known/security.txt.
  3. Check it's served over HTTPS as text/plain.
  4. 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

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.