The problem

Claire asks her AI agent to buy gear for a hike. A week later her bank shows a 34 EUR charge she does not recognise, and she disputes it. Atelier Voyage, a small outdoor shop, now has to prove that a purchase no human clicked was allowed, with almost nothing to show.

This is not hypothetical. In 2026 the top category of complaints about PayPal in the U.S. CFPB database is "unauthorized transactions or other transaction problem": 2,195 of 10,572 complaints received between 1 January and 24 October. Agents make the question "who authorized that purchase?" harder, unless the answer is recorded at the moment of purchase.

What Mandat does

Mandat stops what you never allowed before any money moves, then defends the merchant with the same record.

  1. You sign once. You set one merchant, categories, a budget, a limit per purchase and a threshold. Your passkey signs that exact mandate.
  2. Claude shops, but only proposes. It has no payment tool and never sees PayPal credentials.
  3. Plain code decides. A deterministic guard pays within the mandate through PayPal Orders v2 and refuses the rest, saying which rule failed. No prompt can widen it.
  4. You approve above your threshold. Your passkey signs that exact order, then you approve on PayPal's own page. The guard captures only after both, in that order.
  5. The merchant defends. On a chargeback, Claude drafts the answer from the sealed receipt only, citing each entry. A human sends it to PayPal's Disputes API with a signed PDF.
  6. Anyone can check. /verify recomputes the chain, the seal and the passkey signatures. Change one byte and it fails.

Try the attack yourself

Press Hijack the agent on a live run. No model is involved: it sends the guard exactly what the instructions hidden in the shop's listings demand, including two tents at 389 EUR. All three proposals are refused, with no PayPal order. Our suite repeats this at scale: 30 attacks across three agent personas, 90 runs on the sandbox, 0 orders and 0 EUR outside the mandate (docs/injection-results.md).

That matters because the model is not the defence. In the same suite Claude ignored most hidden instructions, but it readily proposed whatever the user asked, in or out of the mandate. So the agent is not even told its limits.

Built on PayPal

  • Orders v2: card capture and payer-action approval, with a deterministic PayPal-Request-Id, so a retry never creates a second order or capture.
  • custom_id as an anchor: every order carries the mandate hash and the passkey's fingerprint. PayPal refuses to change it once the order is completed, and /verify asks PayPal for it, so the key cannot be swapped once a dispute opens.
  • Payer link: the passkey signs the order, PayPal reports who approved it, and the receipt links the two.
  • Disputes: real chargebacks (UNAUTHORISED) from the sandbox tool, signature-verified webhooks, evidence through provide-supporting-info and provide-evidence.
  • Tracking: the shipment is attached to the PayPal order.

Why this direction

In its September 2025 post on the Agent Payments Protocol, PayPal describes signed mandates as evidence merchants could use in disputes, validated independently. Mandat is a working prototype of that idea on today's PayPal APIs. It does not implement AP2: there are no Verifiable Credentials.

Spending guards block purchases. Flight recorders explain them afterwards. Mandat does both with one record, from the buyer's consent to the evidence PayPal receives, and any agent can use it: packages/mcp-guard is an MCP server that gives Claude Code or Claude Desktop four tools and no payment authority.

For the merchant

/merchant is an AG Grid back office across every mandate: how each order was authorized, its payer and dispute, filters whose totals follow what you see, CSV export, and every proposal the guard refused, by rule. On a single run, the sealed ledger is a searchable grid too.

What is real, and what it does not prove

  • Real on the sandbox: orders, captures, approvals, tracking, webhooks, evidence sent, Claude's runs and drafts.
  • Simulated and labelled: PayPal's final ruling, because the sandbox cannot adjudicate chargebacks.
  • Sandbox conditions: purchases under the threshold use a PayPal test card held by the server, and chargebacks come from PayPal's sandbox-only tool.
  • Limits: the passkey is not enrolled with an account, so a dishonest server could generate its own key before an order. The anchor stops it from swapping keys after an order completes, not before. Without attestation, the fingerprint or face check is what the authenticator reports.

Quality

55 guard tests, including property-based tests, and a reproducible mutation check: disabling any of 13 guard rules makes them fail (pnpm --filter @mandat/guard mutation). 0 axe-core violations (WCAG 2.2 AA) on the main pages at desktop and mobile widths. A security review by a separate AI agent, with its findings fixed.

Challenges

  • adjudicate always returns ACTION_NOT_ALLOWED_IN_CURRENT_DISPUTE_STATE, so the demo stops at "evidence sent".
  • PayPal lists a response action before accepting it: an early call returns 400 MISSING_OR_INVALID_REQUEST_BODY, the same call passes about 20 s later. A controlled test proved it was timing, not the PDF.
  • Chargebacks only exist for card payments, and dispute webhooks take about 3 minutes, so the merchant view polls in the meantime.

What's next

  • Replace the test card with a payment method saved with the buyer's consent.
  • Enrol the passkey beforehand and tie it to the buyer's identity, so the signature says who signed.
  • Publish the MCP server, with a remote transport.

AI tools used (declared)

  • In the product: Claude Sonnet 5.5 (Anthropic API, Vercel AI SDK) is the shopping agent and drafts dispute responses.
  • To build it: Claude Code wrote code, tests, design passes and this text with the author. An external UI review came from ChatGPT.
  • Video: voice-over by neural text-to-speech (Microsoft Edge TTS, en-US-AndrewNeural).

Created during the Submission Period

Yes. The repository's first commit is from 24 October 2026; the Submission Period opened on 1 October 2026.

Built With

  • ag-grid
  • anthropic
  • claude
  • ed25519
  • model-context-protocol
  • next.js
  • node.js
  • paypal-disputes-api
  • paypal-orders-v2
  • paypal-tracking
  • paypal-webhooks
  • pdf-lib
  • react
  • render
  • sqlite
  • typescript
  • vercel-ai-sdk
  • webauthn
Share this project:

Updates

Submission history