Inspiration

Two questions bugged me. Would anyone actually hand an AI agent their wallet? And why does digital payment die the moment the network does: at a packed festival, on a flight, in a basement market? LeashPay answers both with one idea: put the money on a leash.

What it does

  • Set the leash: write rules in plain English ("food and rides only, max $15, no alcohol"). AI turns them into a strict policy and tells you what it assumed. PayPal then holds your allowance without charging it.
  • AI shopping agent: it shops a demo store for you. Every purchase is a partial capture from the PayPal hold, but only after the Policy Judge approves it. Try buying beer and it gets blocked.
  • Offline Show-to-Pay: with no internet on either phone, the buyer shows a signed QR code and the seller verifies it locally. When the seller is back online, LeashPay captures from the hold and pays the seller via PayPal Payouts. An AI review flags suspicious batches.
  • Bring your own agent (MCP): any AI agent, like Claude Desktop, can shop with a capped, revocable key. In testing, Claude even refused to split an order to get around the cap.
  • Every decision on record in an AG Grid dashboard. Closing the allowance voids the hold and returns the rest.

How we built it

FastAPI + SQLModel on Render with Supabase Postgres; a Next.js PWA (static site on Render) that works offline; PayPal Orders v2 (AUTHORIZE), partial captures, void, refunds and Payouts v1; Gemini with automatic Groq fallback; Ed25519 signatures (PyNaCl / @noble/ed25519); the official MCP Python SDK. The core trick: the PayPal authorization hold is the offline guarantee, and each voucher's serial is the PayPal-Request-Id, so PayPal itself prevents double charges. The key design rule: deterministic code decides, the LLM never approves money.

Challenges

  • Making phone and server sign byte-identical JSON so offline verification never breaks.
  • Safe settlement: replay protection, idempotent retries, late syncs, and making sure offline exposure can never exceed the hold.
  • Sandbox details: Indian sandbox accounts failed on currency, and Payouts v1 vs v2 field names differ.
  • Free-tier LLM limits mid-demo, solved with one call per turn and automatic Gemini → Groq fallback.

What I learned

How to design agentic payments that people can trust, how much the PayPal authorization model enables beyond checkout, and how to ship a full, tested, deployed system fast with AI coding agents.

What's next

Real merchant onboarding, NFC tap-to-pay, multi-currency, family and team allowances, and pushing the same leash model to more agent platforms.

Built With

Share this project:

Updates

Submission history