Skip to content

About

Everything you need to publish a security.txt (RFC 9116): why it matters, samples to download, and setup for Next.js, PHP, WordPress, Nginx and 15 more.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Latest commit

Β 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

security.txt logo

security.txt

Let security researchers reach you

Everything you need to publish a security.txt: what it is, why it matters, samples to download,
and copy-paste setup for Next.js, PHP, WordPress, Django, Nginx and 15 more.

RFC 9116 Samples License: MIT-0

what it is Β· why Β· samples Β· every field Β· 20 setups Β· signing Β· testing Β· FAQ

Quick start Β· Download Β· Fields Β· Setup Β· Sign Β· Test Β· FAQ Β· References

⭐ Star this repo if it helps Β Β·Β  🧩 Add your framework Β Β·Β  πŸ’– Sponsor


πŸ’‘ What is security.txt?

security.txt is a small text file that tells security researchers how to report a vulnerability in your website or product. It lives at a fixed address on every domain:

https://example.com/.well-known/security.txt

It's an internet standard, RFC 9116, published by the IETF in 2022. Think of it as robots.txt for security contacts: one predictable place, one simple format, readable by people and tools.

Contact: mailto:security@example.com
Expires: 2027-11-30T23:59:59.000Z
Policy: https://example.com/security/policy
Preferred-Languages: en

A security.txt file, with Contact and Expires marked as required; Encryption, Preferred-Languages, Canonical and Policy as recommended; and Acknowledgments, Hiring and CSAF as optional

How it works

  A researcher finds a vulnerability in example.com
                     β”‚
                     β–Ό
  They open  https://example.com/.well-known/security.txt
                     β”‚
                     β–Ό
  They see who to contact, how, in which language, and your rules
                     β”‚
                     β–Ό
  You get the report privately, fix it, and thank them.
  Not on social media. Not in a public bug tracker. Not lost in a support inbox.

🎯 Why should you use it?

Without security.txt With security.txt
Researchers hunt for a contact, give up, or post publicly They find the right contact in seconds
Reports land in sales, support or a CEO's inbox and get lost Reports go straight to the people who can fix them
Researchers don't know your rules, so they hesitate to report Your policy tells them what's in scope and that they're safe
Automated scanners can't find you Tools and security platforms read the file automatically
You look unprepared in security reviews and questionnaires You show a clear, standard disclosure process

It takes five minutes, costs nothing, and has no downside. The file contains nothing secret: just a contact address you'd want reported vulnerabilities sent to anyway.

Who requires or recommends it

  • πŸ‡ΊπŸ‡Έ US federal agencies must publish one: CISA's Binding Operational Directive 20-01 requires a security.txt for every agency domain.
  • πŸ‡³πŸ‡± Dutch government lists security.txt as a required open standard ("comply or explain").
  • πŸ›‘οΈ Security standards such as ISO/IEC 29147 (vulnerability disclosure) and the OWASP Vulnerability Disclosure Cheat Sheet call for a clear, published way to report vulnerabilities, which security.txt provides.
  • βœ… Website checkers such as Internet.nl test for it alongside HTTPS, DNSSEC and email security.
  • 🌍 Large sites like Google, GitHub and Cloudflare publish one. Try https://github.com/.well-known/security.txt.

πŸš€ Quick start in 3 steps

  1. Download a sample (recommended) and replace example.com with your own details.
  2. Set Expires to a date less than a year from now, and put a reminder in your calendar to update it.
  3. Publish it at https://your-domain/.well-known/security.txt over HTTPS, as text/plain. Find your framework or server below.

Then test it. That's it.

⬇️ Download a sample

Every sample follows RFC 9116, explains each line with a comment, and is checked automatically every week. Its Expires date is moved forward every month, so a fresh download is always valid.

Sample Best for Download
Minimal The smallest valid file: a contact and an expiry date View Β· ⬇ Download
Recommended ⭐ Most websites and companies: contacts, encryption, language, canonical URL and policy View Β· ⬇ Download
Complete Every field in the standard, plus CSAF advisories View Β· ⬇ Download
Bug bounty Companies with a bug bounty or disclosure program View Β· ⬇ Download

