Ap2 intent mandate

From OrcaQubits/agentic-commerce-skills-plugins · View interactive version

Ap2 intent mandate is an AI agent skill from the GitHub repository OrcaQubits/agentic-commerce-skills-plugins. Pre-authorize agent purchases within user-defined constraints for human-not-present flows — the AP2 Intent Mandate concept, now expressed as an open Checkout Mandate carrying allowed-merchant and line-item constraints. Use when building autonomous agent shopping with user-signed intent, expiry, and

How to use this skill

Skill file

AP2 Intent Mandate → open-mandate constraints

Restructured. "Intent Mandate" was the name for the human-not-present credential in early AP2 releases. The concept — a user authorizing a shape of purchase in advance, which an agent later resolves into a concrete transaction — is intact and central. The structure moved: it is now expressed through the Agent Authorization Framework as an open mandate carrying constraints, which the agent later binds into a closed Checkout Mandate.

Read ap2-agent-authorization first. Treat every concrete field name below as historical illustration, not as the current schema.

Before writing code

Fetch live docs:

  1. Fetch https://ap2-protocol.org/ap2/agent_authorization/ for the open/closed mandate model — this is where the intent concept now lives.
  2. Fetch https://ap2-protocol.org/ap2/checkout_mandate/ for the open-form constraints (allowed merchants, line items).
  3. Fetch https://ap2-protocol.org/glossary/ to confirm current terminology before writing any type name.
  4. Web-search site:github.com google-agentic-commerce AP2 code sdk mandate for the current type definitions.

Conceptual Architecture

What the Intent Mandate Is

The Intent Mandate is the VDC for human-not-present transactions. It captures the user's pre-authorized shopping intent with defined constraints, allowing the Shopping Agent to act autonomously within those bounds after the user has left the session.

Who Creates It

The Shopping Agent creates the Intent Mandate based on the user's expressed intent. The agent captures the user's requirements and formalizes them into a structured mandate.

Who Signs It

The User signs the Intent Mandate before going offline:

Intent Mandate Contents

The spec describes several conceptual properties for the Intent Mandate (payer/payee identities, authorized payment method categories, risk payload, shopping intent, etc.).

The field list below is historical, not authoritative. It documents the early IntentMandate type, which the open-mandate model has since superseded — a type by that name may not exist in the release you are targeting at all. It is kept here because it shows the kinds of constraint the concept has always carried, which is what you need to reason about. Read the actual types from code/ in the AP2 repo before writing anything. Historically present:

Note: Use intent_expiry (an ISO 8601 timestamp) rather than a generic "TTL" concept.

Additional conceptual fields described in the specification (present or absent depending on the release you target) include:

Open vs closed — the distinction that replaced "Intent vs Cart"

| Aspect | Closed mandate | Open mandate |

|--------|----------------|--------------|

| Scenario | Human-present | Human-not-present |

| Bound to a transaction | Yes, via Key Binding JWT | No — carries constraints instead |

| Specificity | Exact items, prices, totals | Allowed merchants, acceptable line items |

| User presence | User approves the actual transaction | User approves the constraints, then leaves |

| Who signs last | User | Agent, binding the closed mandate to a real transaction |

| Evidence at dispute | The signed transaction | The full chain: user-signed constraints + agent-signed binding |

The old "Cart Mandate vs Intent Mandate" framing maps onto this directly — but the objects are not interchangeable with their predecessors, so port the reasoning, never the field names.

Intent Mandate Flow

  1. User expresses shopping intent to Shopping Agent
  2. Shopping Agent interprets and structures the intent
  3. Shopping Agent presents Intent Mandate summary to user
  4. Agent repeats back understanding for confirmation
  5. User confirms via in-session authentication and signs
  6. User may go offline
  7. Shopping Agent presents Intent Mandate to Merchant(s)
  8. Merchant evaluates whether they can fulfill within constraints
  9. If merchant is uncertain → may force user confirmation (escalate to human-present)
  10. If merchant needs clarification → asks questions (updates Intent Mandate)
  11. If merchant can fulfill → proceeds with purchase

Constraint Enforcement

The Intent Mandate defines boundaries the agent must stay within:

Merchant Escalation

The merchant can escalate a human-not-present flow to human-present:

Best Practices

Fetch the specification for exact Intent Mandate fields, constraint formats, and TTL semantics before implementing.

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.