WEB-168Recommended
Serve standard files at fixed addresses
Serve every file you publish under /.well-known/ at its exact registered path, with its content type, without sign-in or redirect. Answer 404 for every name you do not publish.
How to do it
Serve each file at its exact path, with its content type and no redirect to a sign-in page. Add Access-Control-Allow-Origin: * (CORS, which lets other sites read it) on files meant for agents and other sites. Keep CORS on other addresses as narrow as Share data across sites on purpose says. Never fall back to the home page, as single-page apps often do, because clients then read HTML as data. IANA keeps the list of registered names. Publish only the files in the table below that match what you run. security.txt is covered in the security chapter. Serve nothing else that is hidden, as Serve no hidden files says.
Examples
| Address | Publish it when | Content type | Rule or spec |
|---|---|---|---|
security.txt | Always | text/plain | Tell people how to report a hole |
change-password, passkey-endpoints, webauthn | People sign in | Redirect, application/json | Point password managers to your account pages |
openid-configuration, oauth-authorization-server, oauth-protected-resource | You run a sign-in server or an API that needs OAuth | application/json | Publish your sign-in server settings |
api-catalog | You offer a public API | application/linkset+json | List your APIs in one file |
apple-app-site-association, assetlinks.json | You ship a phone app | application/json | Open links in your phone apps |
gpc.json | You honour Global Privacy Control | application/json | Treat the privacy signal as a no |
mta-sts.txt | The domain receives email | text/plain | Require encrypted mail delivery |
webfinger | Others look up your accounts, as in a federated server | application/jrd+json | RFC 7033 |
nodeinfo | You run a federated server | application/json | NodeInfo protocol |
traffic-advice | You want to limit private prefetch proxies | application/trafficadvice+json | Chrome private prefetch proxy |
nginx example
location ^~ /.well-known/ {
add_header Access-Control-Allow-Origin "*" always;
}
location = /.well-known/api-catalog {
default_type application/linkset+json;
add_header Access-Control-Allow-Origin "*" always;
}
Shell example
curl -sI https://example.com/.well-known/api-catalog
How to check
Fetch each file you publish without cookies. Each returns 200 with the type in the table, and CORS where intended. A made-up name such as /.well-known/no-such-file returns 404.
Sources
Related rules
- APS-37 Share data across sites on purpose in Application security
- WEB-143 Tell people how to report a hole in Website
- APS-65 Serve no hidden files in Application security
- WEB-169 Point password managers to your account pages in Website
- WEB-173 Publish your sign-in server settings in Website
- WEB-176 List your APIs in one file in Website
- WEB-178 Open links in your phone apps in Website
- WEB-208 Treat the privacy signal as a no in Website
- EML-75 Require TLS for incoming mail with MTA-STS and get TLS reports in Email
For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/standard-addresses/well-known-overview">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.