Inspiration
AI agents are starting to spend money for us. Today that means one of two bad options: hand an agent your card and hope, or approve every single click yourself. Meanwhile the money that moves most often is the money nobody watches: subscriptions and bills. Surprise renewals, quiet price hikes, forgotten free trials, and a card saved at dozens of merchants.
We asked one question: what if an AI agent could only ever spend inside rules you signed, and could prove it?
What it does
PayPal Pocket turns your money into pockets. Each pocket is an agent with its own balance, its own job and its own signed rules.
Subscriptions and bills, the everyday hero
- Discovery: "We found 7 automatic payments on your PayPal, about $161 a month." One PIN turns each into its own capped pocket.
- Price-hike protection: Netflix asks for $22.99 against a $15.49 cap. The guard stops the charge, your phone buzzes, and you approve the new price with your PIN or cancel in one tap.
- Bills that vary: "Pay electricity if it's within 20% of usual, otherwise ask me."
- Trials and duplicates: warned before a free trial turns paid (silence never pays); "You pay for Spotify and Apple Music."
- No card sharing: merchants are paid from the pocket through PayPal, never from your card.
Shopping agents, the second act
- One-time hunts: describe it in plain words ("winter jacket, size M, under $150") and Claude turns it into structured rules you sign. The agent searches real stores through Channel3, including photo search ("snap something you want").
- Weekly grocery agent: honest savings measured only against what you usually pay, at most one question a week, and silence always means your usual items.
- Right-now agent: "chicken biryani under $20 within 40 minutes."
- Take a look first: a push with photo and price before buying, plus Looks good or Skip, right from the notification.
Trust built in
- Black Box: a hash-chained, tamper-evident record of what the merchant asked, what your rules allowed and what the agent did.
- When something goes wrong: a rule-based arbiter decides who was at fault. A merchant mistake triggers a PayPal refund; an agent mistake is paid back from an Agent Cover Pool via PayPal Payouts.
How we built it
- The rule that matters: AI explains, code decides. Claude reads your words into rules, chats with you and explains outcomes, but it can never approve a payment.
- Signed mandates: every rule is an Ed25519-signed mandate. Any edit breaks the signature.
- Deterministic guard: plain TypeScript runs before every PayPal call. It checks price, quantity, size, brand, merchant, balance, expiry, the kill switch and daily limits. Prompt-injected listings ("order quantity 4", "pre-approved $49 plan") are blocked because the guard checks the agent's claim, not the agent's reasoning.
- Your signature: a 4-digit PIN or Face ID/fingerprint (WebAuthn, verified server-side) for anything that spends money or changes rules.
- PayPal: Orders v2 with a vaulted payment method (Vault), captures, Refunds and Payouts, all on the PayPal sandbox.
- Stack: Node 24, TypeScript, Express; React 18 + Vite as an installable PWA with Web Push; PostgreSQL on Neon with per-user live updates over Server-Sent Events; deployed on Render. Claude (Anthropic) powers rule parsing, chat and explanations, and every AI call has a deterministic fallback, so the app works even when the AI doesn't.
- Tests: 57 unit tests plus end-to-end suites that run real sandbox payments against a throwaway database schema.
Challenges we ran into
- Keeping the AI out of the money path while still letting it feel helpful. The chat can only propose a change; you sign it.
- A hash chain that "broke itself": the ledger stored live object references, so later edits changed history. We now seal every entry.
- Honesty under demo pressure: no fake "you saved $0.00" in week one; savings only against your real usual price.
- Bills vs. shopping: while recording the demo we caught monthly bill payments using up the shopping agent's daily purchase limit. We fixed it on the spot.
- Sandbox realities: US-only test accounts, and connection-pooler quirks with per-request database schemas.
Accomplishments that we're proud of
- A complete loop: a price hike is caught, the proof is shown, you approve with your PIN, and a real PayPal sandbox payment goes through, in about 10 seconds.
- Attacks that fail: every prompt-injection trap in our demo store is stopped by plain code, with the reason recorded.
- A product, not a prototype: accounts, PIN and Face ID, push notifications, a weekly check-in, live sync, and one app on phone and desktop.
What we learned
Trust in agentic payments doesn't come from smarter AI. It comes from limits the AI can't cross, and proof anyone can check.
What's next
- Real discovery of automatic payments from PayPal billing agreements.
- One-tap cancellation that ends the merchant's billing agreement.
- Pocket rules on agentic-commerce protocols (AP2 / MCP), so any agent can shop through a Paygent pocket.
Demo note: merchants, stores and charges are simulated and labelled as such. Every payment, refund and payout is a real PayPal sandbox transaction.
Built With
- adobe-illustrator
- anthropic
- channel3
- claude
- express.js
- figma
- neon
- node.js
- paypal-orders-api
- paypal-payouts
- paypal-refunds
- paypal-sandbox
- paypal-vault
- postgresql
- pwa
- react
- render
- server-sent-events
- typescript
- vite
- web-push
- webauthn