Set it up, one level at a time
Supporting Poppy gives your customers' AI assistants a front door to your site, with only the access each customer approves. This guide suggests four levels, and you can stop at any of them. The order is ours, not the spec's, which says its layers are not a sequence of adoption levels. Each says what to build, roughly how big it is, and which checks it turns green, with links to the spec.
What you'll need
- Control of your domain, so you can publish one small public file, poppy.json, on it over HTTPS.
- For level 2, a check in front of your APIs that verifies the signed header assistants send with every request. It needs no sign-in server.
- For level 3, a sign-in server that speaks OAuth, the standard behind most "Sign in with..." screens, and sign-in and consent pages on your own site, where customers approve what an assistant may do.
- Developer time that grows with each level: about a day for level 1, then days to weeks for each level after it.
Level 1: Be findable
Publish one public file that tells assistants where to go, and, if you run a sign-in server, have it confirm that the file is yours.
- Rough size
- Small. A few JSON documents, served over HTTPS. A day or less if you already run an OAuth server, and less without one.
- Checks it turns green
- 36, all checked today
Building this with a coding agent? The spec's authors publish an implementation kit for companies. Its skill has the agent survey your systems, write a design for you to approve, and build it in milestones. Its validator acts as a test assistant against your deployment and reports which requirements you meet. The kit follows version 1.0, as this guide does (implementation kit).
Publish one public file
A person's AI assistant (the spec calls it a Personal Agent) starts at one public file on your domain, at https://example.com/.well-known/poppy.json. You must serve it over HTTPS (spec 3).
The address may redirect, for example from www.example.com to example.com, and every redirect must go to an HTTPS address. A redirect may go to another host, but the address it ends at must have the path /.well-known/poppy.json exactly, with no query. An assistant does not use a file found anywhere else, so an upload or any other page on your site cannot speak for you (spec 3).
The file speaks for the host that finally serves it. If a provider runs Poppy for you, have it serve the file on your own domain. Every other address the protocol uses, in this file, in your OAuth metadata and in your answers, must be HTTPS too (spec 3).
The smallest useful file names your company and your website. This one follows the shape of the spec's example, cut down to what level 1 needs (spec 3, spec 3.1):
poppy.json, the whole file
{
"protocol_version": "1.0",
"organization": {
"name": "Example Company",
"domain": "example.com",
"logo_uri": "https://example.com/logo.png"
},
"web": {}
}
With only web, assistants browse your site as ordinary signed-out visitors (spec 3.1). That is a real first step: assistants can find you, and the checker can read your file.
What each field means
All of these come from the spec's field list (spec 3.1).
protocol_versionis the version of the protocol the file follows, as major.minor. For this version it is"1.0". An assistant uses the file only if this version is compatible with one it supports, as the next section explains. From 1.0, a newer minor version, such as 1.1, will not break older assistants: they use the file and ignore fields they do not know.supported_versionsis optional. It lists the other versions you serve, each with the address of that version's own file, explained in the next section.organizationholds your displayname, yourdomain, and optionallylogo_uri, an HTTPS address of your logo. Thedomainmust be the host that serves the file, after any redirects, with its port when that isn't 443, such asshop.example:8443for a test server. Assistants use a company on another port only when they are set up to on purpose, such as for testing. Hosts are compared ignoring case and nothing else, sowww.example.comandexample.comare different hosts. A file redirected to a provider's domain speaks for the provider, not for you.- Nothing in the file proves that your domain belongs to the company in
name. Any domain can claim any name and logo, so a lookalike domain passes the same checks. Your domain is your identity, and assistants may show it next to your name (spec 10.3, guides: finding a company). agent,apisandwebsay what assistants can use, and you need at least one of them.webis your website.apislists your APIs, which level 2 covers.agentlists ways to talk with your own AI agent, which level 4 covers.web.disabledis optional. Set it totrueto ask assistants not to use a browser on your website, and to use your own agent and APIs instead. A file that sets it must listagentorapis, and no browser join, which level 4 covers. The protocol cannot enforce it, because you cannot always tell an assistant's browser from a person's, so it says what you prefer rather than promising that no assistant will browse (spec 6).web.unscopedis optional, for websites where assistants browse signed in. Set it totruewhen your website gives a signed-in browser everything the account can do there, rather than only what the person approved. A file that sets it also lists the browser join. Level 4 covers it (spec 6).authis optional. It holds your sign-in details:issuerwhen you have more than one sign-in server,disabledto turn sign-in off, and the descriptions and hints for your scopes, which level 3 covers.tasksis optional. Itsendpointis an HTTPS address where assistants get, for each session, the tasks you chose not to offer, the skills you publish and where to send feedback, explained below (spec 9).extensionsis optional. It lists extra features you support, with an entry for each version you support, such asoperations(level 4) ormediated-sign-in(level 3). The spec's site lists the others (extensions).
Details for implementers: naming extensions
Extensions defined with the protocol have plain names, such as operations or mediated-sign-in. Anyone else must start an extension's name with a domain they control, such as example.com/gift-wrap. Each extension's entry is a list, with one item for each major version you support. Each item has a version, the extension's major version, and the other fields the extension defines for that version, such as an endpoint (spec 3.3):
Excerpt from poppy.json
"extensions": {
"example.com/gift-wrap": [
{ "version": "2", "endpoint": "https://api.example.com/poppy/gift-wrap/v2" },
{ "version": "1", "endpoint": "https://api.example.com/poppy/gift-wrap" }
]
}
An assistant picks one version of each extension it uses with you, and names them in a header on its requests, which level 2 covers. Assistants and companies ignore extensions, versions and fields they do not support (spec 3.3).
Serve more than one version
You can serve several versions of the protocol at once, so assistants can move to a new one at their own pace. poppy.json is then the file for the version you prefer, and supported_versions gives, for each other version, the address of that version's file (spec 3.4):
Excerpt from poppy.json
"protocol_version": "1.0",
"supported_versions": {
"0.4": "https://example.com/poppy/0.4.json"
}
Each address must be HTTPS, on the host that served poppy.json after any redirects. An assistant does not use a file on another host, and does not follow a redirect from one, so no domain can point at a file someone uploaded to yours. Its path can be anything. The file there has the protocol_version it is listed under, or assistants do not use it, and no supported_versions of its own (spec 3.4).
Every file you serve at the same time must have the same organization.domain and name the same sign-in server, which the next section explains. Otherwise a new version would change how your company is identified, and with it the IDs assistants use for people. Other fields may differ between versions (spec 3.4).
The assistant chooses a version for you. Two versions are compatible when they have the same major version, and before 1.0 the same minor version too: 1.0 and 1.1 are compatible, 0.3 and 0.4 are not. It chooses the newest of your versions that is compatible with one it supports, and uses that version's file. If none is, it uses none of them (spec 3.4). So an assistant built for 1.0, the published version, uses only a 1.0 file, or one from a later 1.x, and one built for Version 0.4 uses only a 0.4 file. Publish poppy.json as 1.0. If you also want to reach assistants that still implement 0.4, you may list a 0.4 copy in supported_versions, as in the example above. The copy declares "0.4", has no supported_versions of its own, and is served on the same host without a redirect. A later 1.x adds features only for assistants that declare it, so a 1.0 file keeps working with them, as level 2 explains (spec 3.4).
It then names its version on every request in a session, in a header that level 2 covers. Where you check that header, you also check the version, and answer one you do not serve with an error. The assistant then fetches poppy.json again and chooses again. If you serve one version, that check is all you need (spec 3.4, guides: serving several versions).
The guides suggest these steps (guides: serving several versions):
- To add a version, publish its file at a path of your own, such as
/poppy/0.4.json. A static file works. Keep the address the same for as long as you list the version, and accept both versions at your endpoints. - To make it your preferred version, in one deploy, serve it at
/.well-known/poppy.jsonand add the older file's address tosupported_versions. - To retire a version, send the
DeprecationandSunsetheaders on its responses for a while, then remove it fromsupported_versions, then stop accepting it.
A conversation with your agent can outlast a version, which level 4 covers. From 1.0, where poppy.json lives, how it is fetched, protocol_version and supported_versions keep their meaning in every version, so an assistant can always find a version you share, or tell that there is none (spec 3.4).
Name your sign-in server
You need a sign-in server only to let people sign in to their accounts, which level 3 covers. It is an OAuth server: OAuth is the standard most sign-in servers already speak, and the spec calls the server's name its issuer. Assistants do not read the issuer from poppy.json. They find it the standard OAuth way, from a small public file on your domain called protected resource metadata (RFC 9728) (spec 3.2):
GET https://example.com/.well-known/oauth-protected-resource
{
"resource": "https://example.com",
"authorization_servers": ["https://auth.example.com"],
"scopes_supported": ["orders:read", "orders:write", "addresses", "poppy:browser-sign-in"]
}
resource must be exactly https:// followed by your organization.domain. When authorization_servers lists one server, that server is your issuer. If it lists more than one, for example one for your employees, set auth.issuer in poppy.json to the one assistants use. It must be in the list (spec 3.1, spec 3.2).
This file may also list, in scopes_supported, the scopes an assistant can ask for. Scopes are the kinds of account access a sign-in grants, which level 3 covers. This suits a sign-in server that also serves your other apps, because its own metadata has one list for all of them (spec 3.2).
The issuer must publish a second public file, its OAuth metadata (RFC 8414). In the spec's example it lives at https://auth.example.com/.well-known/oauth-authorization-server (spec 3.2):
OAuth metadata (excerpt)
{
"issuer": "https://auth.example.com",
"token_endpoint": "https://auth.example.com/oauth/token",
"revocation_endpoint": "https://auth.example.com/oauth/revoke",
"authorization_endpoint": "https://auth.example.com/oauth/authorize",
"grant_types_supported": ["refresh_token", "authorization_code"],
"scopes_supported": ["orders:read", "orders:write", "addresses", "poppy:browser-sign-in"],
"protected_resources": ["https://example.com"]
}
The two sides point at each other. Before an assistant uses your poppy.json, it fetches this metadata and checks two things: its issuer exactly matches the issuer it found, character for character, and protected_resources lists https:// followed by your organization.domain, with no path or trailing slash. Without that second check, any domain could claim your sign-in server and receive its tokens (spec 3, spec 3.2). Every entry in protected_resources must be an HTTPS address, and none may carry a fragment, the part after a #, because an address that names a resource has none (RFC 9728).
The assistant also reads these fields of the metadata (spec 3.2):
token_endpointissues tokens. Required.revocation_endpointis where an assistant signs out. Required. Level 3 uses it.grant_types_supportedlists the kinds of token request your server accepts. Required, and it must includerefresh_token. It also says which kinds of sign-in you offer:authorization_codefor direct sign-in, andurn:ietf:params:oauth:grant-type:device_codefor device sign-in.authorization_endpointis required when you listauthorization_code, anddevice_authorization_endpointwhen you list the device code grant.scopes_supportedshould list every scope an assistant can ask for, here, in your protected resource metadata, or in both. If you offer sign-in and let assistants' browsers join their sessions, that includespoppy:browser-sign-in, the one scope the protocol defines, which lets an assistant browse your website signed in, as level 4 covers (spec 4.7).
If you run a domain for each country, several domains may share one issuer. They then count as one company: the same user IDs, sessions and refresh tokens apply across all of them. List each domain in protected_resources, and have each domain point to that same issuer. Give each scope the same meaning on every domain; the files may otherwise differ, for example in their APIs. The other way round, an issuer stands for exactly one company, so a provider that hosts several companies gives each its own issuer (spec 3.2).
Assistants cache these files according to their HTTP caching headers, within limits they set, so send caching headers that match how often the files change (guides: fetching metadata safely).
Without a sign-in server, or not yet
You can offer signed-out visits, with APIs, conversations, feedback and the browser join, without any sign-in server. Answer 404 at the protected resource metadata address, or publish it with no authorization_servers, and leave auth.issuer out of poppy.json. Your company is then identified by https:// followed by your domain (spec 3.2, guides: signed-out support without OAuth).
Be careful with the answer. A timeout, any other error status or metadata that is not valid does not mean "no sign-in server": an assistant then stops rather than guess (spec 3.2). Adding a sign-in server later changes how your company is identified, so assistants start over with new user IDs and sessions (guides: signed-out support without OAuth).
If you have a sign-in server but are not ready to let assistants sign in, keep it and set auth.disabled to true in poppy.json. That suits a server that so far serves only your other apps, or a company that wants to keep the same identifier, its issuer, while its domain names change, before it offers sign-in. Assistants then do not try to sign in, and still make signed-out visits. Your company is still identified by its issuer, so nothing changes for your customers when you remove it. A file that sets it must not list the mediated sign-in extension or a conversation entry that needs sign-in (spec 3.2, guides: offering personal agents less).
Excerpt from poppy.json
"auth": {
"disabled": true
}
If you set it and have never given an assistant a refresh token, you have no tokens to protect. Answer every refresh request with the error invalid_grant, and every request to your revocation_endpoint with success. You may do so without checking the signed statement an assistant sends to prove who it is, its client assertion, which level 3 covers. Once you have given out a refresh token, or turn sign-in on, check those statements as usual (spec 3.2).
List the tasks you don't offer
Some tasks you may allow only in your own app, for example for security or legal reasons. List them, so assistants know up front and do not spend a long time looking for a way. Set tasks.endpoint in poppy.json to an HTTPS address on a public host: assistants must not connect to a loopback, private or link-local address a company gives them, such as 127.0.0.1 or 10.0.0.5 (spec 3). Early in each session, an assistant sends a GET request there, with the Session header that level 2 covers and no access token. You answer with a JSON object (spec 9):
Answer from tasks.endpoint, sent by the company
{
"excluded_tasks": [
{
"task": "Send a wire transfer",
"alternative": {
"instructions": "Wire transfers can only be sent in the Example app, after the User verifies their identity.",
"references": [{ "type": "web", "url": "https://example.com/transfers/wire" }]
}
},
{ "task": "Close an account" }
],
"skill_index": {
"$schema": "https://schemas.agentskills.io/discovery/0.2.0/schema.json",
"skills": [
{
"name": "manage-bookings",
"description": "Manage the User's bookings with this Company.",
"type": "skill-md",
"url": "https://cdn.example.com/skills/manage-bookings/SKILL.md",
"digest": "sha256:1b2a8cde934e632f7e14fa080a627ad7191e29d412d2b8a7aa07d9c9ab2f475e"
}
]
},
"feedback": {
"endpoint": "https://api.example.com/poppy/feedback"
}
}
All three parts are optional. excluded_tasks lists the tasks you chose not to offer. skill_index and feedback are explained in the next section (spec 9).
Each task is a short phrase, written the way a customer would ask. An alternative says another way to do it, in instructions, in references, or both. A reference of type openapi or mcp must name an API your poppy.json lists (spec 9.1, spec 9.2). A listed task is not offered anywhere through the protocol: not by your agent, your APIs or your website in a browser. The answer describes what you offer, not the person's account, which is why it carries no access token. A limit that depends on the person, such as a transfer limit, is not an excluded task: answer it with an error, as for any request you refuse (spec 9.1).
The assistant uses your answer only in the session it asked in. If you give every session the same answer, you can serve it without checking the Session header, and cache it at your edge. You may also give different sessions different answers, for example to try a new skill with some people. Check the Session header first, and mark those answers private or no-store in Cache-Control, so a shared cache does not give one session's answer to another. When an assistant gets no answer, it carries on as if you listed nothing (spec 9, guides: excluded tasks and feedback).
Publish skills and take feedback
skill_index lists skills: written instructions that help an assistant do a task at your company, such as changing a booking through your APIs. It uses the index format of the Agent Skills discovery proposal, with the schema identifier in the example. Each skill has a name, a description, a type (skill-md for one SKILL.md file, or archive for a skill with other files), a url, and a digest, the file's SHA-256 hash, written as sha256: and 64 lowercase hex characters. A url may be relative: assistants read it starting from your tasks.endpoint address. A skill gives no account access and no approval. Publishing skills is optional (spec 9.4). If different sessions can get different versions of a skill, give each version its own address, because an assistant rejects a file whose digest does not match (guides: excluded tasks and feedback).
feedback.endpoint is an HTTPS address where assistants report a person's task that your company offers no way to do through the protocol (spec 9.3). If your APIs also serve other apps that do not read poppy.json, and you keep a way to send feedback there for them, say in its description that assistants use feedback.endpoint instead (guides: excluded tasks and feedback).
Tools that help
Datalayer publishes an open source SDK for Python and TypeScript (on GitHub). It was pre-beta when this guide first listed it, and it was built against a pre-release text of Version 0.4, the version before 1.0, so it can differ from the 1.0 this guide explains. It is written mainly for assistants, so check what it covers before you build on it.
Checks this level turns green
These are the checker's rows for this level, by their ids in the check catalog. Building what this level describes, and following the guides it links, is what makes them pass. A row that checks something you do not offer does not apply. The checker grades Version 1.0, as this guide does, and grades every poppy.json by its rules. A file written for Draft 0.4 or earlier fails the version check unless its supported_versions links a 1.0 document on the same host, because assistants built for 1.0 do not use older files.
Checked today (36)
T0-01Document existsT0-02Redirects safeT0-03Valid JSON objectT0-04Version a 1.0 agent can useT0-27Other version documents consistentT0-05Organization names its own hostT0-06Has an interfaceT0-07Issuer identifiedT0-08All URLs HTTPST0-SIBPublished on the requested hostT0-09Issuer metadata reachableT0-10Issuer matchT0-11Domain bindingT0-36Issuer metadata URLs well formedT0-12Required endpointsT0-22Signing algorithms validT0-34Signing algorithm list advertisedT0-23Same sign-in on every domainT0-24Switched off consistentlyADV-PKCENo plain PKCET0-13Scopes definedT0-14Mediated sign-in well formedT0-19Extensions named correctlyT0-20Extensions advertised fullyT0-15Conversation entriesT0-16API entriesT0-17OpenAPI parsesT0-18MCP resource metadataT0-37Tasks endpoint usableT0-39UCP entry lists the UCP extensionT0-40UCP profile offers AskX-01Same MCP server everywhereX-02Same organizationX-04Domains coveredX-10Shared token endpoint lists both protocols' grantsX-12Consistent 401s
Level 2: Let agents in, signed out
Assistants sign every request with a Session header that says who they are and which person and session the request is for. You check it before you rely on it, with no sign-in server needed.
- Rough size
- Medium. A check in front of every API that verifies signed headers against each assistant's published keys. Days to weeks, less if one gateway does it for all your APIs.
- Checks it turns green
- 4, all checked today
Everything happens in a session
Everything an assistant does at your company happens in a session: one person's activity, at your company, through one assistant, across your APIs, conversations and website. A session starts signed out. You know which assistant is asking and you can recognise the same person over time, but you do not know who they are (spec 5).
There is no step to start a session and no token to hand out. The assistant names the session itself and signs every request it sends you with a Poppy-Session header; the first request with a new session ID starts the session. A signed-out request carries that header and no access token. Signing in, in level 3, adds an ordinary OAuth access token next to it, and stays separate (spec 5, spec 5.4). So this level needs no sign-in server at all.
You choose how much of this to use. An endpoint that uses nothing from the session, such as a product catalog, can answer without checking the header. To recognise a person, keep a cart, or connect a conversation with the website, you must check the header first (spec 5.3, guides: choosing capabilities).
The assistant publishes who it is
Each assistant publishes its own metadata at an HTTPS address, and that address is its client_id. You fetch it to learn the assistant's name and logo, the public keys it signs with, and where sign-in may send people back (spec 4.1). From the spec's example, for an assistant at agent.example:
Client metadata, published by the assistant
{
"client_id": "https://agent.example/agent.json",
"client_name": "Example Agent",
"logo_uri": "https://agent.example/logo.png",
"jwks_uri": "https://agent.example/jwks.json",
"redirect_uris": ["https://agent.example/oauth/callback"],
"token_endpoint_auth_method": "private_key_jwt"
}
The client_id inside must equal the address you fetched it from. The jwks_uri, the assistant's list of public keys, must be an HTTPS address on the same domain as the client_id (spec 4.1).
Details for implementers: fetching and limiting assistants
- Fetch the
client_idaddress without following redirects, and cache the metadata and keys within limits (spec 5.3, guides: verifying personal agents). - You decide which assistants you accept. You may keep lists of assistants you allow or block, and limit how fast new sessions and new
client_idvalues arrive. A refused assistant getsinvalid_sessionat your APIs (spec 4.1, guides: verifying personal agents).
Every request carries a Session header
On every request to your APIs, conversations and other protocol endpoints, such as your tasks.endpoint (level 1), the assistant sends a Poppy-Session header. It holds a JWT, a small piece of JSON with a signature, that the assistant signs for that one request. Next to it go Poppy-Version, and Poppy-Extensions when the assistant uses extensions with you, both explained below (spec 5.2, spec 9):
Session JWT for a signed-out request, from the spec's example (header, then claims)
{
"typ": "poppy-session+jwt",
"alg": "ES256",
"kid": "9E421cSqd5UfAq5slDKYxXQd8Zmm8B3CIsT9cDxRHx8",
"poppy_dlg": "eyJhbGciOiJFUzI1NiIsInR5cCI6InBvcHB5LWRlbGVnYXRpb24rand0Iiw…"
}
.
{
"iss": "https://agent.example/agent.json",
"aud": "https://auth.example.com",
"sid": "Yx2b7Qd_Kp8mR3vT1nWc4A",
"sub": "usr_Q7c1vK",
"htm": "POST",
"htu": "https://api.example.com/orders/ord_7Hk2/exchanges",
"iat": 1790900000,
"jti": "e1j3V_bKic8-LAEBq7Rw2g"
}
The claims, all from the spec (spec 5.2):
issis the assistant'sclient_id.audis your company's identifier: your issuer, orhttps://and your domain if you have none (level 1).sidis the session ID, chosen at random by the assistant and never reused.subis a user ID the assistant makes for this person at your company. It stays the same across sessions, it is different at every company, and it is never made from personal details such as an email address (spec 5.1).htmandhtuare the request's method and address, so a copied JWT works only for the same request.iatis when it was signed, andjtiis unique.athis a hash of the access token, present only on signed-in requests (level 3).
The JWT is not signed with a key from the assistant's jwks_uri. It is signed with a short-lived delegated key, and its header carries, in poppy_dlg, a delegation: another JWT, signed with a key from jwks_uri, that vouches for the delegated key for at most 24 hours. Each delegated key signs for one user ID only, so a leaked key exposes one person at one company (spec 5.2).
Check the Session header
Before you rely on anything in the header, such as who the assistant is, which person this is, or which session or cart the request belongs to, check it in this order (spec 5.2, spec 5.3, spec 3.4):
- Fetch the client metadata from
iss, without following redirects, and the keys from itsjwks_uri. - Verify the delegation with the key its
kidnames:typispoppy-delegation+jwt, itsissis the JWT'siss, it has not expired, and itsexpis at most 24 hours after itsiat. - Verify the Session JWT with the key in the delegation's
cnf.jwk, and check that the JWT'skidis that key's thumbprint. Reject a JWT with no delegation, including one signed directly with a key fromjwks_uri. - Check
typispoppy-session+jwt,audis your identifier character for character,htmandhtumatch the request, andiatis recent, for example within the last minute. - If the request has an access token, check that
athmatches it and that the token was issued to the sameclient_id. Without one,athmust be absent. - Look up the session by
client_id,sidand user ID together. A combination you have not seen starts a signed-out session, and a known one continues its session. So a knownsidwith a different user ID names a different session; it is not an error. - Check
Poppy-Version, as the next step describes.
You must accept delegations signed with ES256 and with PS384 (spec 5.2). Reject alg: none and symmetric algorithms such as HS256 (guides: signing and verifying JWTs). Do not expect a person's delegated key to stay the same between requests or sessions, or treat a new one as a reason to reject a request. You may reject, with invalid_session, a Session JWT whose delegated key has already signed for a different user ID while a delegation for that key lasts. That limits a leaked key to one person (spec 5.2, guides: sessions).
If a check fails, answer HTTP 400 with {"error": "invalid_session"}. When a session you ended comes back, answer 400 with {"error": "session_ended"}, and the assistant starts a new one. These use 400, not 401, so OAuth libraries do not throw away a valid access token. A request with no header at all also gets invalid_session when handling it depends on the session (spec 5.3, spec 5.5).
Details for implementers: where and how to check
The guides suggest checking the header in one place, such as a gateway in front of your APIs, your conversation endpoint and your browser join, and passing the verified client_id, sid and user ID to the services behind it. Cache verified delegations by a hash of the whole delegation until they expire, so most requests need one signature check. Behind proxies, compare htu with the public address the assistant used, not the Host header your server receives (guides: verifying the Session header).
Rejecting a reused jti is optional. If you keep a list of seen jti values, share it across every server (spec 5.3, guides: verifying the Session header).
Keep a session record, which you find by client_id, sid and user ID, only as long as the session lasts. Remember the sid of each session you end for a while, so it gets session_ended instead of silently starting again (spec 5.5, guides: sessions).
At your APIs, conversations and other protocol endpoints, accept the header and any access token without asking for cookies, and never accept either from a URL (spec 5.6). Serve each endpoint at the address you publish: if an API or protocol endpoint answers with a redirect, the assistant must not send a token, Session JWT or credentials to the new address (spec 3).
The spec also recommends that assistants sign their requests with Web Bot Auth, so bot defenses at your edge can recognise the assistant's operator before the request reaches your application. That signature does not replace the Session header (spec 5.3, guides: operator signatures and bot defenses).
Check the version and extensions
A company can serve several versions of the protocol at once. Level 1 shows how poppy.json lists them, in protocol_version and supported_versions. The assistant chooses the newest one that it can work with, and names the version it implements in a Poppy-Version header on every request that carries the Session header. When it uses extensions with you, it also names them, one version of each, in a Poppy-Extensions header. From the spec's example (spec 3.4):
Request headers, from the spec's example
Poppy-Session: eyJ0eXAiOiJwb3BweS1zZXNzaW9uK2p3dCIs…
Poppy-Version: 1.0
Poppy-Extensions: "operations";v="3", "links";v="1"
Poppy-Versionis a version as major.minor, such as1.0. Two versions are compatible when they have the same major version and, before 1.0, the same minor version too.Poppy-Extensionsis a list of extension names in quotes, each with the version it uses inv. Every name is one from theextensionsin the file the assistant chose. A request without the header, or with one that cannot be read, declares no extensions.- The assistant sends the same values on every request in a session. To change them, it starts a new session.
Requests without the Session header, such as fetching poppy.json or signing in, carry neither header (spec 3.4).
Wherever you verify the Session header, you must check Poppy-Version too. If it is missing, or names a version that is not compatible with one you serve, answer HTTP 400 with {"error": "version_unsupported"}, and do not handle the request under some other version instead. The assistant then fetches poppy.json again, without a cached copy, and chooses again. If it chooses another version, it starts a new session and sends the request once more (spec 3.4). If you serve one version, this check is all you need (guides: serving several versions).
From 1.0, each side sends only what the other side's version defines. Never send an assistant a field, value or event that only a minor version later than its request's Poppy-Version defines, and the assistant sends you nothing that only a version later than the protocol_version of the file it chose defines. So when a 1.1 adds a feature, you offer it only to assistants that send 1.1 or later, and handle a request from a 1.0 assistant as 1.0 defines (spec 3.4).
Handle each request by the extensions it declares, not by the assistant's client metadata, which does not list them. You may refuse a request you can handle only with an extension that the request does not declare, in a version you list, unless the request itself uses the extension. Answer HTTP 403 with extension_required and the extension's name in extension, in a JSON body (spec 3.3, spec 4.1):
Response body, from the spec's example
{ "error": "extension_required", "extension": "example.com/gift-wrap" }
Details for implementers: serving more than one version
- Accept every version you list at your endpoints, and tell them apart by
Poppy-Version. Where a version needs its own endpoint, give that version's file its own address (guides: serving several versions). - You may warn that you plan to stop serving a version with the
DeprecationandSunsetheaders on responses in that version (spec 3.4). The guides suggest sending them for a while, then removing the version fromsupported_versions, then no longer accepting it (guides: serving several versions). - You can offer several versions of an extension the same way, and handle each request by the version it declares (guides: serving several versions).
- From 1.0 on,
Poppy-Versionandversion_unsupportedkeep their meaning in every version, so an assistant and a company on different major versions can always find one they share, or tell that there is none (spec 3.4).
Pages fetched without a browser
An assistant sometimes fetches a page of your website with its own HTTP client, not a browser, for example to read a help article. It should send the Session header with that request too, so you can tell which assistant and session it comes from. A browser, even a headless one with no screen, joins the session instead, as level 4 describes (spec 5.2, spec 6).
- It goes only to HTTPS pages whose host is exactly your
organization.domain, the host that servedpoppy.json. Other hosts on your domain do not get it. - It never comes with an access token, so the JWT has no
athand the request is always signed out, even when a browser in the same session is signed in. - When a page redirects, the assistant signs a new Session JWT for the new address only if it is still on that host. Otherwise it follows the redirect without the header.
You do not have to check the header on these pages. If you use it, for example to recognise the assistant or keep the request in its session, verify it first, including Poppy-Version, as at any endpoint. When the check fails, answer invalid_session, so the assistant learns its header has a mistake. It may then fetch the page again without the header. Otherwise assistants must not leave the header out to look like a person (spec 5.2, spec 5.6, guides: verifying the Session header).
Setting web.disabled asks assistants not to use a browser on your website. It does not cover these requests (spec 6).
List your APIs
Now you can add apis to poppy.json. Every API you list must accept the Session header and, once you offer sign-in, your access tokens, and enforce their scopes (spec 7). Each entry has a type, a url, and a short description that helps the assistant pick the right API (spec 3.1):
Excerpt from poppy.json
"apis": [
{
"type": "openapi",
"url": "https://api.example.com/openapi.json",
"description": "Orders, returns, and exchanges"
},
{
"type": "mcp",
"url": "https://mcp.example.com/mcp",
"description": "Product search and sizing"
}
]
The spec defines two types, and assistants skip types they do not know, so later versions can add more (spec 7):
openapi: theurlpoints to an OpenAPI 3.0 or 3.1 description. OpenAPI is a standard file that describes a web API's requests and responses.mcp: theurlpoints to a remote MCP server using the Streamable HTTP transport and MCP version 2025-06-18 or later. MCP, the Model Context Protocol, is a common way to offer tools to AI assistants.
A language model usually reads these descriptions to choose and call your operations, so say what each one does in terms of the person's task, and keep them short (guides: describing APIs).
MCP servers
An MCP server carries the Session header like any other API. One that accepts the header can take signed-out calls with it alone. One that ignores the header can still work, but its calls do not join the session's cart, conversations or website (spec 7).
When the server offers account access, it publishes protected resource metadata (RFC 9728), the same kind of file as in level 1, for its own address. Its resource must equal the server's url in poppy.json, and its authorization_servers must include your issuer. That is how MCP clients find where to get a token. Assistants find this file from the server's address, as RFC 9728 defines, and treat it as missing if its resource is not that address. Unlike an ordinary MCP client, an assistant leaves the server out of sign-in: the person signs in once, without resource, and the assistant then asks your token endpoint for a token with resource set to the server's url, when sign-in completes or at a refresh. So your sign-in server must issue that token after a sign-in that named no resource, as level 3 explains. A token issued for the server works only at the server whose url equals its resource, not even at other paths on the same host (spec 4.5, spec 7, guides: verifying the Session header).
When a request needs a token it does not have, the server answers 401 with a challenge for each scheme it accepts, and each challenge includes resource_metadata with the address of that metadata (spec 7). MCP clients that do not use Poppy sign in with MCP's own flow, outside the protocol, and their requests belong to no session (spec 7).
What your APIs answer
Access token problems follow OAuth and go in the WWW-Authenticate header. Session, version and extension problems go in a JSON body (spec 7):
- 401 with no error code: the request needs the person's account and has no access token. Name the scopes needed in the challenge's
scopeattribute. invalid_token(401): the access token is expired, revoked or not valid.insufficient_scope(403): the access token lacks the scopes the request needs, named inscope.invalid_session(400, JSON body): the Session header is missing or fails a check, or you refuse this assistant.session_ended(400, JSON body): the session has ended. The assistant starts a new one and tries once more.version_unsupported(400, JSON body):Poppy-Versionis missing, or you do not serve a compatible version. The assistant fetchespoppy.jsonagain, and if it chooses another version, starts a new session and tries once more.extension_required(403, JSON body): the request needs an extension it does not declare inPoppy-Extensions, named inextension. It is not an access token error, so it does not go inWWW-Authenticate. An MCP server returns it only to refuse the assistant entirely, not for one tool (spec 3.3).
If you limit request rates, answer HTTP 429 with a Retry-After header, on any endpoint (spec 5.6). The guides suggest letting a signed-out session do whatever a signed-out visitor can do on your website, and limiting abuse by client_id rather than turning assistants away (guides: guest access). Keep error text free of account details and other people's data (guides: error messages).
Tools that help
Datalayer's SDK, which was pre-beta when this guide first listed it, includes Session JWT signing and verification for Python and TypeScript (on GitHub). It was built against a pre-release text of Version 0.4, so it can differ from version 1.0, and it is written mainly for assistants, so check what it covers before you build on it.
Checks this level turns green
These are the checker's rows for this level, by their ids in the check catalog. Building what this level describes, and following the guides it links, is what makes them pass. A row that checks something you do not offer does not apply. The checker grades Version 1.0, as this guide does, and grades every poppy.json by its rules. A file written for Draft 0.4 or earlier fails the version check unless its supported_versions links a 1.0 document on the same host, because assistants built for 1.0 do not use older files.
Checked today (4)
T1-02Error bodies leak nothingT1-05MCP server challenges unauthenticated initializeT1-14Protocol endpoints answer without a redirectT1-18Rate limits say when to retry
Level 3: Let people sign in
People sign in with plain OAuth on your own pages, choose what each assistant may do with their account, and can disconnect it later.
- Rough size
- Large. Sign-in and consent pages, scope descriptions, refresh tokens, sign out, and an account settings page. Weeks, less if your OAuth server already does most of it.
- Checks it turns green
- 4, all checked today
Choose how people sign in
A session does not need sign-in. When a task needs the person's account, the person signs in, and from then on the assistant sends an ordinary OAuth access token next to the Session header. Sign-in is plain OAuth, so you can usually keep the OAuth server you already run, and it does not need to know about sessions (spec 4, spec 5.4).
You say which kinds of sign-in you offer in your OAuth metadata, not in poppy.json, by the grants in grant_types_supported (level 1) (spec 3.2, spec 4):
- Direct sign-in (
authorization_code): the person signs in on your own page in their browser and approves access. - Device sign-in (
urn:ietf:params:oauth:grant-type:device_code): the assistant shows the person a link and a short code, and they sign in on your page on any device they like. - Mediated sign-in, an extension: the assistant sends you the person's credentials. It is a stopgap, and it puts more on you (see the end of this level).
Direct sign-in is the preferred kind. If you offer sign-in, you should offer direct sign-in, and assistants should use it when you do. Device sign-in stays in the protocol, but it is easier to use for phishing (spec 4). The guides point out that RFC 10027 §6.2.1.5 advises against device sign-in for sensitive or high-value accounts, so a company such as a bank may offer only direct sign-in (guides: device sign-in).
An assistant authenticates to your token endpoint as a confidential OAuth client, with a client assertion: a JWT signed with a key from its jwks_uri (private_key_jwt, RFC 7523). Its aud must be your issuer as a single string; reject any other aud, your token endpoint's address included. Its exp is at most 5 minutes after its iat: you may reject an assertion that lasts longer, and must not reject one for lasting 5 minutes or less. You must accept assertions signed with ES256 and with PS384 (spec 4.1). The guides add: accept any RSA key of 2048 to 4096 bits (guides: signing and verifying JWTs). If your OAuth server accepts client metadata documents, the guides suggest saying so with client_id_metadata_document_supported: true in its metadata, for other clients such as MCP clients. Assistants don't need it (guides: verifying personal agents).
Your metadata is public, so every client sees the same grants. To offer assistants less than your other apps, limit the scopes you grant by client, or refuse one assistant sign-in, or one kind of it, with unauthorized_client; that assistant carries on signed out. To turn sign-in off for every assistant, use auth.disabled (level 1) (spec 4, spec 4.1, guides: offering personal agents less). While you set it and have never issued a refresh token to an assistant, you have no tokens to protect: answer every refresh with invalid_grant and every revocation with success, and you may do so without checking the client assertion. Once you have issued one, or turn sign-in on, check client assertions as usual (spec 3.2).
Describe your scopes
A scope is a named piece of account access. You use your own, usually the OAuth scopes you already have, such as orders:read or addresses. The protocol defines just one, poppy:browser-sign-in, which lets the assistant sign its browser in to your website (level 4) (spec 4.7).
List the scopes assistants can ask for in scopes_supported: in your OAuth server's metadata, in your domain's protected resource metadata, or in both. Assistants use the scopes in either list. Your OAuth server's list covers every app and service it serves, so if you can't tailor it, such as with a hosted or shared server, list the scopes for assistants in your protected resource metadata instead (spec 3.2, spec 4.7, guides: offering personal agents less).
Describe each scope you offer assistants, so they can pick the ones a task needs: in the OAuth security scheme of an OpenAPI description you list, or otherwise in auth.scopes in poppy.json. If both describe a scope, assistants use the one in auth.scopes. You may also say how much each scope can do, in auth.scope_hints. From the spec's example (spec 3, spec 4.7):
Excerpt from poppy.json
"auth": {
"scopes": {
"orders:read": "See your orders, returns, and bookings. Needed to track an order or find one to change",
"orders:write": "Exchange or return items, and change bookings. Needed for any change to an order",
"addresses": "See and change your saved shipping addresses. Not needed to enter an address at checkout",
"poppy:browser-sign-in": "Use the website signed in, with the other access you approve"
},
"scope_hints": {
"orders:read": { "changes": "none", "personal_data": true },
"orders:write": { "changes": "irreversible", "personal_data": true },
"addresses": { "changes": "reversible", "personal_data": true }
}
}
Each hint describes the most serious action the scope allows, and must have both fields. changes is none, reversible or irreversible; personal_data is true if any action shows or changes the person's personal data, such as an address or a payment method (spec 4.7). A description is most useful when it says what the scope unlocks, which tasks need it, and whether a task can be done without it, such as a scope that only personalizes search results (spec 4.7). The guides add: write it in words a person understands, name the tasks the way a person would ask for them, such as "Needed to track an order" rather than "Read orders", describe every scope you offer, including ones a task can do without, and leave a scope out of the hints rather than guess (guides: describing scopes).
Every sign-in request names its scopes in scope. Reject missing or unknown ones with invalid_scope, and never grant more than was asked for. You may grant fewer (spec 4.7). You decide which actions need each scope, and you enforce that on your APIs and your own agent alike. One shared check that every channel calls is easiest to keep consistent. Your website may not be able to apply your scopes yet. It can then give a signed-in browser everything the account can do, and poppy:browser-sign-in stands for that full access (level 4) (spec 4.7, guides: enforcing scopes everywhere).
Direct sign-in
Direct sign-in is the standard OAuth authorization code flow with PKCE (RFC 7636). PKCE ties the one-time code to the assistant that asked for it. It is the preferred kind of sign-in (spec 4, spec 4.2).
- The assistant opens your
authorization_endpointin the person's browser, for example in a new tab, a popup, or a link sent to their phone. - The person signs in however you allow, such as a password or a passkey, sees the requested scopes, and approves some or all of them, or declines.
- You send the browser back to
redirect_uriwith a one-timecode. Theredirect_urimust exactly match one of the assistant'sredirect_uris. Include your issuer iniss, on a decline (error=access_denied) too. - The assistant exchanges the code at your
token_endpoint, with its client assertion.
All of these steps are in the spec (spec 4.2). The guides add: accept PKCE with S256 only, and reject plain (guides: consent pages).
The assistant's request in step 1 must include prompt=consent, from OpenID Connect, unless the assistant receives the redirect only on the device that opened your page. You should support it, even if you don't otherwise support OpenID Connect, and then show your consent page even when the account already granted every requested scope to that assistant. A server that doesn't support it ignores it (spec 4.2).
You may require Pushed Authorization Requests (PAR, RFC 9126), with require_pushed_authorization_requests set to true in your sign-in server's metadata, next to its pushed_authorization_request_endpoint. The assistant then first sends the request to that endpoint with its client assertion, and opens your authorization_endpoint with only client_id and the request_uri it gets back, so you know which assistant asked before the person sees your page. Assistants should use PAR whenever your metadata lists the endpoint, required or not (spec 3.2, spec 4.2). The guides suggest requiring it where sign-in grants access with meaningful consequences, such as payments, and giving each request_uri a lifetime of a minute or two (guides: consent pages).
Opened on another device, such as from a link sent to the person's phone, direct sign-in is a cross-device flow, like device sign-in. A cross-device flow is one where the sign-in starts on one device and is approved on another. So if you offer direct sign-in, you must follow the best practices for these flows in RFC 10027 §2, as for device sign-in. Where it can, the assistant receives the redirect only on the device that opened your page, so a forwarded link fails (spec 4.2, spec 10.8).
Device sign-in
Device sign-in is the OAuth device authorization grant (RFC 8628). The assistant asks your device_authorization_endpoint for a code, with the scopes it needs and its client assertion, then shows the person your link and the short code. The person opens it on any device, such as their phone, signs in, and approves or declines. Opening the link must not approve anything by itself. Meanwhile the assistant asks your token_endpoint every interval seconds until the person finishes (spec 4.3).
Assistants show the link only if its host is your issuer's host or your organization.domain, or a subdomain of either, so serve your device page there. Other addresses in your issuer's protected_resources don't count. If one issuer serves several domains, a page on the issuer's host works for all of them (spec 4.3, guides: device sign-in).
Device sign-in is always a cross-device flow, and it is easier to abuse for phishing than direct sign-in on the person's own device, because whoever holds the device code gets the tokens. So companies that offer it must follow the best practices in RFC 10027 §2 (spec 4.3). The guides suggest: offer direct sign-in too; assess the risk before you offer device sign-in; use short-lived, single-use codes, rate limits and limited scopes; ask the person to confirm that the code on your page matches the one the assistant shows; answer slow_down to an assistant that asks faster than interval; and keep expires_in short, such as 10 minutes (guides: device sign-in).
Sign-ins someone else started
Nothing in a direct or device sign-in says who approved it. The tokens go to whoever started it. So someone can start a sign-in with an assistant they use, send the link to another person, and get tokens for that person's account if they sign in and approve. You see a genuine request from the assistant, and the assistant sees a valid answer, so neither of you can tell (spec 10.8).
The protocol accepts this risk, as OAuth does for cross-device flows, and limits it in three ways (spec 10.8):
- Where it can, the assistant receives the redirect only on the device that opened your page, so a forwarded link fails.
- Your sign-in and consent pages name the assistant that wants to connect, and tell the person to continue only if they just asked it to (see the next step). A person who doesn't use that assistant, or didn't ask, can decline.
- Both kinds of sign-in follow RFC 10027 §2, such as short-lived requests and limited scopes.
The last two are yours to do. The wording on your pages doesn't help when the person tricked uses the same assistant.
The consent page
The page where the person approves access, in direct and device sign-in. The guides suggest (guides: consent pages):
- Start with a heading that names the assistant and says it wants to connect to the person's account, such as "Muse wants to connect to your Example account". Show it on your sign-in page too, before the person signs in, since that's where they decide whether to go on. Word it as connecting, not as "Sign in with Muse", which reads as signing in with a Muse account.
- Tell the person to continue only if they just asked that assistant to connect, such as "Only continue if you asked Muse to do this just now." Anyone can start a sign-in and send someone the link.
- Let the person sign in with a passkey or another phishing-resistant method, as on your website. Passkeys work here because the person signs in on your own page; they can't work with mediated sign-in. A passkey protects against fake sign-in pages, but not against approving a sign-in someone else started.
- Show the assistant's name and logo from its metadata, and the domain of its
client_id. The assistant chooses its own name, so the domain is what the person can trust. - Show the account being connected, each scope in plain language, and how long access lasts. Group related scopes rather than listing their names. Point out the scopes your hints mark
irreversibleor with personal data. - When
poppy:browser-sign-inallows everything the account can do on your website, say so in plain words, such as "Use the website as you, with full access to your account", and let the person leave it out while approving the rest. If your issuer serves several domains, name each website it signs in to, such as "Use example.com and example.co.uk as you". - When the person already granted some of the scopes, mark which ones are new, but still list them all.
- Show the page in device sign-in, and in direct sign-in when the request has
prompt=consent, even if the person approved every scope before. - Protect the page against forged requests, and stop other sites from framing it with
Content-Security-Policy: frame-ancestors.
Some of this advice is in the spec. Your consent page must list every scope you will grant, except a poppy:browser-sign-in you may grant without asking (level 4); you may mark the ones the person already granted. Every person using an assistant shares its client_id, so a page that hides scopes granted before, or is skipped because the account already granted them, can give a sign-in someone else started access the person approving never saw. So you should show the page for every device sign-in, and for every direct sign-in with prompt=consent (spec 4.2, spec 4.3, spec 10.8).
Part of the browser advice is a requirement too. When poppy:browser-sign-in gives full access on your website, you must describe the scope that way, and in direct and device sign-in you must ask the person to approve it like any other scope (level 4) (spec 6).
What sign-in returns
Every kind of sign-in ends with the standard OAuth token response: an access token and a refresh token (spec 4.7):
Response body after sign-in
{
"access_token": "eyJhbGciOi…Qp4w",
"token_type": "Bearer",
"expires_in": 3600,
"refresh_token": "pat_8Hk2…Wq1",
"scope": "orders:read orders:write"
}
The person may have approved fewer scopes than asked, so scope says what you granted; you may leave it out only when you granted exactly what was asked. A sign-in grants at least one scope: if the person approves none, it ends as a decline (spec 4.7).
Sign-in does not belong to a session. One sign-in can serve several of the person's sessions, and a session is signed in on each request that carries an access token, with that token's account and scopes. You may refuse a request whose access token is for a different account than its session used before, with session_ended (spec 5.4).
Access tokens
A signed-in request carries the access token in the Authorization header, with the scheme token_type names, and the Session header next to it, whose ath covers the token. Whether you bind access tokens to a key with DPoP (RFC 9449) is your choice, as in plain OAuth. Assistants that support DPoP send a proof with their token requests when your metadata lists dpop_signing_alg_values_supported. You then decide for each token whether to bind it, and return token_type Bearer for one you don't. Assistants use each DPoP key for one user ID only, as they do each delegated key (level 2), so a key never links two user IDs (spec 4.5).
Without DPoP, a copied token is still of little use: the Session header ties it to the client_id it was issued to, and only the assistant can sign that header (spec 5.2, guides: verifying the Session header).
By default, one access token works at all of your services. A service that accepts only tokens issued for it, as MCP servers do, says so in its own protected resource metadata, with a resource other than your domain. That resource must be the service's own address, the one the assistant built the metadata address from, as RFC 9728 §3.3 requires; otherwise the assistant treats the metadata as absent. The assistant then asks for a token with resource set to it, and uses that token only there. Accept such a token only at that service (spec 4.5). The guides suggest access tokens that last hours, not days (guides: token lifetimes and sign-out).
The person signs in once for all of your services, and approves scopes, not services. So the assistant should leave resource out of the request that starts sign-in, and a sign-in without resource covers every service you offer assistants, including ones you add later. Each later token request, the one that completes sign-in or a refresh, names one resource to get a token for that service, or none for the default token. After such a sign-in you must issue a token for any service you offer assistants, at refresh too, and it may carry only the scopes that service uses, named in the response's scope. You may leave a service out, for every assistant or by client_id: answer invalid_target for a resource you do not serve or do not offer that assistant, which then does not use that service signed in. If a sign-in does name resources, you may limit it to those, and then only one that named your domain gets the default token (spec 4.5). The guides add: configure your sign-in server to treat a sign-in without resource as covering each of your services, and to issue their tokens at refresh (guides: verifying the Session header).
Refresh tokens
The refresh token stands for the person's approval. The assistant sends it to your token_endpoint with grant_type=refresh_token and its client assertion to get new access tokens, without asking the person again. It may ask for fewer scopes than the refresh token has, and for a token for one service with resource, never for more (spec 4.4).
Request body to your token endpoint (excerpt)
grant_type=refresh_token
&refresh_token=pat_8Hk2…Wq1
&scope=orders%3Aread
&client_assertion_type=urn%3Aietf%3Aparams%3Aoauth%3Aclient-assertion-type%3Ajwt-bearer
&client_assertion=eyJhbGciOiJFUzI1NiIs…
You may return a new refresh token with a refresh, and the assistant then uses the new one; otherwise it keeps the old one. A refresh token is not tied to a session, so any of the person's sessions can use the access tokens it gets (spec 4.4). When a task needs more than the refresh token allows, the person signs in again, like the first time without resource, and the new refresh token replaces the old one (spec 4.5, spec 4.7). Answer invalid_grant for an expired or revoked refresh token; the assistant then carries on signed out (spec 5.5).
An assistant that sent a DPoP proof when it got a refresh token sends a proof from the same key with every refresh of it, and of the refresh tokens that replace it. It keeps that key until the person signs in again, or until an extension you require says how to replace it. You may bind a refresh token, and the ones that replace it, to that key: then answer invalid_grant to a refresh whose proof is missing or from another key. Client assertions can be available to every person using an assistant, so without the binding, a copied refresh token could be used with a new key (spec 4.4).
How long a refresh token lasts is up to you, and using one may extend it: Poppy no longer fixes a lifetime (spec 4.4, changelog: 0.4 minor changes). The guides suggest a lifetime that fits the account, such as 90 days, long enough that people don't have to sign in again often, and expiring ones that go unused sooner. They also suggest (guides: token lifetimes and sign-out):
- Consider issuing a new refresh token on each refresh, and revoking the grant when an old one is used again (RFC 9700 §4.14.2). If a refresh token is copied, the grant then ends as soon as both copies have been used.
- Where account access has meaningful consequences, bind refresh tokens to the DPoP key they were issued with, so a copied refresh token is useless without the key.
- If an assistant's signing key may have leaked, revoke every refresh token issued to its
client_idthat isn't bound to a DPoP key.
Signing out and disconnecting
To sign out, the assistant revokes its refresh tokens at your revocation_endpoint (RFC 7009), with token_type_hint=refresh_token and its client assertion. The account is signed out once no refresh token you issued to that assistant for it is still valid. Its sessions carry on signed out: the assistant keeps sending the Session header, without an access token (spec 4.6, spec 5.5).
Access tokens issued before sign-out may still work. The guides suggest invalidating them when their refresh token is revoked, or checking on each request whether the sign-in is still active, so sign-out takes effect right away. If you can do neither, keep access tokens to a few minutes (spec 5.5, guides: token lifetimes and sign-out).
People can also disconnect an assistant from your account settings. That revokes its refresh tokens for the account, and it finds out from invalid_token or invalid_grant (spec 5.5). The guides suggest listing each connected assistant in account settings with its name, domain, scopes and when it was last used, with a control to disconnect each one (guides: account settings).
If you offer mediated sign-in
In mediated sign-in, the assistant signs in for the person with credentials the person gave it, such as an email and password. It is an extension: an extra grant type at your token endpoint, so it uses OAuth's client authentication, errors and token responses (mediated sign-in 1).
It is a stopgap. Offer it only until you can add direct or device sign-in, and stop once those cover the scopes it grants. The protocol plans to retire it on March 17, 2027 (mediated sign-in 1). Assistants are told to prefer direct or device sign-in when you offer them (mediated sign-in 6).
To offer it, list the extension in poppy.json with the credential fields you need and the scopes it can grant, and list the grant type https://personalagentprotocol.org/grant/mediated-sign-in in your issuer's grant_types_supported. Like every extension in poppy.json, it is a list, with an entry for each version you support; this page describes version 1 (spec 3.3, mediated sign-in 2):
Excerpt from poppy.json
"extensions": {
"mediated-sign-in": [
{
"version": "1",
"fields": [
{ "name": "email", "label": "Email", "secret": false },
{ "name": "password", "label": "Password", "secret": true }
],
"scopes": ["orders:read"]
}
]
}
Each field has a name, the parameter the assistant sends, which must not clash with an OAuth parameter such as grant_type or scope; a label, what to ask the person for; and secret, which marks a value the assistant must protect. Never grant more than the scopes listed here, and include them in scopes_supported too, in your OAuth server's metadata or your protected resource metadata (mediated sign-in 2).
Assistants declare most extensions they use in the Poppy-Extensions header (level 2), but not this one: your token endpoint doesn't receive that header, and you know the extension from the grant type. So your token endpoint never answers extension_required (spec 3.3, mediated sign-in 2).
Details for implementers: the mediated sign-in requests
The assistant posts to your token_endpoint with the grant type, its client assertion, scope, and every field as a parameter. If the credentials are right and nothing else is needed, return the token response above (mediated sign-in 3).
If you need a second step, send the person a one-time code and answer HTTP 400 with code_required, a sign_in_id, sent_to (where the code went) and expires_in. The assistant then sends the same grant with sign_in_id and one_time_code, and its client assertion, without the credentials or scope. A wrong code gets code_required again until your attempt limit, then invalid_grant. Only the client_id that started a sign-in can finish it (mediated sign-in 4).
Other answers are OAuth errors: invalid_grant when sign-in did not succeed, expired_token when it took longer than expires_in, access_denied when you refuse it, and invalid_scope. Rate limits are HTTP 429 with Retry-After (mediated sign-in 5).
The guides add: rate-limit attempts by account, by client_id and by network address; return the same invalid_grant for an unknown account and a wrong password; ask for a one-time code when a sign-in looks unusual, including an assistant's first mediated sign-in after the person disconnected it; never store raw credentials or codes, logs included; and tell the person, for example by email, when an assistant signs in (guides: mediated sign-in).
Checks this level turns green
These are the checker's rows for this level, by their ids in the check catalog. Building what this level describes, and following the guides it links, is what makes them pass. A row that checks something you do not offer does not apply. The checker grades Version 1.0, as this guide does, and grades every poppy.json by its rules. A file written for Draft 0.4 or earlier fails the version check unless its supported_versions links a 1.0 document on the same host, because assistants built for 1.0 do not use older files.
Checked today (4)
T0-26Offered scopes describedT0-35Requestable scopes listedT0-38Pushed authorization requests usableT1-01Token endpoint rejects a junk grant
Level 4: Optional surfaces
Let an assistant's browser join its session, let assistants talk with your own agent, ask for the person's approval before you act, and leave a step on your website to the person.
- Rough size
- Varies. Each surface is its own project: days for the browser join, weeks for conversations or operations.
- Checks it turns green
- 6, all checked today
These surfaces are independent of each other. Build any of them, in any order, once level 2 works. Operations on your website, and browser control, also need the browser join.
Let the assistant's browser join its session
Assistants can browse your website in the same session they use for your APIs and conversations, so you see one session for the person, signed in or not. This is optional. If you offer it, list web.browser_session_endpoint in poppy.json, and assistants must join their browser to a session before they browse. Without it, they browse as ordinary signed-out visitors (spec 6). The endpoint can be on any host you choose, such as accounts.example.com for example.com, but the join works only where the cookie it sets in step 3 reaches the pages assistants browse (spec 6).
Assistants can also fetch a page of your website with their own HTTP client, without a browser, for example to read a help article. They don't join a session for that. They should send the Session header from level 2 instead, only to pages on the host that served poppy.json, and never with an access token, so these requests are always signed out. If a page verifies the header, treat the request as signed out even when the session's browser is signed in, and answer a failed check with invalid_session, as at any endpoint. A headless browser is still a browser: it joins the session and doesn't send the header (spec 5.2, guides: verifying the Session header).
You choose how much of your website assistants can use. Assistants work faster and more reliably through your own agent or APIs, so the guides suggest starting there for the tasks people ask for most, then choosing one of four levels, from least to most (guides: browser sessions):
- No browsing. Set
web.disabledtotrue, and cover the tasks in your own agent or APIs. Assistants should not use a browser on your website. If you set it, you must listagentorapis, and must not listbrowser_session_endpoint. The protocol can't enforce it, because you can't always tell an assistant's browser from a person's, so it says what you prefer and isn't a promise that no assistant will browse. It doesn't cover pages fetched without a browser (spec 6). - Signed-out browsing. List
webwithout abrowser_session_endpoint. Assistants browse as ordinary signed-out visitors, and use your agent and APIs for anything that needs the account. - Signed-in browsing with the account's full access. List
browser_session_endpointand setweb.unscopedtotrue. This suits a website whose permissions don't match your OAuth scopes. The browser sign-in scope, below, then lets the browser do everything the account can do on your website. - Signed-in browsing with your scopes. List
browser_session_endpoint, and have your website apply the same scopes as your APIs.
If you offer sign-in and let assistants browse, the guides advise choosing 3 or 4 and listing browser_session_endpoint. Without it, a person who signed in through the assistant is signed out when it opens your website. Assistants don't type the person's password into a website, so the person has to sign in a second time, in the assistant's browser, or the task stops at the first page that needs the account. With the endpoint, the assistant joins its browser to the session it already signed in, and the person signs in once (guides: browser sessions, spec 6).
The join takes a one-time code in three steps. Only the browser that loaded your page can hand in its code, and only the assistant can approve it, so no one else can make a browser join a session (spec 6, spec 10.6).
- The browser opens your page. The assistant's browser loads the endpoint with a GET. You answer with an HTML page holding a form with a hidden
code, and set a short-lived cookie that ties that code to this browser. - The assistant approves the code. It reads the code from the page and posts it to the endpoint's address followed by
/authorize, with its Session header and, if signed in, its access token. You check the session and the token, check the code is yours, unexpired and not approved before, record it for that session and answer 204. A code that fails gets 400 with{"error": "invalid_request"}. An access token here must have thepoppy:browser-sign-inscope, explained below. Refuse one without it withinsufficient_scope, as at an API. The assistant then approves the same code without a token, or gets the scope and starts again at step 1. - The browser hands in the form. You check that the request carries the cookie from step 1 matching the code, and that the code was approved and not used before. Then you set your own cookie for the session, clear the step 1 cookie, and redirect to a page on your site. If not, set no cookie and answer with an error status.
Your answer to step 1, from the spec's example
HTTP/1.1 200 OK
Content-Type: text/html
Cache-Control: no-store
Content-Security-Policy: frame-ancestors 'none'
Cross-Origin-Opener-Policy: same-origin
Set-Cookie: __Host-poppy_join=Jq7mW2…; Path=/; Max-Age=60; Secure; HttpOnly; SameSite=Strict
<!doctype html>
<title>Connecting</title>
<form method="post" action="/poppy/browser-session">
<input type="hidden" name="code" value="bc_Vn3qT8xLw2Rk9mZ4yHc1Ad">
<button>Continue</button>
</form>
The page must not be stored by caches, framed by other pages, or kept as a window reference by the page that opened it, and loading it must not change any session or the browser's other cookies. The step 1 cookie must not be sent with a form from another site, and other hosts on your domain must not be able to set it. The code must be unguessable, short-lived and good once (spec 6). The example meets these: the guides suggest codes of at least 128 random bits that expire within 60 seconds, and answering a good form with 303 See Other and a bad one with 400 (guides: browser sessions).
The session's cookie is your own. It acts for the account and scopes approved in step 2, if any, must stop acting for the account when the person signs out or disconnects the assistant, and must not outlive the session (spec 6). A join without an access token should leave a login the browser already has alone, and a join with one signs the browser in to that account in its place. The guides suggest keeping this cookie separate from your login cookie, and making it Secure and HttpOnly, with the __Host- prefix when the endpoint is on the host assistants browse. When the endpoint is on another host, the cookie can't use that prefix and needs a Domain attribute instead. Set it to the narrowest domain that covers the hosts assistants need, because a cookie for example.com is sent to every subdomain (spec 6, guides: browser sessions).
The browser sign-in scope. Signing a browser in takes poppy:browser-sign-in, the one scope the protocol defines. If you list browser_session_endpoint and offer sign-in, you must support it, though you may grant it to fewer assistants or people, as with any scope. After a signed-in join, your website must do one of two things (spec 4.7, spec 6):
- Apply the cookie's scopes, as your APIs apply an access token's. The scope then allows nothing beyond the token's other scopes, and you may grant it without asking the person.
- Treat the scope as everything the account can do on your website. Then you must set
web.unscopedtotrue, so assistants know what the scope allows before they ask for it, and describe the scope that way, such as "Browse the website, and see and do anything your account can do there." In direct and device sign-in, ask the person to approve it like any other scope. In mediated sign-in, which has no consent page, you decide whether to grant it. Domains that share your sign-in server give the scope the same meaning, so if any of their websites is unscoped, each of them setsweb.unscoped.
For full access, the guides suggest giving the scope hints that match your website's most consequential action, usually irreversible with personal data, and showing it on your consent page as its own choice the person can leave out. When your sign-in server serves several domains, name the websites it signs in to, such as "Use example.com and example.co.uk as you" (guides: browser sessions, guides: consent pages).
Let assistants talk with your own agent
If you run your own AI agent, list it in poppy.json under agent.protocols. The protocol defined so far has the type poppy. Each entry must have a description that says in plain words what your agent can help with, such as orders and returns, or anything at all. Assistants read it to decide whether a conversation can serve the task, and to choose between your entries and your APIs. If your agent can do nothing useful until the person signs in, add "access": "signed_in", so the assistant can sign in first (spec 3.2, spec 8.1):
Excerpt from poppy.json
"agent": {
"protocols": [
{
"type": "poppy",
"endpoint": "https://api.example.com/poppy/conversations",
"description": "Anything about your orders, returns, account, and our products"
}
]
}
Conversations are JSON over HTTPS. Every request carries the Session header, and an access token when signed in, as in levels 2 and 3. A conversation belongs to the assistant and the user ID that started it, and to the account once it uses one, so any matching session can continue it. Refuse anyone else with conversation_not_found (spec 8.2). The one exception is the same assistant and user signed out after the conversation used an account: answer them with a sign-in challenge instead (spec 8.11). The endpoint takes six requests (spec 8.2):
POSTto the endpoint starts a conversation with its first message (spec 8.3).POSTto/messagesunder a conversation sends another message (spec 8.3).GETto/eventsreads messages and changes in order. The assistant passes acursor, the id of the last event it handled, and can wait up towaitseconds for something new. Every read includesconversation_id,events(empty when there are none),cursor,has_more, and the four state fieldsworking,handoff,responderandclosed(spec 8.5). Streaming the events is optional (spec 8.6).POSTto/handoffasks for a person at your company (spec 8.9).POSTto/handoff/cancelwithdraws that request. You may stop looking for a person, or keep looking if your help desk can't withdraw it, and the assistant reads which fromhandoffandresponder(spec 8.9).POSTto/closecloses the conversation (spec 8.12).
Every POST has a JSON body with an id that the assistant chooses, unique for the person across all its requests. A message's ID is its request's ID, so the message has no id of its own. A retry with the same ID, path and body gets the original answer and isn't acted on again, and the same ID with a different path or body gets request_id_conflict (spec 8.3).
A successful POST means you accepted the request, not that you acted on it, so its answer holds only conversation_id: 201 for a new conversation, 202 for the rest. Act on a conversation's messages, handoff requests and handoff cancels in the order you accept them, whatever their URL. With the wait query parameter, a POST also answers as a read of the events would, so the assistant can get your reply in the same request (spec 8.3).
Every read reports the conversation's state in four fields, each independent of the others (spec 8.7):
workingistrueonly while you are still replying: a request you accepted but haven't acted on, or a reply being written. Assistants read until it'sfalsebefore they treat your reply as complete, so report it from the moment you accept a request. It isn't recorded as an event. A stream sends it as aworkingevent instead. Work that finishes later, such as a refund that takes days, isn'tworking: say in a message that it's under way, and add another message when it's done (guides: conversations).handoffispendingwhile you look for a person to join, andnoneotherwise.respondersays who is handling your side right now:agentfor your AI,humanfor a person.closedistrueonce the conversation takes no more messages.
A new conversation starts with handoff set to none, responder to agent and closed to false. Each change to handoff, responder or closed adds a state event with all three. Your agent can keep answering while handoff is pending (spec 8.7).
Each message says who wrote it in author: its type is agent for an AI and human for a person (spec 8.4, spec 8.8). Messages can cross, so a short reply such as "Done" can be unclear. A message from your agent may carry as_of_request, the ID of the latest request it took into account, and the assistant's messages may carry as_of_cursor, the last cursor it had read. Both are only hints: neither side may depend on them, and messages written by people never carry them (spec 8.4).
When your agent needs the person's account, add an authorization event with insufficient_scope and the scopes needed, and keep the conversation open while the assistant signs in. Later versions may add other error values, and an assistant that doesn't recognize one signs in again for the scopes in scope. Sending a message never authorizes an account action by itself (spec 8.11). The person can also talk with you directly, in a new conversation linked to the first (spec 8.10).
A close answers 202, and it doesn't wait its turn: you may act on requests you haven't acted on yet, or drop them. So assistants read until working is false before they close (spec 8.12).
Conversations across versions. A conversation can continue in a session that uses another protocol version, or other extension versions, than the session that started it. Where you can't carry it over, such as a pending operation whose format changed, you may reject requests on it, all of them or only some, such as new messages but not reads. Answer with version_mismatch (HTTP 409), giving the protocol version the conversation started in. The assistant can then finish it in a session with those versions, or start a new one. The guides suggest recording the versions each conversation started in (spec 8.2, guides: serving several versions):
Response body, from the spec's example
{ "error": "version_mismatch", "protocol_version": "1.0" }
Extension content in messages. A message can carry content that an extension defines, in extensions, keyed by the extension's name. Send an extension's content only when the request's Poppy-Extensions header (level 2) declares that extension with the same version. Keep what the message says in text and data, so an assistant that ignores the extension still gets it (spec 8.4, guides: conversations). Two extensions, each at version 1, add content to your agent's messages:
- Links carries the pages a reply refers to, such as a return policy, in
extensions.links.items, each with aurland an optionaltitle, rather than URLs written into the text (links 3). - Disclosures marks notices people need to see whatever else the message says, such as an allergen warning, in
extensions.disclosures.items, each with atext. The guides suggest keeping them to such notices. Without the extension, put the notice intext(disclosures 3, guides: conversations).
To offer one, list it in extensions in poppy.json, such as "links": [{ "version": "1" }] (links 2, disclosures 2).
Message with a link, from the spec's example
{
"id": "msg_p7Rt",
"role": "company",
"author": { "type": "agent" },
"text": "Unopened boxes can be returned within 30 days. We can't take back opened food.",
"extensions": {
"links": { "items": [{ "url": "https://example.com/help/returns", "title": "Return policy" }] }
}
}
UCP. If you speak the Universal Commerce Protocol (UCP), an open protocol for shopping by agents, the UCP extension tells assistants so. List "ucp": [{ "version": "1" }] in extensions: Poppy finds you and signs the person in, and the shopping happens through UCP (UCP 1, UCP 2). UCP's Ask, for questions in plain language, is a conversation protocol of its own. To offer it, add an agent.protocols entry with the type ucp, your UCP profile's URL as its endpoint and a description of what Ask can answer, such as questions about your products and orders, and offer Ask in that profile. Serve the profile at https://{your domain}/.well-known/ucp, on the host that serves your poppy.json, with no redirect: an assistant follows no redirect from it and uses no profile from another host (UCP 3). Ask's requests follow UCP, not spec 8.2 to 8.13 (UCP 5). A UCP checkout carries its own approval, so don't also return an operation for it (UCP 6). When a UCP call answers insufficient_scope, the assistant signs in again for every scope it still needs, the ones it has included, and you grant only the scopes that request names, even if the person granted others before. Many UCP scopes, such as personalized search or member pricing at checkout, aren't needed for the call to work, so say in each one's description what it adds and that the task works without it (UCP 4).
Session and version errors are the ones in level 2, and conversations have their own error codes too, such as conversation_closed, request_id_conflict and version_mismatch (spec 8.13).
Ask before you act: operations
The operations extension lets you ask for approval of the exact terms before you perform an action, such as an exchange or a changed booking. One revision of the terms is approved, you perform only what it describes, and a retry never performs it twice (operations 1).
Poppy 1.0 defines version 3 of the extension, which doesn't work with version 2. At an API, an MCP tool or your own agent, it adds no endpoint: the operation and the approval travel through the same channel as the action itself. To ask for approval on your website too, add an endpoint to the entry, and list web.browser_session_endpoint with it, because only a browser joined to a session gets operations. If your website returns no operations, leave endpoint out (operations 1, operations 2):
Excerpt from poppy.json
"extensions": {
"operations": [{ "version": "3", "endpoint": "https://example.com/poppy/operations" }]
}
Each extension in poppy.json is a list, with an entry for each version you support (spec 3.3). Return operations only in answer to a request whose Poppy-Extensions header declares the extension with version "3". A browser's requests declare what step 2 of its join declared. For other requests, handle the approval yourself, such as on your website or in a direct conversation, or refuse with extension_required and extension set to operations. An MCP server returns that error only to refuse the assistant entirely, so an MCP tool that needs the extension returns an ordinary tool error instead (operations 2).
You choose which actions need approval. The guides suggest asking for actions with a business effect the person would want to confirm, such as ones that cost money or can't be undone, and not for routine changes the person already asked for in so many words (guides: operations).
The flow has three steps (operations 1):
- The assistant makes its request as usual. You do not perform it: you refuse it and return the operation, its terms as JSON and, if you like, in plain language.
- The terms are approved, in one of two ways. In a user approval, the assistant shows the person your name and the terms, and takes their answer in its own interface, never from text you send. In an agent approval, the assistant approves on an instruction the person gave it, such as "go ahead with any exchange under $20", after checking the terms against that instruction (operations 5).
- The assistant makes the same request again with the approval. You check it, perform the action, and answer as you would have without operations. Or you decline the approval and perform nothing (operations 6).
You must not start the action before you receive an approval, and must perform only what the approved revision describes. Everything that affects the action, such as what it changes, any amount, date or recipient, must be in terms, and in the summary if you send one (operations 3).
Details for implementers: the operation object
Operation, from the spec's example
{
"operation_id": "exc_5Rt2",
"revision": "1791487200-k3Jd9Qx2mW8v",
"summary": "Exchange the Stormline Jacket (M) on order ord_7Hk2 for the Stormline Insulated Jacket (M), for $70.00 more, charged to the card used for the order.",
"terms": {
"order_id": "ord_7Hk2",
"item_id": "itm_4Qa",
"replacement_sku": "stormline-insulated-m",
"price_difference": { "amount": "70.00", "currency": "USD" }
},
"expires_at": "2026-10-08T12:20:00-07:00"
}
The fields (operations 3):
operation_idnames the action, not a kind of action, and stays the same when its terms change. Never use it for another action.revisionnames these terms. It is an opaque string that changes whenever thetermsorexpires_atchange. Asummaryreworded without changing the terms can keep it, but two different sets of terms never share one.summaryis optional: the terms in plain language, enough for the person to decide from alone. It may use bold, italics, paragraphs and lists, but no links, images or HTML.termsis required: the same terms as JSON you define, for the assistant to check and show the person.expires_atis the last time an approval of this revision is accepted.
Both IDs use the same characters as conversation IDs: letters, digits, - and _. The terms can change before the action is performed, because the person asks for different terms or yours change, such as a price. Then return the same operation_id with a new revision, which needs a new approval (operations 3).
The assistant shows the person your summary when there is one, and otherwise its own description of the terms or their values. The guides suggest naming the keys in terms after the fields of the request or of your API's resources, such as order_id, and making each value clear on its own, such as an amount with its currency (operations 5, guides: operations).
Any session of the same assistant and person can approve an operation, including one that starts after the session that returned it ends. One returned in a signed-out session can be approved only while signed out. One returned in a signed-in session belongs to the account, and can be approved only while signed in to that account (operations 3).
The guides show how to compute operations from the request, with an HMAC in the revision over the terms and who can approve them, so you need not store operations nobody approved. Give each new request a random operation_id, so a person can repeat an action on purpose. Without storage you can't hold a price: compute the terms again from your current data when the approval comes back, and return a new revision if they changed (guides: operations).
Details for implementers: asking for and receiving approval
How you return the operation depends on the channel (operations 4):
- An API answers HTTP 403 with a JSON body:
errorset toapproval_required, and the operation inoperation. - An MCP tool returns an error result, with
isErrorset totrue, the operation inoperationinsidestructuredContent, and text that says the action needs approval, such as the summary. - Your own agent puts it in a message, in
extensions.operations.operation. - Your website answers with a reference to the operation, as the next section describes.
An approval names the operation_id and revision, and says in approver how it was given: user or agent. It must have approver, and can also have approved_at (when it was given, in Unix seconds), input_type (how the person answered, such as tap, typed or voice, only with user) and reference (an ID for the assistant's own record of it). You may record these, and must not reject or decline an approval because an optional one is missing or you don't recognize the input_type. The guides suggest recording approver and reference with the operation, so you can look into an approval with the assistant's operator later (operations 6, guides: operations).
The approval comes back the same way the operation left (operations 6):
- At an API, the same request again, with the same method, address and body, and a
Poppy-Approvalheader. Other headers can differ, such as a renewed access token. Ignore members ofPoppy-Approvalyou don't recognize. - At an MCP server, the same tool call again, with the same arguments and the approval in
_metaunderpersonalagentprotocol.org/approval. - In a conversation, a message with the approval in
extensions.operations.approval. The message's text approves nothing, whatever it says.
Request: the assistant sends a user approval to your API
POST https://api.example.com/orders/ord_7Hk2/exchanges
Poppy-Session: eyJ0eXAiOiJwb3BweS1zZXNzaW9uK2p3dCIs…
Poppy-Version: 1.0
Authorization: Bearer eyJhbGciOi…Qp4w
Content-Type: application/json
Idempotency-Key: 9a3d7b2e-5c1f-4e8a-b6d0-2f7c4a1e9b3d
Poppy-Approval: operation_id="exc_5Rt2", revision="1791487200-k3Jd9Qx2mW8v", approver="user", approved_at=1791487260, input_type="tap", reference="apr_01JD8ZK3Q9"
{ "item_id": "itm_4Qa", "replacement_sku": "stormline-insulated-m" }
After the session and token checks, check that the session can approve the operation, that it has not been performed already, and that the revision is one you returned, has not expired and describes exactly what the request asks. Compare what the requests mean, not their bytes. You may ignore differences that don't matter, such as the order of JSON members, and may treat a revision you have replaced with a later one as failing. If the session can't approve the operation, handle the request as if it had no approval. If the last check fails, perform nothing and return the operation with a revision for what the request asks, never the revision the approval names (operations 6).
Once the checks pass, you may still decline the approval for your own reasons, such as the approver, the account or your risk checks. Perform nothing and return no new operation. An API answers HTTP 403 with error set to approval_declined, the approval's operation_id and revision, and optionally a reason for the person and an alternative, another way to do the action as in spec 9.2. Put nothing in reason that the session couldn't already see. There are no reason codes. An MCP tool returns the same members in an error result, and your agent puts them in extensions.operations.declined in a later message, without error. The assistant then won't send that approval again, or approve a new revision for the same action without asking the person (operations 6):
Response: you decline an agent approval, from the spec's example
HTTP/1.1 403 Forbidden
Content-Type: application/json
{
"error": "approval_declined",
"operation_id": "cls_2Wq8",
"revision": "1791487200-p9Lm3Rt6Vx1c",
"reason": "Only the account holder can close this account.",
"alternative": {
"instructions": "The account holder can close the account in the Example app.",
"references": [{ "type": "web", "url": "https://example.com/account/close" }]
}
}
To keep each action to at most once (operations 7):
- Perform each operation at most once, however many times its approval is sent. A repeat gets the answer you gave the first time.
- Remember a performed operation at least until the approved revision's
expires_at. - While an action is being performed, or you do not know whether it took effect, do not answer as if it failed. Answer HTTP 503 with a
Retry-Afterheader, or as you do for work that has not finished.
Details for implementers: operations on your website
On your website, the assistant's browser makes the request, and the assistant gets the operation and sends the approval at your endpoint. The approval never passes through the browser, so nothing a page can read or write approves an operation (operations 4, operations 8.2).
- The browser asks for the action. When a browser joined to a session asks for an action that needs approval, and your website handles it as that session, perform nothing. Answer HTTP 403 with a
Poppy-Operationheader holding the session'ssidand aref, a reference to the operation that you choose, of up to 2048 letters, digits,-,_and.. Your website handles a request as the session when the browser is signed in through a join with an access token, or signed out with no login of its own. A browser that kept a login the join didn't give it gets your own approval flow instead. - The assistant gets the operation. It posts the reference to your
endpoint, with its Session header and, if signed in, its access token. Check them as an API does, but require no scope. Answer as an API asks for approval, withapproval_requiredand the operation. A reference the session can't use, because you didn't return it, it has expired or the session can't approve it, gets 400 with{"error": "invalid_request"}. - The assistant sends the approval. It posts the same body to
endpointagain, with aPoppy-Approvalheader. Make the usual checks, record the approval and answer 204, or decline it as an API does. Perform nothing yet, and never record a declined approval. Accept approvals of your website's operations only atendpoint, and approvals from other channels never there. - The browser asks again. The assistant has its browser repeat the request, such as with a Continue button on the page. Look for a recorded approval that the session can approve and that matches the request. If several match, use the one recorded first. Perform the action, and the approval is used up. If none matches, return a new reference as in step 1. Keep an unused approval until the approved revision's
expires_at.
The body of your answer in step 1 is for whatever made the request. Answer a page load or form with a page that says the action is waiting for approval in the person's assistant, and a request from your own scripts that accepts JSON with {"error": "approval_required"}, without the operation. The waiting page should offer a way to repeat the request, such as a Continue button. An action your website can't repeat, such as one behind a single-use form token, isn't suited to this, so handle its approval yourself (operations 4).
Your answer in step 1, from the spec's example
HTTP/1.1 403 Forbidden
Content-Type: text/html
Cache-Control: no-store
Poppy-Operation: sid="ses_Hq3vT8nW2kLm9xRb", ref="exc_5Rt2.1791487200.k3Jd9Qx2mW8v"
<!doctype html>
<title>Waiting for approval</title>
<p>This exchange is waiting for your approval in your personal agent.</p>
Once an operation has a recorded approval, a post of its reference to endpoint without an approval answers 200 with its state in status: approved while the approval waits for the browser, performing while you perform the action or don't yet know whether it took effect, and performed after (operations 6).
The guides suggest making the reference a sealed copy of the operation and the request's fingerprint, such as a JWS or an HMAC, so you don't store operations nobody approved, and making sure your CDN or firewall passes a 403 with Poppy-Operation through unchanged (guides: operations).
Leave a step to the person: browser control
The browser-control extension lets you mark steps on your website that the person should take themselves, such as checking in for a flight. An assistant that supports it leaves a marked step to the person and offers them control of its browser (browser control 1). It works only in a browser joined to a session, so list web.browser_session_endpoint with it (browser control 3):
Excerpt from poppy.json
"extensions": {
"browser-control": [{ "version": "1" }]
}
Use operations instead for an action you can describe as terms to approve. The person approves where they already talk to their assistant, and you get an approval of exact terms, performed at most once. Browser control fits steps that are the person's to perform rather than approve, input the assistant shouldn't handle, such as passport details, requests your website can't repeat, and websites without operations yet. You can use both for one action (browser control 2).
Mark a step with the data-poppy-user-step attribute (browser control 4):
interactionon a control: the assistant can read it, but leaves changing or activating it to the person.interactionon a form: the assistant can read it, but leaves its controls, and submitting it, to the person.submissionon a form: the assistant can fill in its controls, unless other marks say not to, but leaves submitting it to the person.
A form for the person to submit, from the spec's example
<form action="/bookings/bkg_4Rt9/check-in" method="post" data-poppy-user-step="submission">
<label>Seat <select name="seat">…</select></label>
<button type="submit">Check in</button>
</form>
Any other value, or submission on anything but a form, counts as interaction. Mark every control that performs the step, or the form it is in, before they can be used, and don't let filling in a submission form perform the step by itself (browser control 4). While the person holds control, the assistant's model doesn't use the browser, and only the person ends that control (browser control 5).
On your website, the assistant's software provides navigator.poppy.controller: "user" while the person holds control, and "agent" otherwise. Your page can read it and send it with the request (browser control 6):
Page script, from the spec's example
form.elements.controller.value = navigator.poppy?.controller ?? "";
The value should be correct, but it isn't signed, and anything that runs in the page can change it. You may record it with the action, or use it to choose what your page shows, such as "This step is for you to complete" when it reads "agent". Don't rely on "user" as proof that the person took the step. Marks don't stop anything either, so your servers still check every action (browser control 6, browser control 8.1, browser control 8.2).
Checks this level turns green
These are the checker's rows for this level, by their ids in the check catalog. Building what this level describes, and following the guides it links, is what makes them pass. A row that checks something you do not offer does not apply. The checker grades Version 1.0, as this guide does, and grades every poppy.json by its rules. A file written for Draft 0.4 or earlier fails the version check unless its supported_versions links a 1.0 document on the same host, because assistants built for 1.0 do not use older files.
Checked today (6)
T1-03Conversation endpoint refuses a request with no credentialsT1-15Browser join page is safe to loadT1-07Browser endpoint rejects a junk joinT1-16Browser join authorization requires a SessionT0-28Browser sign-in scope listedT1-17Website operations endpoint requires a Session