Or from the command line:

mkdir -p .well-known
curl -o .well-known/security.txt https://raw.githubusercontent.com/security-txt/security.txt/main/samples/recommended/security.txt
Preview: the recommended sample
# Security contact for example.com
# Found a vulnerability? Please tell us. Our policy explains what to include and what to expect.
# Publish at: https://example.com/.well-known/security.txt

# How to reach us, in order of preference.
Contact: mailto:security@example.com
Contact: https://example.com/security/report

# Update this before it passes. Keep it less than a year in the future.
Expires: 2027-11-30T23:59:59.000Z

# Our public key, so reports can be encrypted.
Encryption: https://example.com/pgp-key.txt

# Languages we read reports in.
Preferred-Languages: en

# Where this file officially lives.
Canonical: https://example.com/.well-known/security.txt

# How we handle reports: scope, safe harbor and response times.
Policy: https://example.com/security/policy

πŸ“‹ Every field explained

Field Required? How many Example What it's for
Contact βœ… Required One or more mailto:security@example.com How to reach you. Use mailto:, https:// (a form or page) or tel:. List them in order of preference.
Expires βœ… Required Exactly one 2027-11-30T23:59:59.000Z When to stop trusting this file. Use the RFC 3339 date format, and keep it less than a year ahead.
Encryption Recommended Any https://example.com/pgp-key.txt Where to find your OpenPGP key, so reports can be encrypted. A link to the key, never the key itself. openpgp4fpr: fingerprints work too.
Preferred-Languages Recommended At most one en, es, fr Languages you read reports in, as language tags, separated by commas.
Canonical Recommended Any https://example.com/.well-known/security.txt Every URL this file is meant to be served from. Important when the file is signed.
Policy Recommended Any https://example.com/security/policy Your disclosure policy: what's in scope, how you respond, and a safe harbor for good-faith research.
Acknowledgments Optional Any https://example.com/hall-of-fame A page that thanks researchers who reported issues.
Hiring Optional Any https://example.com/jobs/security Security job openings.
CSAF Optional Any https://example.com/.well-known/csaf/provider-metadata.json Where your machine-readable security advisories (OASIS CSAF 2.0) live. Registered in the IANA security.txt fields registry.

Format rules: one field per line as Field: value. Field names are case-insensitive, and order doesn't matter. Lines starting with # are comments. Every web link must start with https://.

⚠️ Common mistakes

❌ Wrong βœ… Right Why
Contact: security@example.com Contact: mailto:security@example.com Contact must be a URI; a bare email isn't one
Expires: 31/12/2027 Expires: 2027-11-30T23:59:59.000Z Only the RFC 3339 date format is valid
An Expires date that has passed A date less than a year ahead An expired file must be treated as stale, and many tools flag it
No Expires line Always include it It's required, like Contact
Policy: http://example.com/policy Policy: https://example.com/policy Web links must use HTTPS
Acknowledgements: Acknowledgments: The standard uses the American spelling; other spellings are ignored
Only at /security.txt At /.well-known/security.txt The root location is legacy; redirect it to .well-known
Served as text/html, or your home page Served as text/plain; charset=utf-8 Sites that send every path to the home page break this
Only on example.com On every domain you run, like shop.example.com A file only covers the domain it's served from
A PGP key pasted into the file Encryption: with a link to the key The field points to the key; it isn't the key

πŸ› οΈ Setup for your framework or server

The simplest way works almost everywhere: put the file at .well-known/security.txt in your site's public folder, and make sure it's served as plain text. The examples below cover that, plus dynamic versions that keep Expires fresh automatically. Every example is also in the examples/ folder, ready to download.

Static or dynamic? A static file is simplest and can be signed. A dynamic route can update Expires for you (these examples use 180 days), but it can't be signed, and you still need to update contacts when they change.

