Concierge Agent Protocol
Every Cosmic account is agent-ready. Turn on the Concierge Agent Protocol (CAP) for an agent, publish one file, and a visiting agent can ask that concierge. The reply comes from the content you publish and the tools you connect. The concierge is not filled in for you.
CAP is a door next to your website. People keep using the site. Agents that speak CAP read agent.txt and send one message. They do not find the file on their own, and Cosmic does not announce your site to every assistant.
The protocol is at conciergeprotocol.org. This page is how a Cosmic project uses it.
Turn it on
CAP is off until you turn it on. Admin and Developer roles can change it.
- Open the agent under Agents. Attach a bucket first. The agent answers from that bucket.
- In Other agents, set the front door to Active and save.
- Copy the
agent.txtblock. - Publish that file at the root of your site, at
/agent.txt, next torobots.txt. On the homepage<head>, add<link rel="agent" href="https://example.com/agent.txt">even when the root file is already there, and add one line tollms.txtthat points at it. Agents that are reading your pages follow those links. If the host cannot serve a file at the root, redirect/agent.txtto the file. Callers that speak CAP try/agent.txtfirst.
The key in the file is public. It lets a visiting agent send a message. It is not a content write key.
Set the front door to Inactive to stop answers. The key stays. Rotate key issues a new address. Publish the new file. The old address stops working.
The file
Protocol: CAP/1.0
Name: Harbor
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.
Chat: https://example.com/chat
CAP: https://dapi.cosmicjs.com/cap/v1/ck_your_key
Spec: https://conciergeprotocol.org/cap.txt
Name is the agent's name. Ask tells a visiting agent that does not know CAP that your agent answers questions, and how to ask it. It is the same sentence on every door, so copy it exactly. Chat is optional: the page where a person talks to the same agent. Leave it blank and the line is omitted. CAP is the address Cosmic hosts. Visiting agents call that address. People use Chat. Spec points at the protocol, which is not Cosmic-specific.
A GET on the CAP address, or on its /messages path, returns a short plain-text explanation of how to ask, so an agent that opens the address before posting to it learns what to send.
An agent that can only open URLs can ask a public question with a GET on /messages?from=agent:{id}&message=..., and read a slow reply at the Location URL it gets back. A GET never carries a login, and the same question from the same agent within a minute is asked once.
What it answers
The reply comes from published content in the attached bucket, plus the prompt and capabilities you set on the agent. Drafts are not answers. Turn the door on after the catalog, docs, or policies you want quoted are published. An empty bucket produces a weak answer. Tell the agent in its prompt to say an item is not available when nothing published matches, rather than offering the closest thing it found.
You configure two things:
- Knowledge. Published objects, and the prompt that tells the agent how to use them.
- Actions. The capabilities you enable on that agent. CAP does not add a separate tool list.
Recent visitor threads are listed on the same Other agents panel.
Account questions
A public question needs no login. When the question is about one person's own records, CAP can ask that person to approve access. They sign in on your site. The password stays there. One approval is for that account.
That sign-in is described in the protocol at conciergeprotocol.org/login. On cosmicjs.com it is a Cosmic account. A customer door does not gain your shoppers' accounts by turning CAP on. Public answers from published content are what Active turns on.
To have your website widget answer logged-in shoppers, your site runs its own CAP login and lists a few account endpoints. The agent calls those with the shopper's login and never stores it.
Limits
Each door has a daily token cap. The default is 500,000 tokens. You can set it from 1,000 to 20,000,000. The panel shows tokens used today. When the cap is reached, the agent stops taking messages until the next day.
CAP and the MCP server do different jobs. MCP is how your own coding agent reads and writes the bucket. CAP is how someone else's agent asks your concierge a question.
FAQ
How much does Cosmic cost?
Project plans are Free ($0), Builder ($99/mo), Team ($299/mo), Business ($499/mo), Enterprise (custom pricing). Yearly billing saves 10%. Workspace plans are Small Workspace ($999/mo) and Large Workspace ($2,999/mo), and they start with a 30-day free trial. Allowances, add-on rates, and the rest of the pricing FAQ are plain text at https://www.cosmicjs.com/pricing.md.
Are API keys required, and is content private?
Each Bucket has a read key and a write key in Bucket Settings > API Access. GET requests use the read key. POST, PATCH, and DELETE use the write key as Authorization: Bearer. Do not put the write key in a browser bundle, a mobile app, or a NEXT_PUBLIC_ variable. SAML single sign-on is on Large Workspace and Enterprise. The audit log is append-only. Text versions: https://www.cosmicjs.com/security.md and https://www.cosmicjs.com/docs/dashboard/audit-log.md.
Can an agent create a Cosmic project without an existing account?
Yes. POST https://dapi.cosmicjs.com/v3/agents/sign-up provisions a free-tier project and bucket tied to a human email, with no existing Cosmic account. The human claims it with the emailed one-time code. The playbook is https://www.cosmicjs.com/docs/ai-onboarding.md.