Agent Wranglers

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

AddressPublish it whenContent typeRule or spec
security.txtAlwaystext/plainTell people how to report a hole
change-password, passkey-endpoints, webauthnPeople sign inRedirect, application/jsonPoint password managers to your account pages
openid-configuration, oauth-authorization-server, oauth-protected-resourceYou run a sign-in server or an API that needs OAuthapplication/jsonPublish your sign-in server settings
api-catalogYou offer a public APIapplication/linkset+jsonList your APIs in one file
apple-app-site-association, assetlinks.jsonYou ship a phone appapplication/jsonOpen links in your phone apps
gpc.jsonYou honour Global Privacy Controlapplication/jsonTreat the privacy signal as a no
mta-sts.txtThe domain receives emailtext/plainRequire encrypted mail delivery
webfingerOthers look up your accounts, as in a federated serverapplication/jrd+jsonRFC 7033
nodeinfoYou run a federated serverapplication/jsonNodeInfo protocol
traffic-adviceYou want to limit private prefetch proxiesapplication/trafficadvice+jsonChrome 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

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.