Scenario 4
Autonomous restock while the user is away
A cafe owner signs AP2 v0.2 open mandates with allowed merchants, a per-order cap, a weekly recurrence and a total budget. While the owner is away the agent closes them with its own key, three verifiers check the bindings, and signed receipts come back. Specified only; production use is unverified.
The situation
A cafe owner wants coffee beans reordered whenever stock runs low, from one of two roasters, at most once a week, without approving each order. The owner is not present when the buys. AP2 v0.2 covers this with its human-not-present mode: the user signs open Checkout and Payment that include the agent’s public key in cnf, and the agent later signs closed mandates with its own key.Source [1, 2]
This scenario is specified, not observed. Production use of AP2 mandates is unverified anywhere, including inside UCP, as of 2026-10-11.Source [3, 4]? unverified One third party self-reported a merchant-side AP2 v0.2 deployment in a GitHub issue on 2026-08-29; nobody has verified it.Source [5] No commit has reached the AP2 main branch since 2026-04-29, and specification work has moved to .Source [3, 6, 7, 8]
Actors
AP2 v0.2 defines five roles: , , Merchant, and .Source [2] Here “MPP” means Merchant Payment Processor, a role unrelated to the Machine Payments Protocol.Source [2, 9]
- Cafe owner, present only when the open are signed.
- Trusted Surface, which must be non-agentic.Source [2]
- Shopping Agent, which is expected to be agentic, holding the key named in
cnf. - Supplier, the merchant, which signs the checkout.
- Credential Provider, for example a digital wallet or a payment network.Source [10]
- Merchant Payment Processor, the supplier’s processor.
Step by step
All steps belong to AP2 v0.2. Catalog and checkout calls belong to the surrounding commerce protocol, which AP2 leaves open and designs to be compatible with UCP.Source [2]
- Task (no protocol). The owner states the task and the limits.
- Propose open mandates. The open requires
vct(mandate.checkout.open.1),constraintsandcnf, and its must includecheckout.line_items.Source [11] The open requiresvct(mandate.payment.open.1),constraintsandcnf, and must includepayment.reference.Source [12] Here the addscheckout.allowed_merchants,payment.amount_range,payment.agent_recurrencewithWEEKLY,payment.budgetandpayment.allowed_payees.Source [11, 12] - Consent. The shows the limits and authenticates the owner.
- Sign and leave. The Trusted Surface signs the open mandates with the user key. AP2 recommends the smallest
expthat still lets the agent finish.Source [2] - Shop (commerce protocol). When stock is low, the agent builds a cart with a supplier.
- Merchant-signed checkout. The supplier returns
checkout_jwt, a merchant-signed JWT of the checkout.Source [13] - Pre-check. All validation must run in deterministic code.Source [2] The agent must not present a new from the same until it receives a rejection receipt for the previous one.Source [2]
- Close the mandates with . The closed mandate is a key-binding JWT signed with the agent key named in
cnf, and itssd_hashcovers the user-signed open mandate it extends.Source [1, 14, 15]transaction_idin the Payment Mandate is the hash ofcheckout_jwt, which ties payment to this checkout.Source [16] - Present the payment chain. The agent presents only the open-mandate disclosures needed to evaluate the closed mandates.Source [2]
- verifies. The verifier processes the chain, checks that the closed mandate keeps every value the open mandate fixed, and evaluates each constraint.Source [14] The budget check adds the requested amount to all earlier closed amounts.Source [17] The token is released only after the final Payment Mandate verifies.Source [18]
- Send the checkout chain. The agent sends the token and the open and closed Checkout Mandates to the supplier.
- Merchant verifies. The supplier checks that the hash of its checkout JWT matches
checkout_hashand evaluates every open constraint.Source [2] A requirement must be matched without reusing an item.Source [19] - Initiate payment. The supplier passes the token and both hashes to its processor.
- Processor verifies; . The processor must verify that the is scoped to the checkout, for example by finding the closed Payment Mandate inside it.Source [2] The Payment Receipt requires
status,iss,iat,referenceandpayment_id, pluspsp_confirmation_idandnetwork_confirmation_idon success.Source [20] - Checkout Receipt. It requires
status,iss,iatandreference, plusorder_idon success.Source [20] A receipt’sreferenceis the hash of the closed mandate, computed likesd_hash.Source [14, 20] - Store and narrow. After a success receipt the agent stores the open mandate, closed mandate and receipt together and narrows the open mandate’s scope.Source [14]
Which protocol does what
| Steps | Protocol | Object or message | Spec version |
|---|---|---|---|
| 2 to 4 | AP2 | open , cnf, | v0.2 |
| 5 | Commerce protocol (for example UCP) | cart and checkout calls | outside AP2 |
| 6 to 10 | AP2 | checkout_jwt, closed mandates (sd_hash, transaction_id), verification | v0.2 |
| 11 to 16 | AP2 | merchant and processor verification, Checkout and Payment Receipts | v0.2 |
AP2 v0.2 was released on 2026-04-28.Source [21, 22] Each mandate type carries a vct with a numeric suffix that verifiers must match exactly.Source [2]
Where controls apply
- Before authorization. Native caps are
payment.amount_rangeandpayment.budget; native scoping ischeckout.allowed_merchantsandpayment.allowed_payees.Source [11, 12] A template can refuse wide .Source [12] - At signing. A deterministic signer that holds the key, separate from the language model, can refuse overlapping or out-of-budget closed . AP2 requires the rejection receipts it relies on to be integrity protected from the agent’s model.Source [18]
- At the edge. The supplier’s verification runs before any , and an unknown constraint type always fails.Source [14]
- At settlement. Recurrence and budget checks need the verifier to track earlier presentations.Source [17] Providers, networks or processors may reject overlapping mandates or invalidate earlier tokens.Source [18]
- After the fact. Dispute verification recomputes the
checkout_jwthash, checks both receipt references against the closed mandates and verifies both mandates.Source [2] AP2 leaves retention, retrieval and adjudication outside the specification.Source [2]
What is observable from outside
Almost nothing. AP2 defines no public registry, explorer, indexer, event stream or .well-known path of its own.Source [2, 23] and receipts travel only among the , , merchant, processor and network.Source [2] digests are salted and decoys are allowed, so even a verifier sees only the it is shown.Source [18] From outside, a supplier that runs AP2 through UCP is visible only through its profile, which lists the AP2 .Source [24] The card authorization looks like any other card payment.
What can go wrong
- A fails. The verifier answers
unresolved_constraint, which may signal a fallback, whileinvalid_credentialandinvalid_mandateare terminal.Source [14] A failing check must come back as a carrying the error.Source [2] - The owner is needed after all. A human-not-present flow can turn into a human-present one when a verifier returns
unresolved_constraintand the user approves closed .Source [1] There is no step-up in v0.2.Source [1, 14] - Double spend. The rejection-receipt rule exists so one cannot approve two checkouts at once.Source [2]
- Leaked key. AP2 v0.2 defines no way to revoke a mandate before it expires.Source [10, 14] The short
expand the budget are the only bounds. - Ambiguous budget.
payment.budgettypesmaxas a number with no stated unit, and the documentation example uses 1000.00, so the unit is unresolved in v0.2.Source [12, 17] A verifier and an agent that read it differently will disagree. - . AP2 assumes it cannot be prevented and treats every model and agent as a potential attacker.Source [18]
- Who pays for a bad order. AP2 leaves liability to the payment networks.Source [3, 25]
Variants
- Monthly instead of weekly.
payment.agent_recurrencetakesMONTHLYor other frequencies with an optionalmax_occurrences.Source [12] Note that the checkout side has onlycheckout.allowed_merchantsandcheckout.line_items, and one ’s line items cannot be split across several checkouts, so how one open serves repeated orders is not spelled out in v0.2.Source [11, 19] - Agent provider signs instead of the user. In the model the provider signs with a key the cannot use without the , and verifiers trust a list of providers instead of a user issuer.Source [2, 14]
Flow player: Autonomous restock while the user is away: AP2 v0.2 open mandates, agent-closed mandates, verification and receipts
A cafe owner signs open AP2 v0.2 Checkout and Payment Mandates that limit merchants, items, a per-order amount, a recurrence and a total budget, and bind them to the agent's key. While the owner is away the agent finds a checkout that fits, signs closed mandates with key binding (cnf, sd_hash), and presents them; the Credential Provider, the merchant and the Merchant Payment Processor verify the bindings and return signed receipts. Specified only: production use of AP2 is unverified anywhere as of 2026-10-11.
Spec version: AP2 v0.2 (2026-04-28).
Use the left and right arrow keys to step, space to play or pause, Home and End to jump.
Step 1 of 16Cafe owner (user) to Shopping Agent
Set the standing task
The owner asks the agent to reorder coffee beans from one of two suppliers whenever stock runs low, at most weekly, within a total budget, and then goes away. How the agent learns that stock is low is outside AP2.
Spec: Human Not Present, Phase 1a for step 1 (external link)
Step 1 of 16: Cafe owner (user) to Shopping Agent. Set the standing task.
Which protocol owns each step
- AP2
| Step | From and to | Protocol | Control point | Observable from outside |
|---|---|---|---|---|
| 1. Set the standing task | Cafe owner (user) to Shopping Agent | Not protocol-specific | None | Private |
| 2. Propose open Checkout and Payment Mandates | Shopping Agent to Trusted Surface | AP2 | Before authorization: refuse wide constraints (no allowed_merchants, high amount_range, long exp); keep exp as short as the task allows. | Private |
| 3. Show the limits, authenticate, get consent | Trusted Surface to Cafe owner (user) | AP2 | Before authorization: the last point at which a human sees the limits; a controls layer can require a second approver for large budgets. | Private |
| 4. Return user-signed open mandates; the owner leaves | Trusted Surface to Shopping Agent | AP2 | None | Private: open mandates stay with the agent until it presents the disclosures a verifier needs. |
| 5. Stock runs low: build a cart (crosses a trust boundary) | Shopping Agent to Supplier (merchant) | Not protocol-specific | None | Private |
| 6. Merchant-signed checkout (checkout_jwt); mandate required (crosses a trust boundary) | Supplier (merchant) to Shopping Agent | AP2 | None | Private |
| 7. Deterministic pre-check before signing | Shopping Agent to Shopping Agent | AP2 | At signing: an independent signer service holds the agent key and refuses overlapping or out-of-budget closed mandates. | Private |
| 8. Sign closed mandates with the agent key (cnf, sd_hash) | Shopping Agent to Shopping Agent | AP2 | None | Private |
| 9. Present open and closed Payment Mandates (crosses a trust boundary) | Shopping Agent to Credential Provider | AP2 | None | Private: shared only with the Credential Provider and, if it asks, the network. |
| 10. Verify the chain and constraints; issue a payment token (crosses a trust boundary) | Credential Provider to Shopping Agent | AP2 | At settlement: the Credential Provider tracks budget and recurrence, may reject overlapping mandates and may invalidate earlier tokens. | Private |
| 11. Send the token and the open and closed Checkout Mandates (crosses a trust boundary) | Shopping Agent to Supplier (merchant) | AP2 | None | Private |
| 12. Merchant verifies bindings and constraints | Supplier (merchant) to Supplier (merchant) | AP2 | At the edge: the merchant's deterministic verification decides before any charge. | Private |
| 13. Initiate payment with the token and both hashes (crosses a trust boundary) | Supplier (merchant) to Merchant Payment Processor | AP2 | None | Private |
| 14. Processor verifies the Payment Mandates in the token; Payment Receipt (crosses a trust boundary) | Merchant Payment Processor to Shopping Agent | AP2 | At settlement: processor fraud checks and network rules on the card authorization. | Private |
| 15. Checkout Receipt with order_id (crosses a trust boundary) | Supplier (merchant) to Shopping Agent | AP2 | None | Private: receipts are signed JWTs returned to the parties, never published. |
| 16. Store the tuple, add to the budget, narrow the open mandate | Shopping Agent to Shopping Agent | AP2 | After the fact: reconcile receipts against the budget; there is no way to revoke an open mandate before exp, so a short exp is the main stop. | Private |
Sequence diagram: Autonomous restock while the user is away: AP2 v0.2 open mandates, agent-closed mandates, verification and receipts
Scroll to see the whole diagram
Diagram loads when it scrolls into view.
Generated from the flow definition (spec version AP2 v0.2, 2026-04-28). The player above uses the same data.
Text alternative
Sequence diagram: Autonomous restock while the user is away: AP2 v0.2 open mandates, agent-closed mandates, verification and receipts. 6 participants: Cafe owner (user), Shopping Agent, Trusted Surface, Supplier (merchant), Credential Provider, and Merchant Payment Processor. 16 steps, 8 crossing a trust boundary, 6 failure branches. Based on several protocols AP2 v0.2 (2026-04-28). Step 1: Cafe owner (user) to Shopping Agent: Set the standing task. Step 2: Shopping Agent to Trusted Surface: Propose open Checkout and Payment Mandates. If A constraint type a verifier does not know is included: Every verifier must treat it as failing, so the mandate can never be used. Step 3: Trusted Surface to Cafe owner (user): Show the limits, authenticate, get consent. Step 4: Trusted Surface to Shopping Agent: Return user-signed open mandates; the owner leaves. Step 5: Shopping Agent to Supplier (merchant): Stock runs low: build a cart. This step crosses a trust boundary. Step 6: Supplier (merchant) to Shopping Agent: Merchant-signed checkout (checkout_jwt); mandate required. This step crosses a trust boundary. Step 7: Shopping Agent to Shopping Agent: Deterministic pre-check before signing. If A previous closed mandate has neither a success nor a rejection receipt: The agent must wait; signing a second checkout would risk a double spend. Step 8: Shopping Agent to Shopping Agent: Sign closed mandates with the agent key (cnf, sd_hash). Step 9: Shopping Agent to Credential Provider: Present open and closed Payment Mandates. This step crosses a trust boundary. Step 10: Credential Provider to Shopping Agent: Verify the chain and constraints; issue a payment token. This step crosses a trust boundary. If Budget exceeded, too soon for the recurrence, or a payee not allowed: Payment Receipt with status Error and unresolved_constraint; the agent may bring the owner back to approve a closed mandate (human present). If The closed mandate is not signed by the key in cnf, or sd_hash does not match: invalid_credential, a terminal error. Step 11: Shopping Agent to Supplier (merchant): Send the token and the open and closed Checkout Mandates. This step crosses a trust boundary. Step 12: Supplier (merchant) to Supplier (merchant): Merchant verifies bindings and constraints. If The merchant is not allowed or a line item cannot be matched: Checkout Receipt with error unresolved_constraint. With that rejection receipt in hand, the agent may present a new closed mandate for a different checkout. Step 13: Supplier (merchant) to Merchant Payment Processor: Initiate payment with the token and both hashes. This step crosses a trust boundary. Step 14: Merchant Payment Processor to Shopping Agent: Processor verifies the Payment Mandates in the token; Payment Receipt. This step crosses a trust boundary. If A binding does not match or the card is declined: Payment Receipt with status Error, error and error_description. Step 15: Supplier (merchant) to Shopping Agent: Checkout Receipt with order_id. This step crosses a trust boundary. Step 16: Shopping Agent to Shopping Agent: Store the tuple, add to the budget, narrow the open mandate.
- Step 1: Cafe owner (user) to Shopping Agent: Set the standing task.
- Step 2: Shopping Agent to Trusted Surface: Propose open Checkout and Payment Mandates. If A constraint type a verifier does not know is included: Every verifier must treat it as failing, so the mandate can never be used.
- Step 3: Trusted Surface to Cafe owner (user): Show the limits, authenticate, get consent.
- Step 4: Trusted Surface to Shopping Agent: Return user-signed open mandates; the owner leaves.
- Step 5: Shopping Agent to Supplier (merchant): Stock runs low: build a cart. This step crosses a trust boundary.
- Step 6: Supplier (merchant) to Shopping Agent: Merchant-signed checkout (checkout_jwt); mandate required. This step crosses a trust boundary.
- Step 7: Shopping Agent to Shopping Agent: Deterministic pre-check before signing. If A previous closed mandate has neither a success nor a rejection receipt: The agent must wait; signing a second checkout would risk a double spend.
- Step 8: Shopping Agent to Shopping Agent: Sign closed mandates with the agent key (cnf, sd_hash).
- Step 9: Shopping Agent to Credential Provider: Present open and closed Payment Mandates. This step crosses a trust boundary.
- Step 10: Credential Provider to Shopping Agent: Verify the chain and constraints; issue a payment token. This step crosses a trust boundary. If Budget exceeded, too soon for the recurrence, or a payee not allowed: Payment Receipt with status Error and unresolved_constraint; the agent may bring the owner back to approve a closed mandate (human present). If The closed mandate is not signed by the key in cnf, or sd_hash does not match: invalid_credential, a terminal error.
- Step 11: Shopping Agent to Supplier (merchant): Send the token and the open and closed Checkout Mandates. This step crosses a trust boundary.
- Step 12: Supplier (merchant) to Supplier (merchant): Merchant verifies bindings and constraints. If The merchant is not allowed or a line item cannot be matched: Checkout Receipt with error unresolved_constraint. With that rejection receipt in hand, the agent may present a new closed mandate for a different checkout.
- Step 13: Supplier (merchant) to Merchant Payment Processor: Initiate payment with the token and both hashes. This step crosses a trust boundary.
- Step 14: Merchant Payment Processor to Shopping Agent: Processor verifies the Payment Mandates in the token; Payment Receipt. This step crosses a trust boundary. If A binding does not match or the card is declined: Payment Receipt with status Error, error and error_description.
- Step 15: Supplier (merchant) to Shopping Agent: Checkout Receipt with order_id. This step crosses a trust boundary.
- Step 16: Shopping Agent to Shopping Agent: Store the tuple, add to the budget, narrow the open mandate.
Source of truth: Human Not Present, Phase 1a (external link) Generated from src/content/flows/multi-autonomous-restock.json.
Actors and protocol boundaries
Autonomous restock: actors and protocol boundaries
Scroll to see the whole diagram
Diagram loads when it scrolls into view.
AP2 v0.2 in human-not-present mode. The owner approves open mandates once on a Trusted Surface; afterward the agent closes them with its own key and three verifiers check the chain: the Credential Provider for payment and budget, the merchant for the checkout, and the Merchant Payment Processor for the bindings in the token. Checkout and catalog calls belong to the surrounding commerce protocol. Specified only: production use is unverified.
Text alternative
Flowchart. Before the purchase, the cafe owner approves limits on a non-agentic Trusted Surface, which returns user-signed open mandates with allowed merchants, line items, a budget and a recurrence to the Shopping Agent. Later the agent shops with the supplier through a commerce protocol such as UCP and receives a merchant-signed checkout JWT. A deterministic signer holding the agent key named in cnf produces closed mandates as key-binding JWTs with sd_hash. The agent sends the payment chain to the Credential Provider, which verifies it, tracks budget and recurrence and issues a token. The agent sends the token and the checkout chain to the supplier, which verifies the checkout chain and passes the token and hashes to its Merchant Payment Processor. The processor returns a Payment Receipt and the supplier a Checkout Receipt to the agent.
Source of truth: AP2 v0.2 specification, Autonomous (Human Not Present) mode (external link) Generated from src/content/diagrams/multi-autonomous-restock-context.mmd.
Sources
- AP2 Flow Examples (external link)
- Agentic Payment Protocol (v0.2) specification (external link)
- AP2 FAQ (external link)
- Beyond the Mandate: A Systematic Security Analysis of the Agent Payments Protocol (AP2) (external link)
- Issue 345: Merchant-side AP2 v0.2 implementation report: Suede Agent Studio (external link)
- AP2 commit history on main (GitHub commits API) (external link)
- AP2 - Agent Payments Protocol Documentation (external link)
- Issue 268: Checkout JWT algorithm constraint forces dual keys under WBA (and conflicts with normative Security and Privacy guidance) (external link)
- AP2 Glossary (external link)
- AP2 Implementation Considerations (external link)
- AP2 JSON Schema: Open Checkout Mandate (external link)
- AP2 JSON Schema: Open Payment Mandate (external link)
- AP2 JSON Schema: Checkout Mandate (external link)
- AP2 Agent Authorization (external link)
- Delegate SD-JWT (draft-gco-oauth-delegate-sd-jwt-00) (external link)
- AP2 JSON Schema: Payment Mandate (external link)
- AP2 Payment Mandate (external link)
- AP2 Security and Privacy Considerations (external link)
- AP2 Checkout Mandate (external link)
- AP2 JSON Schemas: Payment Receipt and Checkout Receipt (external link)
- AP2 GitHub releases v0.1.0 and v0.2.0 (external link)
- AP2 CHANGELOG.md (external link)
- AP2 repository (README, METADATA, LICENSE) at e1ea56d (external link)
- UCP AP2 Mandates Extension (external link)
- AP2 specification at tag v0.1.0 (external link)