Static site generators and frameworks with a public folder

Drop the file into the folder below. No code needed.

Framework Put the file at
Next.js public/.well-known/security.txt
Nuxt public/.well-known/security.txt
Astro public/.well-known/security.txt
SvelteKit static/.well-known/security.txt
Vite, React, Vue, Angular (static builds) public/.well-known/security.txt
Gatsby static/.well-known/security.txt
Hugo static/.well-known/security.txt
Laravel public/.well-known/security.txt
Rails public/.well-known/security.txt
Spring Boot src/main/resources/static/.well-known/security.txt
Jekyll / GitHub Pages .well-known/security.txt, plus one line in _config.yml

Frameworks and languages

Next.js (App Router route, with automatic Expires)

For a static file, use public/.well-known/security.txt. For a dynamic one, create app/.well-known/security.txt/route.ts:

const DAYS_VALID = 180;

export function GET() {
  const expires = new Date(Date.now() + DAYS_VALID * 24 * 60 * 60 * 1000).toISOString();
  const body = [
    'Contact: mailto:security@example.com',
    `Expires: ${expires}`,
    'Preferred-Languages: en',
    'Canonical: https://example.com/.well-known/security.txt',
    'Policy: https://example.com/security/policy',
  ].join('\n');

  return new Response(`${body}\n`, {
    headers: {
      'Content-Type': 'text/plain; charset=utf-8',
      'Cache-Control': 'public, max-age=86400',
    },
  });
}

Redirect the old location in next.config.js:

module.exports = {
  async redirects() {
    return [{ source: '/security.txt', destination: '/.well-known/security.txt', permanent: true }];
  },
};

πŸ“ examples/nextjs

Express (Node.js)
const express = require('express');
const app = express();

app.get('/.well-known/security.txt', (req, res) => {
  const expires = new Date(Date.now() + 180 * 24 * 60 * 60 * 1000).toISOString();
  res.type('text/plain; charset=utf-8').send(
    [
      'Contact: mailto:security@example.com',
      `Expires: ${expires}`,
      'Preferred-Languages: en',
      'Canonical: https://example.com/.well-known/security.txt',
      'Policy: https://example.com/security/policy',
      '',
    ].join('\n'),
  );
});

app.get('/security.txt', (req, res) => res.redirect(301, '/.well-known/security.txt'));

Serving a static file? express.static skips dot-folders like .well-known by default. Use express.static('public', { dotfiles: 'allow' }).

πŸ“ examples/express

PHP (plain PHP with Apache)

security.php:

<?php
$expires = gmdate('Y-m-d\TH:i:s.000\Z', time() + 180 * 86400);

header('Content-Type: text/plain; charset=utf-8');
header('Cache-Control: public, max-age=86400');

echo "Contact: mailto:security@example.com\n";
echo "Expires: {$expires}\n";
echo "Preferred-Languages: en\n";
echo "Canonical: https://example.com/.well-known/security.txt\n";
echo "Policy: https://example.com/security/policy\n";

.htaccess in the same folder:

RewriteEngine On
RewriteRule ^\.well-known/security\.txt$ security.php [L]
RewriteRule ^security\.txt$ /.well-known/security.txt [R=301,L]

πŸ“ examples/php

Laravel

Static: public/.well-known/security.txt. Dynamic, in routes/web.php:

use Illuminate\Support\Facades\Route;

Route::get('/.well-known/security.txt', function () {
    $expires = now()->utc()->addDays(180)->format('Y-m-d\TH:i:s.000\Z');

    $body = implode("\n", [
        'Contact: mailto:security@example.com',
        "Expires: {$expires}",
        'Preferred-Languages: en',
        'Canonical: https://example.com/.well-known/security.txt',
        'Policy: https://example.com/security/policy',
    ]) . "\n";

    return response($body, 200)->header('Content-Type', 'text/plain; charset=utf-8');
});

Route::permanentRedirect('/security.txt', '/.well-known/security.txt');

πŸ“ examples/laravel

WordPress (no plugin to install)

