Inspiration

AI agents are about to spend money for people, and the industry already agrees on the shape of the answer: the user gives the agent a mandate, a set of limits it has to stay inside. Google's Agent Payments Protocol (AP2) uses that same word. What's still missing is what it looks like for a real person: a parent who wants their teen's agent to buy school supplies, never more than $150 a month, and to check in before anything over $40.

Today that rule usually lives in a prompt, and a prompt can be talked around. We built Mandate to show the whole loop on PayPal: rules written in plain English, enforced in code the agent can't reach, paid through PayPal, and explained on every receipt.

Try it: live demo (press Watch it run for a hands-free 90-second tour) · code

What it does

You tell Mandate your rules in plain English, like "School supplies only, $150 a month, ask me before anything over $40." The agent turns that into a structured mandate, and nothing changes until you press Confirm. Then you just ask for things.

  • Inside the rules: paid right away from your PayPal Vault, with a receipt that says what was bought, why, and which rule allowed it.
  • Over your limit: the agent stops and asks. Approve with one tap, or with your passkey (fingerprint, face or device PIN) if you turn that on, or review and pay on PayPal's own checkout page.
  • Outside the rules: blocked in code, and the card names the exact rule that stopped it.
  • Returns in plain English ("Return the notebooks"), including partial refunds.
  • PayPal webhooks confirm every payment and refund. If a refund or chargeback happens directly in PayPal, the budget updates by itself.

Real products, not a toy store

Search runs on Channel3's catalog of real products from real retailers, so the agent compares real listings, prices and ratings (BIC pencils from Office Depot, a TI-84 from Best Buy). Each product is filed under a fixed category from its Channel3 category path, so a "school supplies only" rule still means something. Prices always come from the catalog, never from the agent. Payment stays in the PayPal sandbox.

Any agent, one set of rules

Mandate comes with its own Claude shopping agent, but the rules aren't tied to it. Your wallet is also an MCP server, so Claude, ChatGPT or your own bot can connect and shop under the exact same mandate. Outside agents can read the rules but have no tool to change them, and every purchase goes through the same rules engine, PayPal and signed receipts.

Every agent gets its own allowance, and a kill switch

Each connected agent gets its own link, its own spending limit, its own meter and a Revoke button. Claude might get $25 a month and a coupon bot $10. An agent's own limit is checked after your rules and can only make the answer stricter. Revoke is instant: the key stops working, anything the agent was waiting on is cancelled, and a later attempt shows up in your feed as refused.

Even PayPal's own Agent Toolkit obeys your mandate

The same connection gives an agent every tool from PayPal's official Agent Toolkit: orders, refunds, invoices, subscriptions, disputes and reports. Mandate sorts every call before it reaches PayPal. Reads run right away. Orders, invoices and refunds within your approval limit run. Everything else (paying an order, accepting a dispute, a subscription, or any unknown tool) waits for you to press Approve and run. So a business can hand an AI agent real PayPal powers without handing it the keys.

What makes it different

Most shopping agents put the budget in the prompt and hope the model follows it. Agent frameworks, including PayPal's Agent Toolkit, let you switch a money tool on or off, but not say how much, on what, or how often. In Mandate, the model never decides whether money moves: every money move is checked against amount, budget per period, category, store, per-item cap, approval limit and each agent's own allowance, and every receipt can be verified by anyone.

  • The agent proposes, code decides. Claude can suggest a cart, but only the policy engine can approve it, and only you can change the rules.
  • Try to break it yourself. The Attack arena fires 8 real attacks at the agent at once: a fake system override, a forged approval code, a disguised category, split orders, a fake tool result, urgency, a budget drain and a role-play jailbreak. Then one click reruns them against a jailbroken agent told to obey everything, so only the rules engine is left. 0 of 8 got through, both times.
  • Approvals only you can give. With a passkey turned on, the passkey signs a one-time challenge made from that approval's exact items and total, so no agent or script can approve a purchase, and one approval can't be reused for another cart. The receipt carries that signature, and the verify page checks it.
  • You don't have to trust our server. Confirmed rules and every receipt are signed (Ed25519). The Verify link on each receipt opens a public page that checks both signatures, re-runs the rules on the signed cart, and asks PayPal whether the payment is real and for the same amount.

