security.txt: what it is and how to add one to your site
Last updated
The short answer
security.txt is a small text file at yoursite.com/.well-known/security.txt that tells anyone who finds a security problem on your site how to report it to you. It must have two lines: Contact: (how to reach you) and Expires: (when the file should be checked again, ideally less than a year ahead). It is defined in RFC 9116, takes a few lines, and costs nothing.
Why a small business should have one
- Problems reach you, not a public forum. Researchers who spot a flaw, such as an exposed admin page or a leaking form, look for security.txt first. Without it they may give up, or post about it publicly.
- It shows you take security seriously, to customers, partners and the scanners they use.
- It costs nothing and needs no software.
A template to copy
Replace the address and the dates, and save it as plain text named exactly security.txt:
Contact: mailto:security@yoursite.com
Expires: 2027-10-21T00:00:00.000Z
Preferred-Languages: en
Canonical: https://yoursite.com/.well-known/security.txtEvery line, explained
| Line | Required? | What it says |
|---|---|---|
Contact: | Yes | How to report a problem: mailto: an address, a tel: number or an https link to a form. You can list more than one, most preferred first. |
Expires: | Yes, once | The date after which the file is out of date. RFC 9116 recommends less than a year ahead. |
Preferred-Languages: | No | Languages you can read reports in, such as en. English is assumed without it. |
Canonical: | No | The file's own address, so a copy found elsewhere can be checked. |
Policy: | No | A link to a page explaining how you handle reports. |
Encryption: | No | A link to a key people can use to send you encrypted reports. |
Acknowledgments: | No | A link to a page thanking people who reported problems. |
Any web link in these lines must start with https://. The standard also recommends signing the file with an OpenPGP signature; that is optional for most small businesses.
Where it goes, and how to add it
- Put the file in a folder named
.well-knownat the top of your site, so it loads athttps://yoursite.com/.well-known/security.txt. On WordPress and most hosting, create the folder with your host's file manager or FTP, next to your homepage files. - It must load over https, as plain text (
text/plain, UTF-8). A copy atyoursite.com/security.txtis allowed for older tools, but the.well-knownone is the one that counts. - Open the address in a browser and check the text appears, not a "page not found" page.
- Hosted builders may not let you create files in
.well-known; check your platform's help.
It sits alongside your other security settings: see the security headers guide.
Common mistakes
- No Expires line, or a date that has already passed.
- An address nobody reads, or one tied to a person who has left.
- The file served as a web page (HTML) or behind a redirect to your homepage.
- Links starting with http:// instead of https://.
Checklist
- security.txt loads at https://yoursite.com/.well-known/security.txt as plain text.
- It has a Contact line that someone reads.
- It has one Expires line, less than a year ahead, with a reminder to update it.
- Any links in it start with https://.
Questions people ask
- Is security.txt required?
- No law requires it, but it is a published standard (RFC 9116), widely used, and security scanners, including ours, look for it. It takes one small file.
- Will security.txt attract hackers?
- It publishes a contact, nothing about your systems. Use a monitored role address, such as security@yoursite.com, rather than a personal one.
- Which email address should I use?
- One that someone checks and that keeps working when staff change, such as security@ forwarding to the owner and whoever runs the site. A contact form address works too.
- What happens when the Expires date passes?
- The file should be treated as out of date, so readers may not trust the contact details. Put a reminder in your calendar to update the date before it arrives.
What the free scan checks for this
These are the FocalScore checks that cover this guide's subject. Each one in your report says what it found, shows the evidence and gives the fix.
- Security contact (security.txt)
Sources
Last checked . Documentation, settings and rules change; if one of these pages now says something different, it is right and this guide is out of date. Tell us at info@focalscore.com.
- RFC 9116: A File Format to Aid in Security Vulnerability Disclosure
- OWASP Cheat Sheet: HTTP security response headers
- Google Search Central: Introduction to robots.txt
More guides
- How to get your business recommended by ChatGPT and other AI assistants
- Why can't ChatGPT see my website? 5 reasons and how to fix them
- robots.txt for small businesses: what to allow, what to block
- What is IndexNow, and why does it matter for your website?
- The pages every small-business website needs
- How to turn more website visitors into enquiries
- Why your site is slow, and what to fix first
- How your business shows up in Google: titles, descriptions and headings
- One address for each page: www, https, canonical tags and redirects
- A sitemap for any site, including one built by hand
- Making your site usable by everyone
- Making your site work on a phone
- Security headers for a small business website: what to set, by platform
- Stop people sending email as your business: SPF, DKIM and DMARC
- Cookies and consent: what your site sets and when you need a banner
- How your links look when people share them
- Getting your business details right for Google Maps and AI assistants
- What is GEO (generative engine optimization)? A plain-English guide
- llms.txt: what it is, and does your business need one?
- AI crawler blocked? Fixing 403, 404 and 405 errors for GPTBot, ClaudeBot and PerplexityBot
- How to see if ChatGPT visits your website
- GEO vs SEO: what's the difference for a small business?
- AI SEO for small businesses: where to start
- Answer engine optimization (AEO), explained
- SPF record: what it is and how to set one up
- DMARC record: what it is and how to set one up
- DKIM record: what it is and how to set it up
- Why do my emails go to spam? How to check SPF, DKIM and DMARC
- Content Security Policy (CSP) for a small business website
- Website caching and CDNs: what they are and do you need one?
- What is DNSSEC, and should you turn it on?
- CAA record: what it is and how to set one up
- Largest Contentful Paint (LCP): why your page feels slow and how to fix it
- Local business schema: structured data for a small business, with a template
- Accessibility statement: what to write, with a template
- Trust badges and testimonials that help a website win customers
- Why isn't my website showing up on Google? How to get it there
- Google Business Profile: a checklist to make it match your website
- Custom 404 page: what a good one does, and the soft 404 trap
- Meta description length: how long should it be?
- Image alt text: what to write, with examples
- Broken links: how to find and fix them on your website
- Website audit checklist: a free check-up for a small business site
- Why does my website say 'Not secure'? How to fix it
- Is my website ADA compliant? An accessibility checklist for US small businesses
- Has my website been hacked? How to check, and what to do next
- Core Web Vitals explained: LCP, INP and CLS in plain English
- Interaction to Next Paint (INP): why your site feels slow to tap, and how to fix it
- Cumulative Layout Shift (CLS): why your page jumps while it loads, and how to stop it
- What should a small business privacy policy include? A checklist
- Contact form emails not arriving? Find where enquiries get lost
- Website monitoring: catch downtime, broken enquiries and expired certificates
- Moving or redesigning your website: a checklist so nothing gets lost
- How to audit a WordPress website: a checklist for owners
- Why isn't my business showing up on Google Maps?
- Does ChatGPT recommend your business? How to check, and how to fix what it gets wrong
- Why isn't my website getting customers? A three-question diagnosis
- How to get more Google reviews without breaking Google's rules
- Google Search Console for a small business: set it up and read the three reports that matter
- Who owns your domain and website? How to check, and how to get them back
- How to show up in Google AI Overviews and AI Mode: what Google's own guide asks for
- What is a good PageSpeed score? What the number means for a small business site
- How much should a small business website cost, and what to check before you pay the final invoice
- Is my website down, or is it just me? What to check, in order
- Is my SEO company actually doing anything? How to check, and how to spot a scam email
- Should I redesign my website or just fix it?
- Does your website still need an FAQ page now that Google's FAQ rich results are gone?