Option 1: upload security.txt to a .well-known folder in your WordPress root (next to wp-config.php) with your host's file manager or SFTP.

Option 2: a must-use plugin with automatic Expires. Save as wp-content/mu-plugins/security-txt.php:

<?php
/**
 * Plugin Name: security.txt
 * Description: Serves /.well-known/security.txt (RFC 9116) with a fresh Expires date.
 */

add_action('init', function () {
    $path = parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_PATH);

    if ($path === '/security.txt') {
        wp_redirect(home_url('/.well-known/security.txt'), 301);
        exit;
    }
    if ($path !== '/.well-known/security.txt') {
        return;
    }

    $expires = gmdate('Y-m-d\TH:i:s.000\Z', time() + 180 * DAY_IN_SECONDS);
    header('Content-Type: text/plain; charset=utf-8');
    echo "Contact: mailto:security@example.com\n";
    echo "Expires: {$expires}\n";
    echo "Preferred-Languages: en\n";
    echo 'Canonical: ' . home_url('/.well-known/security.txt') . "\n";
    echo "Policy: https://example.com/security/policy\n";
    exit;
});

πŸ“ examples/wordpress

Django

views.py:

from datetime import datetime, timedelta, timezone

from django.http import HttpResponse
from django.views.decorators.http import require_GET


@require_GET
def security_txt(request):
    expires = (datetime.now(timezone.utc) + timedelta(days=180)).strftime("%Y-%m-%dT%H:%M:%S.000Z")
    lines = [
        "Contact: mailto:security@example.com",
        f"Expires: {expires}",
        "Preferred-Languages: en",
        "Canonical: https://example.com/.well-known/security.txt",
        "Policy: https://example.com/security/policy",
    ]
    return HttpResponse("\n".join(lines) + "\n", content_type="text/plain; charset=utf-8")

urls.py:

from django.urls import path
from django.views.generic.base import RedirectView

from .views import security_txt

urlpatterns = [
    path(".well-known/security.txt", security_txt),
    path("security.txt", RedirectView.as_view(url="/.well-known/security.txt", permanent=True)),
]

πŸ“ examples/django

Flask
from datetime import datetime, timedelta, timezone

from flask import Flask, Response, redirect

app = Flask(__name__)


@app.get("/.well-known/security.txt")
def security_txt():
    expires = (datetime.now(timezone.utc) + timedelta(days=180)).strftime("%Y-%m-%dT%H:%M:%S.000Z")
    lines = [
        "Contact: mailto:security@example.com",
        f"Expires: {expires}",
        "Preferred-Languages: en",
        "Canonical: https://example.com/.well-known/security.txt",
        "Policy: https://example.com/security/policy",
    ]
    return Response("\n".join(lines) + "\n", mimetype="text/plain")  # Flask adds charset=utf-8


@app.get("/security.txt")
def legacy_security_txt():
    return redirect("/.well-known/security.txt", code=301)

πŸ“ examples/flask

Ruby on Rails

Put the file at public/.well-known/security.txt; Rails serves it as-is. Redirect the old location in config/routes.rb:

Rails.application.routes.draw do
  get "/security.txt", to: redirect("/.well-known/security.txt", status: 301)
end

πŸ“ examples/rails

Go (net/http)
package main

import (
	"fmt"
	"net/http"
	"time"
)

func securityTxt(w http.ResponseWriter, r *http.Request) {
	expires := time.Now().UTC().Add(180 * 24 * time.Hour).Format("2006-01-02T15:04:05.000Z")
	w.Header().Set("Content-Type", "text/plain; charset=utf-8")
	fmt.Fprintf(w, "Contact: mailto:security@example.com\n")
	fmt.Fprintf(w, "Expires: %s\n", expires)
	fmt.Fprintf(w, "Preferred-Languages: en\n")
	fmt.Fprintf(w, "Canonical: https://example.com/.well-known/security.txt\n")
	fmt.Fprintf(w, "Policy: https://example.com/security/policy\n")
}

