AP2-style mandates¶
The Agent Payments Protocol (AP2) describes how a user delegates purchasing to an agent through signed mandates:
- an intent mandate: what to buy, from whom, and until when;
- a cart mandate: a merchant-signed cart the user approved;
- a payment mandate.
CredenceStack models these as plain Pydantic objects (no SD-JWT or signature checks) and turns them into a temporary authority profile. That way, "the agent stayed within the user's mandate" is tested with the same grader and evidence as company authority rules.
# scenario
authority_mandate: fixtures/mandate_cap_400.json
authority: {agent_id: shopping-agent, clock: "2026-10-14T15:00:00Z"}
The conversion is in place and tested (tests/fixtures/ap2/ holds example mandates). The
four mandate scenarios (price above the cap, wrong merchant, expired mandate, cart quantity
changed after approval) need a shopping environment with merchants and carts, which the
simulated back office does not have yet; they are on the roadmap.
Mapping to a profile¶
| Mandate | Profile (one purchase grant) |
Status |
|---|---|---|
constraints.max_amount |
per_txn_limit |
CredenceStack extension, TODO-verify (AP2's IntentMandate has no structured price cap) |
IntentMandate.merchants |
allowed_counterparties (merchant names) |
field verified; names vs ids TODO-verify |
IntentMandate.intent_expiry, CartContents.cart_expiry |
valid_until (earliest) |
fields verified; interpretation ours |
CartMandate |
bound_objects: cart id, total, display-item labels |
fields verified; binding rule ours |
user_cart_confirmation_required and no cart mandate |
requires_human_above: 0 |
field verified; interpretation ours |
What is verified and what is not¶
Verified against the AP2 Python SDK
(code/sdk/python/ap2/models/mandate.py and payment_request.py in
github.com/google-agentic-commerce/AP2):
- Mandate field names, types and defaults:
IntentMandate:user_cart_confirmation_required,natural_language_description,merchants,skus,requires_refundability,intent_expiryCartContents:id,user_cart_confirmation_required,payment_request,cart_expiry,merchant_nameCartMandate:contents,merchant_authorizationPaymentMandateContents:payment_mandate_id,payment_details_id,payment_details_total,payment_response,merchant_agent,timestampPaymentMandate:payment_mandate_contents,user_authorization- W3C payment types:
PaymentCurrencyAmount:currency,valuePaymentItem:label,amount,pending,refund_periodPaymentDetailsInit:id,display_items,shipping_options,modifiers,totalPaymentRequest:method_data,details,options,shipping_address- The data-key naming:
ap2.mandates.IntentMandate,ap2.mandates.CartMandate,ap2.mandates.PaymentMandate.
TODO-verify against ap2-protocol.org:
- the
constraintsblock, which is not an AP2 object; - whether
merchantsholds names or identifiers; - how expiry, cart binding and confirmation should be interpreted as authority rules;
- the signature formats of
merchant_authorizationanduser_authorization, which are carried as opaque strings and not checked.
The models are deliberately permissive (extra="allow"), so newer AP2 fields do not break
loading. All AP2-specific code is in src/credencestack/integrations/ap2.py.