How we built it

  • Rules enforced in code. Every cart goes through a policy engine (checkCart) before any money moves: budget left this period, allowed categories and stores, blocked words, per-item cap, approval threshold, and split-order detection. The model has no tool that skips it.
  • Claude as the agent (Anthropic API, tool use) with six tools. Money only moves inside propose_purchase and refund_purchase, after the policy check.
  • PayPal end to end: Vault v3 saves the wallet once, Orders v2 with a vault_id pays without a redirect, Orders v2 Checkout lets you approve on PayPal, Payments v2 handles full and partial refunds, and signature-verified webhooks (PAYMENT.CAPTURE.*) confirm what really happened. Plus @paypal/agent-toolkit behind a per-call policy.
  • Any agent over MCP: a hand-written Streamable HTTP MCP server per user, tested with the official MCP SDK. Channel3's API powers product search.
  • Tested where money moves: 61 unit tests (Vitest), including property tests that run the rules engine on 5,000 random carts and mandates and check that nothing ever overspends the budget, gets paid automatically above the approval limit (even split into small orders), or slips past a category, store or price rule. They also cover per-agent limits and revoke, how toolkit calls are sorted, and receipt signatures. A GitLab pipeline runs lint, type check, tests and a build on every push.

    Challenges we ran into

  • Stopping the agent from splitting one big purchase into several small ones to slip under the approval limit. The policy engine now counts everything bought in the same request, and outside agents' recent orders count together.

  • Money edge cases: double clicks, two tabs, and refunding the same item twice. Each user's requests now run one at a time, and every refunded unit is tracked.

  • Keeping our numbers true when things happen outside the app, like a refund made in the PayPal dashboard or a chargeback. Webhooks solved this.

  • Mapping messy real-world product categories onto rules a parent can understand.

Accomplishments that we're proud of

  • The rules can't be loosened by the agent, even when the agent itself is jailbroken.
  • Every purchase can be explained and independently verified: what was bought, why, which rule allowed it, and PayPal's confirmation.
  • The full PayPal flow works live in the sandbox: save a wallet, pay, approve on PayPal Checkout, refund, and confirm by webhook.

Honest limits

  • PayPal sandbox only. No real money moves, and real Channel3 listings are paid to the demo's own sandbox account, not the store.
  • The 8 arena attacks are ones we wrote, so 0 breaches is a demo, not a security audit. There has been no independent review. What we can state firmly is narrower: the model never decides whether money moves, the rules engine does, and its invariants are tested on 5,000 random carts.
  • One user per browser, with no accounts yet. Passkeys are optional in the demo, so without one an approval is still a tap.

What we learned

Trust in an AI agent comes from hard limits plus clear receipts, not from a smarter prompt. PayPal's Vault, Orders and webhooks map almost one to one onto what an agent with a budget needs.

What's next for Mandate

  • Paying the real store: hand an approved cart to the retailer's own checkout, instead of paying in the sandbox.
  • Several people per family or team, each with their own mandate and agents.
  • Monthly spending reports, and alerts when the budget runs low.
  • Signed mandates in AP2's format, so merchants and PayPal can refuse a payment that breaks the rules before it happens.
  • A business model: free for families, and a paid tier for small offices with several agents, manager approvals and reports.

Built With

  • anthropic-api
  • channel3
  • claude
  • gitlab
  • mcp
  • next.js
  • paypal
  • paypal-agent-toolkit
  • paypal-checkout
  • paypal-orders-api
  • paypal-vault
  • paypal-webhooks
  • render
  • tailwind-css
  • typescript
  • vitest
Share this project:

Updates

Submission history