---
title: "For agents · Affordances"
description: "Everything on this site is readable without a browser. Start from llms.txt, read any page as Markdown, or ask the docs for their graph. To make an app agent-operable, hand your agent the prompt below."
url: "https://affordances.vercel.app/agents"
image: "https://affordances.vercel.app/opengraph-image?8d5f377e3430bd42"
lang: "en"
---

# Start here, agents

Everything on this site is readable without a browser. Start from llms.txt, read any page as Markdown, or ask the docs for their graph. To make an app agent-operable, hand your agent the prompt below.

[Read llms.txt](https://affordances.vercel.app/llms.txt) [Quickstart](https://affordances.vercel.app/docs/quickstart)

## Set up your agent

Every page on this site is also available as Markdown, and `/llms.txt` indexes them all. Paste this prompt into your agent to point it at the docs:

```text
Help me make this Next.js app agent-operable with Affordances. Start by reading https://affordances.vercel.app/llms.txt, which lists every page of the Affordances docs. Any page is available as Markdown by adding .md to its URL (for example https://affordances.vercel.app/docs/quickstart.md), and https://affordances.vercel.app/llms-full.txt has the whole site in one file.

1. Follow https://affordances.vercel.app/docs/guides/nextjs/getting-started.md: install @affordances/next, @affordances/react, and zod, then run `vlx @affordances/cli init`. It writes the route handler, wraps next.config.ts with withAffordances, and generates the manifest.
2. Next to each page an agent should operate, add a state.ts (what the page shows) and an actions.ts with defineAction. Set `expose` on every action an agent may call, and use 'confirm' for anything that spends money or can't be undone.
3. Check your work with curl -H 'Accept: application/vnd.affordances+json' on the page's URL, and read https://affordances.vercel.app/docs/guides/nextjs/sessions.md and https://affordances.vercel.app/docs/guides/security.md before exposing anything that needs a session.

Only use APIs that appear in the docs.
```

- [llms.txt](/llms.txt): An index of every page on this site, for agents to read before anything else.
- [Markdown pages](/llms-full.txt): Add .md to any page's URL for a plain Markdown copy, or read the whole site in one file.
- [This site’s graph](/docs/quickstart#read-the-graph): These docs run on Affordances: ask / for application/vnd.affordances+json, and search and read pages as actions.
- [MCP](/docs/guides/mcp): Serve any Affordances site to Claude, Cursor, and other MCP clients as two tools.

## Guides

Walkthroughs for the things teams set out to do first.

- [Make a page agent-operable](/docs/quickstart): Init, a state file, an action, and curl.
- [Share your session with agents](/docs/guides/nextjs/sessions): One auth resolver for the UI and the agent path.
- [Ask before an order goes through](/docs/concepts/expose): Confirm actions run only after the person approves.
- [Give browser agents tools](/docs/guides/react): WebMCP tools from the page’s own graph.
- [Connect Claude to your site](/docs/guides/mcp): Two MCP tools over any Affordances site.
- [Guard what agents can do](/docs/concepts/guards): Preconditions agents see before they call.
- [Answer with what changed](/docs/concepts/deltas): Deltas: changed entities, output, and next steps.
- [Catch unmarked controls](/docs/guides/lint): Lint rules for Affordance and action names.

## Concepts

- [Actions](/docs/concepts/actions): One defineAction call describes something a person or an agent can do on a page, and returns the server action that does it.
- [State](/docs/concepts/state): A route's state.ts says what the page shows, as entities. It's loaded for the graph and again after every action.
- [Expose](/docs/concepts/expose): Nothing reaches agents until an action says who may call it: public, session, or confirm.
- [Guards and confirm](/docs/concepts/guards): The precondition an action checks before it runs. Agents see it before they call, and get its reason when it fails.
- [Deltas](/docs/concepts/deltas): Calling an action returns what changed on the page, so the agent doesn't have to read it again.

## Reference

- [Protocol](/docs/reference/protocol): The normative Affordances protocol, version 0: discovery, graphs, calls, deltas, and error codes.
- [Security](/docs/guides/security): Default deny, explicit confirmation, Origin checks for cookies, and a fixed order of checks on every call.
- [Options](/docs/reference/options): Every option of defineAction, createHandler, and withAffordances, in one place.
- [API reference](/docs/reference/api-reference): Every export of every package, with its types, generated from the source.
- [Benchmarks](/docs/benchmarks): A browser agent and an Affordances agent on the same tasks, with committed results.
