#4841·go-micro

a2a/x402: add AP2 mandate foundation for agent payments

Author: asimCreated Jul 12, 2026Updated Jul 20, 2026
Labelsenhancementcodex

Goal Add an opt-in AP2 mandate foundation so agents can carry auditable payment authorization over A2A and settle over x402 without changing defaults.

Scope

  • Define minimal Checkout Mandate and Payment Mandate data structures with signing/verification helpers.
  • Attach verified mandate metadata to A2A/x402 payment flows behind explicit options.
  • Preserve current public defaults and avoid broad API breakage.
  • Include docs/example notes only where needed to make the flow discoverable.

Acceptance criteria

  • Unit tests cover mandate creation, signing, verification failure, and x402 rail metadata.
  • A focused integration or gateway test shows an A2A request carrying mandate metadata into a paid-tool path.
  • go test ./... passes.