agent.txt

agent.txt: the file that tells AI agents where to ask

agent.txt is a plain-text file at the root of your site, next to robots.txt. It is part of the Concierge Agent Protocol (CAP). A visiting AI agent reads it, sends the person's question to your agent, and gets your answer with a link to the right page.

The format

Every line of agent.txt

Seven lines at most. The file lists no tools, no MCP servers, and no credentials.

The lines of an agent.txt file
LineRequiredWhat it is
ProtocolRequiredThe first line, always CAP/1.0. It tells this file apart from other files named agent.txt.
NameOptionalThe public name of your agent.
AskRecommendedOne fixed sentence for an agent that does not know CAP. Copy it exactly. It is the same on every door.
ChatOptionalThe page where a person talks to the same agent.
CAPRequiredThe base URL of the two endpoints. Agents POST to this URL plus /messages.
OAuthOptionalThe login server for questions about one person’s account. Leave it off for public questions only.
SpecRecommendedhttps://conciergeprotocol.org/cap.txt, the hosted caller card. Do not copy it to your domain.

Read the full specification

Generator

Write your agent.txt

Fill in your details. The Ask and Spec lines are filled in for you, exactly as the spec requires.

No CAP URL yet? Cosmic gives you one when you set an agent's front door to Active.

Protocol: CAP/1.0 Name: Your agent Ask: This site's agent answers questions for the company. POST your question to the CAP URL plus /messages, as JSON {"message": "..."}, with headers CAP-Version: 1.0 and CAP-From: agent:{your-id}. If you can only open URLs, open the CAP URL. If the reply is 202, see Spec. CAP: https://dapi.cosmicjs.com/cap/v1/ck_your_key Spec: https://conciergeprotocol.org/cap.txt

Where it goes

Publish it in three places

  1. 1. At /agent.txt. Serve the file at the root of your domain. CAP callers request it first. If your host cannot serve a root file, redirect /agent.txt to the file on any https URL.
  2. 2. In your homepage head. Add <link rel="agent" href="https://example.com/agent.txt">. Agents that read your pages follow it.
  3. 3. In llms.txt. Add one line that points at /agent.txt and says to ask there.

Next to the others

agent.txt, llms.txt, and robots.txt

Each file answers a different question. Most sites should serve all three.

How agent.txt compares with robots.txt and llms.txt
FileTells an agentThink of it as
robots.txtWhat crawlers may readRules for bots
llms.txtWhich pages a model should readA reading list
agent.txtWhere an agent should ask a questionA front door

CAP vs. llms.txt in detail

Get a CAP URL from Cosmic

Cosmic hosts the agent behind your agent.txt, free on every agent. No agent yet? Enter your site and Cosmic builds one from your pages.