-
-
Mandate Overview
-
Mandate Proposal
-
Mandate Payments
-
PayPal Sandbox
-
Sandbox Payment Approval
-
Mandate Payments Update
-
Payment Approved
-
Test Cases Run
-
Test Cases
-
AG Grid Analytics
-
Recovery Tab
-
Mandate Payement Legder
-
Mandate Grant history
-
More Payments Queue
-
Payment Ledger
-
Ledger
-
Wallet Overview of Mandate
-
Mandate Dark Mode
Inspiration
AI agents are starting to buy things for us. But giving an AI your payment details is a gamble: one tricked prompt, one wrong price, or one runaway loop and your money is gone. Asking a human to approve every purchase defeats the point of having an agent. We wanted a third way: let the agent act on its own, inside limits that code enforces, not the AI.
What it does
Mandate sits between an AI shopping agent and PayPal.
- You set the rules once: total budget, max per purchase, which stores and categories are allowed, and when it expires.
- The AI can only suggest what to buy. It never sees your payment details, never sets prices, and never approves anything.
- The server prices the cart itself and checks it against 11 rules. Each purchase is approved, blocked, or sent to you to confirm.
- Approved purchases are paid automatically through PayPal Vault, with no login for each one.
- If something arrives wrong, you can open a case and get a partial refund.
- Every decision is saved in a tamper-evident record you can verify.
All money is handled in whole cents, so there are no rounding errors.
How we built it
Python with FastAPI and PostgreSQL on the backend, and React with TypeScript on the front. We used the PayPal sandbox for orders, Vault, refunds and webhooks. Every payment call is safe to retry, and a background worker confirms the real outcome whenever PayPal's answer is unclear. A Groq-hosted AI model suggests items, and its output is strictly validated. If it's unavailable, a simple keyword matcher takes over. AG Grid powers the Decision Ledger and Payments tables. We also built a Render blueprint, a Postman collection, an optional Zapier connector and a Channel3 product-search adapter.
Challenges we ran into
- Keeping the AI away from the money. The server recomputes every price, and any mismatch is an automatic block.
- Not knowing if a payment went through. When PayPal times out, we hold the funds and check PayPal's records before settling.
- Vague requests aren't attacks. If you ask for a 160 cm desk and the listing doesn't state its width, Mandate asks you instead of guessing.
- Keeping our docs honest. Our first generated docs didn't match the code. We checked every claim against the source and fixed what was wrong, including a wrong Channel3 endpoint that a live test exposed.
Accomplishments that we're proud of
- A full live run on the PayPal sandbox: set up Vault, charge automatically, confirm the payment, and refund part of it.
- 211 backend tests and 15 frontend tests, with real network calls blocked.
- 50 of 50 scripted attacks blocked, and 0 of 50 legitimate purchases wrongly blocked. These are our own test scenarios, so they show the rules work as designed, not that nothing can break them.
- An attack lab where anyone can try to beat the rules.
What we learned
Safety and autonomy aren't opposites. Keep the AI on the suggestion side, and make every decision that moves money predictable, testable and recorded. And "built" and "verified" are different things, so we check both.
What's next for Mandate
- Signed PayPal webhooks over public HTTPS.
- Wider merchant lists for catalogs like Channel3, still bounded by your rules.
- Optional recurring-spend limits.
- Moving beyond the PayPal sandbox.
Built With
- ag-grid
- alembic
- channel3
- docker
- fastapi
- groq
- hypothesis
- paypal
- postgresql
- postman
- pydantic
- pytest
- python
- react
- render
- sqlalchemy
- typescript
- vite
- zod