-
-
Landing page: two AI agents negotiate, humans authorize, PayPal executes
-
Buyer sets financial rules, enforced by backend code, not the AI
-
Buyer and seller agents negotiate over several rounds (seller is simulated)
-
Before anything is paid, the buyer reviews the exact final terms and the policy engine's verdict.
-
Deterministic policy engine checks the final deal; the buyer then approves the exact terms.
-
Approved terms sealed in a SHA-256 snapshot, with a single-use 15-minute authorization.
-
Real PayPal Sandbox payment captured by the backend after buyer approval (status COMPLETED).
-
Demo tool: simulates the seller changing the amount after approval, to show the Integrity Shield catching it before capture.
-
The Integrity Shield blocked a payment because the approved terms changed; the audit log records which check failed.
-
Dashboard: completed, blocked and active deals
Inspiration
AI agents can already research, haggle and buy, but nobody wants an agent that can overspend, be talked into a bad deal, or pay an amount the user never approved. We built a trust layer that lets agents negotiate while the human and the code keep control of the money.
What it does
A buyer describes what they need and their limits in plain language: product, quantity, maximum budget, currency and delivery deadline. A buyer agent and a simulated seller agent, both powered by Gemini, negotiate over several rounds.
A deterministic backend policy engine then validates the final agreement against the buyer's original limits. The buyer approves the exact deal, which freezes it into a SHA-256 snapshot and creates a single-use, 15-minute authorization.
The backend creates a real PayPal Sandbox order and the buyer pays. Before capturing, the Integrity Shield fetches the live order from PayPal and re-checks 11 conditions, including amount, currency, merchant and agreement id. If anything has changed, the payment is blocked.
Every step lands in an audit trail that explains why a deal was accepted or blocked.
How we built it
- PayPal: Checkout REST API (Orders v2) in the Sandbox: OAuth, create order, fetch order for verification, and capture, with idempotency keys. No simulated success.
- AI: Gemini powers the two negotiating agents and the natural-language rule parser. Agent output is validated with Zod, seller text is treated as untrusted, and the server clamps every offer.
- Stack: React, Vite, Tailwind CSS, Node.js, Express, MongoDB Atlas, JWT. Hosted on Vercel and Render.
Challenges we ran into
Making agents that genuinely negotiate yet can never break the rules. We moved every limit into deterministic code and covered it with 31 automated tests. We also handled model overload and slow responses with fallback models, retries and timeouts.
Accomplishments that we're proud of
A complete flow from a natural-language request to a real PayPal Sandbox capture, plus a live demo of the Integrity Shield blocking a payment after the seller changes the amount.
What we learned
AI is good at negotiating and bad at being the last line of defense. Keeping authority in code and the human makes agent commerce explainable and safe.
Limitations
The seller is simulated, and PayPal Sandbox payments are not escrow. The authorization is backend-managed, not PayPal-issued.
What's next
Real merchant integrations, multiple sellers competing, and richer policy rules.
Built With
- express.js
- gemini-api
- jwt
- mongodb-atlas
- mongoose
- node.js
- paypal-checkout-rest-api-(orders-v2
- react
- render
- sandbox)
- tailwind-css
- vite