Agent Legal Context
Protocol Integration

AP2 Integration

Agent Payments Protocol integration via mandate metadata.

This section is advisory.

AP2 (Agent Payments Protocol) mandates — Cart, Intent, and Payment — support metadata fields where the legal context reference can be included.


Mandate Metadata

{
  "legalContext": {
    "type": "sha256",
    "value": "0x7f83b165..."
  }
}

The legalContext object is included in the mandate metadata at each phase of the AP2 flow.


Integration Flow

AP2 PhaseLegal Context Role
CartTerms reference included — agent can verify before proceeding
IntentTerms hash confirmed — binding the intent to specific terms
PaymentTerms hash in receipt — confirmation of what was agreed

The legal context reference travels through all three phases, providing consistency from discovery through payment.