Skip to Content
A2A + AP2 example

A2A + AP2: the mandate is the may, the capsule is the did

An agent called over A2A is asked to pay under an AP2 CartMandate. The mandate says what the caller permitted. The capsule the callee seals says what it actually did, including when it refused.

The four slots

SlotThe questionIn this example
CANWas the agent permitted to act?The AP2 CartMandate: the caller permitted this payment, up to an amount, to a payee. The capsule carries its digest as agent_input_digest.
WHOWhich accountable human authorized this exact action?Empty in this example. The approver is a policy (approver: policy), not a named person.
WHATWhat outcome was recorded at the effect boundary?The callee’s capsule: effect.type send_payment, status dispatched then confirmed, with the payment result’s digest as response_digest.
AUDITDid the runtime enforce correctly, in order?The spend-limit gate: an over-limit request is sealed as verdict_class: blocked with effect.status: planned. It never reached the payment network, and the capsule is the sealed evidence that it was tried.

The four slots are the composition draft’s (draft-mih-sato-agent-accountability-composition, section 6). Each slot is answered by its own profile and joins the others on a shared subject digest of the action, or through a signed cross-reference between their own digests. A digest match is a join key. It does not by itself show that anything recorded is true.

As the evidence layer

  • Record. Two capsules on the approved path, one at dispatch and one at confirmation, chained with relation: confirms. One capsule on the refused path.
  • Ask and show. The caller, or an auditor, asks for the payment’s records and gets them as a bundle. The mandate and payment details travel only as digests unless the callee reveals them.
  • Verify. Anyone recomputes the ids and signatures, and checks the mandate digest against a mandate they hold.

The code

The example is one implementation’s, in capsule-emit/examples/a2a-ap2 ↗ . How to run it is in that folder’s README.

What it does not show

That the mandate was valid under AP2’s own rules. AP2 checks that. The capsule shows which mandate the callee acted on, and what it did.