func main() {
	http.HandleFunc("/.well-known/security.txt", securityTxt)
	http.Handle("/security.txt", http.RedirectHandler("/.well-known/security.txt", http.StatusMovedPermanently))
	http.ListenAndServe(":8080", nil)
}

πŸ“ examples/go

ASP.NET Core (C#)
var builder = WebApplication.CreateBuilder(args);
var app = builder.Build();

app.MapGet("/.well-known/security.txt", () =>
{
    var expires = DateTime.UtcNow.AddDays(180).ToString("yyyy-MM-dd'T'HH:mm:ss'.000Z'");
    var body = string.Join("\n",
        "Contact: mailto:security@example.com",
        $"Expires: {expires}",
        "Preferred-Languages: en",
        "Canonical: https://example.com/.well-known/security.txt",
        "Policy: https://example.com/security/policy") + "\n";
    return Results.Text(body, "text/plain; charset=utf-8");
});

app.MapGet("/security.txt", () => Results.Redirect("/.well-known/security.txt", permanent: true));

app.Run();

πŸ“ examples/aspnet-core

Spring Boot (Java)

Static: src/main/resources/static/.well-known/security.txt. Dynamic:

@RestController
public class SecurityTxtController {

    @GetMapping(value = "/.well-known/security.txt", produces = "text/plain;charset=UTF-8")
    public String securityTxt() {
        Instant expires = Instant.now().plus(180, ChronoUnit.DAYS).truncatedTo(ChronoUnit.SECONDS);
        return String.join("\n",
            "Contact: mailto:security@example.com",
            "Expires: " + expires,
            "Preferred-Languages: en",
            "Canonical: https://example.com/.well-known/security.txt",
            "Policy: https://example.com/security/policy") + "\n";
    }

    @GetMapping("/security.txt")
    public ResponseEntity<Void> legacy() {
        return ResponseEntity.status(HttpStatus.MOVED_PERMANENTLY)
            .header(HttpHeaders.LOCATION, "/.well-known/security.txt")
            .build();
    }
}

πŸ“ examples/spring-boot

Servers and hosting

Nginx

Inside your server { } block:

location = /.well-known/security.txt {
    alias /var/www/security/security.txt;
    default_type text/plain;
    charset utf-8;
    add_header Cache-Control "public, max-age=86400";
}

location = /security.txt {
    return 301 /.well-known/security.txt;
}

πŸ“ examples/nginx

Apache

Put the file at <document root>/.well-known/security.txt. In the root .htaccess:

Redirect 301 /security.txt /.well-known/security.txt

In <document root>/.well-known/.htaccess:

<Files "security.txt">
    ForceType text/plain
    AddDefaultCharset utf-8
</Files>

πŸ“ examples/apache

Caddy

Caddy already serves .txt files as text/plain; charset=utf-8. Put the file at <root>/.well-known/security.txt:

example.com {
    root * /var/www/example
    redir /security.txt /.well-known/security.txt permanent
    file_server
}

πŸ“ examples/caddy

IIS (Windows Server)

Put the file at <site root>\.well-known\security.txt. In <site root>\.well-known\web.config:

<configuration>
  <system.webServer>
    <staticContent>
      <remove fileExtension=".txt" />
      <mimeMap fileExtension=".txt" mimeType="text/plain; charset=utf-8" />
    </staticContent>
  </system.webServer>
</configuration>

In the site root web.config, redirect the old location:

<configuration>
  <location path="security.txt">
    <system.webServer>
      <httpRedirect enabled="true" destination="/.well-known/security.txt" httpResponseStatus="Permanent" />
    </system.webServer>
  </location>
</configuration>

πŸ“ examples/iis

Cloudflare Workers (in front of any site)
export default {
  async fetch(request) {
    const url = new URL(request.url);

    if (url.pathname === '/security.txt') {
      return Response.redirect(`${url.origin}/.well-known/security.txt`, 301);
    }

    const expires = new Date(Date.now() + 180 * 24 * 60 * 60 * 1000).toISOString();
    const body = [
      'Contact: mailto:security@example.com',
      `Expires: ${expires}`,
      'Preferred-Languages: en',
      `Canonical: ${url.origin}/.well-known/security.txt`,
      'Policy: https://example.com/security/policy',
      '',
    ].join('\n');

    return new Response(body, {
      headers: { 'Content-Type': 'text/plain; charset=utf-8', 'Cache-Control': 'public, max-age=86400' },
    });
  },
};

Add the routes example.com/.well-known/security.txt and example.com/security.txt to the Worker.

πŸ“ examples/cloudflare-workers

Netlify

Put the file at .well-known/security.txt in your publish folder. Add _headers:

/.well-known/security.txt
  Content-Type: text/plain; charset=utf-8

And _redirects:

/security.txt  /.well-known/security.txt  301

πŸ“ examples/netlify

Vercel

Put the file at public/.well-known/security.txt, and add to vercel.json:

{
  "headers": [
    {
      "source": "/.well-known/security.txt",
      "headers": [{ "key": "Content-Type", "value": "text/plain; charset=utf-8" }]
    }
  ],
  "redirects": [
    { "source": "/security.txt", "destination": "/.well-known/security.txt", "permanent": true }
  ]
}

πŸ“ examples/vercel

GitHub Pages (Jekyll)

Jekyll skips folders that start with a dot, so .well-known isn't published by default. Add this to _config.yml:

include:
  - .well-known

πŸ“ examples/github-pages

Your framework isn't here? Add it: one folder in examples/ and one section in this README.

✍️ Sign it (recommended)

RFC 9116 recommends signing the file with an OpenPGP cleartext signature, so researchers can check it really comes from you. If you sign it, include a Canonical line.

# 1. Write the unsigned file
nano security.txt

# 2. Sign it with your security team's key (creates security.txt.asc)
gpg --local-user security@example.com --clearsign security.txt

# 3. Publish the signed version
mv security.txt.asc .well-known/security.txt

# Anyone can check the signature
gpg --verify .well-known/security.txt

A signed file looks like this:

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

Contact: mailto:security@example.com
Expires: 2027-11-30T23:59:59.000Z
Encryption: https://example.com/pgp-key.txt
Canonical: https://example.com/.well-known/security.txt
-----BEGIN PGP SIGNATURE-----
...
-----END PGP SIGNATURE-----

Re-sign every time you change the file, including when you update Expires. Dynamic routes can't be signed.

πŸ” Test it

1. Check that it's served correctly:

curl -i https://example.com/.well-known/security.txt
Look for Good
Status HTTP/2 200
Content type content-type: text/plain; charset=utf-8
Body Your file, not your home page's HTML

2. Check the old location redirects:

curl -I https://example.com/security.txt    # expect 301 and location: /.well-known/security.txt

3. Check every domain: www.example.com, shop.example.com, api.example.com… Each needs its own file, or a redirect.

4. Run an online check: Internet.nl tests security.txt as part of its website test.

⏰ Keep it fresh

Expires is required so that stale contact details aren't trusted forever. Most broken security.txt files are simply expired. To avoid that:

  • πŸ“… Add a calendar reminder a month before the date.
  • πŸ” Use a dynamic route (see setup) that keeps the date a few months ahead.
  • πŸ€– Let CI warn you. This GitHub Action fails 30 days before your file expires:
# .github/workflows/security-txt.yml
name: security.txt expiry
on:
  schedule:
    - cron: '0 6 * * 1'   # every Monday
  workflow_dispatch:

jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - name: security.txt is not about to expire
        run: |
          expires=$(curl -fsSL https://example.com/.well-known/security.txt | grep -i '^Expires:' | cut -d' ' -f2- | tr -d '\r' | sed 's/\.[0-9]*//')
          days=$(( ( $(date -d "$expires" +%s) - $(date +%s) ) / 86400 ))
          echo "security.txt expires in $days days ($expires)"
          if [ "$days" -lt 30 ]; then echo "::error::security.txt expires in $days days. Update Expires."; exit 1; fi

❓ FAQ

Is security.txt only for big companies?

No. Any website can receive vulnerability reports, and small teams benefit the most, because they're the hardest to find a contact for. If you have a website and an email address, you can publish one in five minutes.

Will it attract attacks or spam?

It won't attract attacks: attackers don't need an invitation, and the file contains nothing secret. You may get some low-quality reports ("missing header", "clickjacking on a static page"). A clear Policy that lists what's in and out of scope cuts these down a lot. Many teams use a dedicated address like security@ with a filter.

Do I need a bug bounty program?

No. security.txt is just a way to contact you. You can say in your policy that you don't pay rewards. If you do run a bounty, link it in Policy and Contact (see the bug bounty sample).

What should my policy page say?

At minimum: what's in scope, how to report, what you'll do and how fast, and a promise not to take legal action against good-faith research (safe harbor). disclose.io has free policy templates, and the OWASP cheat sheet explains what to include.

/.well-known/security.txt or /security.txt?

/.well-known/security.txt is the standard location. /security.txt at the root is an older location: keep it only as a redirect to .well-known, for tools that still look there.

Does each subdomain need its own file?

Yes. A security.txt file only applies to the domain it's served from. Publish one on each domain, or redirect each domain's /.well-known/security.txt to the main one (and list them in Canonical).

How long can Expires be?

The standard recommends less than a year. Shorter is fine; many teams use 6 months with a dynamic route or a CI reminder. Never leave it in the past.

Do I have to sign the file?

No, signing is recommended, not required. It helps researchers trust that the file wasn't tampered with. Most sites start unsigned and add a signature later.

Can I use a contact form instead of an email?

Yes. Contact: https://example.com/security/report is valid. Listing an email as well is a good backup.

πŸ“š References

Resource What it is
RFC 9116 The security.txt standard (IETF, 2022)
IANA security.txt fields The official list of fields, including CSAF
securitytxt.org The original project site, with an online generator
CISA BOD 20-01 US federal directive that requires security.txt
Forum Standaardisatie Dutch government open standard for security.txt
OWASP Vulnerability Disclosure Cheat Sheet How to run a disclosure process
disclose.io Free vulnerability disclosure policy templates and safe harbor language
OASIS CSAF 2.0 The machine-readable advisory format behind the CSAF field
RFC 3339 The date format used by Expires
RFC 8615 Well-known URIs: why the file lives in /.well-known/
Internet.nl Free website test that includes security.txt

🀝 Contributing

New framework and server examples, corrections, translations and better samples are all welcome. See CONTRIBUTING.md.

Contributors

Contributors

πŸ’– Sponsors

This project is free and always will be. It's part of the AI Bots DB family, and sponsorships support all of its projects.

Who You get
β˜• Individuals Any amount, monthly or one-time Our thanks, a sponsor badge on your GitHub profile, and your name in this README
πŸš€ Companies Security teams and vendors Your logo in this README and on aibotsdb.com, with a link to your website
πŸ›οΈ Founding sponsors The first companies to back the project A large logo at the top of this README and the website, and a say in the roadmap

Become a sponsor β†’

🧩 The family

Files every website should get right:

File Job Project
security.txt Let researchers report vulnerabilities this repo
robots.txt Tell crawlers what they may visit robots-dot-txt
llms.txt Tell AI assistants what to read llms-dot-txt
site.webmanifest Make your site installable as an app webmanifest
Bot user-agents Recognize every kind of bot in your traffic user-agents.txt
AI crawlers Know which AI bots visit, and block the ones you don't want AI Bots DB

License

MIT No Attribution: copy the samples and examples into your projects freely, no credit needed. This is an independent guide to RFC 9116; it is not affiliated with the RFC authors or securitytxt.org.

About

Everything you need to publish a security.txt (RFC 9116): why it matters, samples to download, and setup for Next.js, PHP, WordPress, Nginx and 15 more.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages