Skip to main content
When a User asks their AI Agent to interact with your app (for example, “create a note on notes.com”), the agent needs three facts:
  1. Which Domain to pass to get_token.
  2. Which endpoints to call and what request and response shapes they expect.
  3. What to do when a request returns 401, 403, or 500.
auth.md is a plain Markdown file hosted at both https://<your-domain>/auth.md and https://<your-domain>/.well-known/auth.md that gives agents all three in one GET request.

Copy-paste agent prompt


Where to host it

Serve the same file at both paths over HTTPS with 200 OK, no authentication, and no redirects to a different hostname:
  • https://<your-domain>/auth.md
  • https://<your-domain>/.well-known/auth.md
Some agents check /auth.md first while others check /.well-known/auth.md first. Publishing both paths ensures every agent runtime finds your discovery document on the first request. In a Next.js app, place the file in both public/auth.md and public/.well-known/auth.md (or serve public/auth.md from a route handler at /.well-known/auth.md/route.ts so there is one source of truth):
notes-api
public
.well-known
auth.md
auth.md
app
api
package.json
Origin & how agents read auth.mdThe /auth.md discovery convention was pioneered by WorkOS (workos.com/auth-md) (github.com/workos/auth.md). AgentOnboard uses a 3-section auth.md format tailored for direct 5-minute JWT verification. Neither @agentonboard/sdk nor our server fetches this file; the AI Agent fetches /auth.md or /.well-known/auth.md before calling your API.

Required sections

Include these three Markdown sections in order:

Matching ## Audience with your backend code

The hostname in ## Audience must match the audience string you pass to requireAgentAccount or verifyAgentToken after normalization (lowercase hostname, no scheme, no path, no port except on localhost). Write the bare hostname your API serves on (such as notes.com). If your API runs on a subdomain such as api.notes.com, use api.notes.com in both your backend code and https://api.notes.com/auth.md.

Complete copy-paste templates

Choose the template that matches how your service handles unknown emails (see Accounts & Agent Signup):
Use this template when all routes use verifyAgentAccount / requireAgentAccount and unknown users must connect an existing account in your browser UI:
public/auth.md

Pre-publish checklist

  • Both https://<your-domain>/auth.md and https://<your-domain>/.well-known/auth.md return 200 OK without authentication or cross-host redirects.
  • ## Audience matches the normalized audience string in your backend code.
  • The 403 ACCOUNT_REQUIRED row matches your live flow (browser connect URL or POST /api/signup).

Accounts & Agent Signup

Testing & Production