Inspiration

I run a small online shop in Korea that sells paper business forms, and I source from overseas suppliers. The rule there is pay first and hope. When a carton arrives 40 books short, or in a cheaper 2-part paper instead of the 3-part I ordered, the money is already gone and getting it back is slow or impossible.

At the same time, AI agents are starting to buy and sell for people, and the agent commerce protocols I looked at all settle in tokens on a blockchain. Small sellers already use PayPal. I wanted to see whether agents could trade with each other safely using nothing but PayPal.

What it does

ProofPay is a network of AI agents that negotiate and buy on a seller's behalf, where PayPal only pays once the delivery is verified.

  1. The owner writes the order as one sentence: "Buy 500 NCR receipt books, A5, 3-part, for at most $2.00 each, within 14 days."
  2. The buyer agent turns that into checkable terms and invites supplier agents: the four most trusted for that category, plus one that bought a sponsored slot.
  3. Supplier agents quote, the buyer agent counters, and they settle on final offers.
  4. The owner approves a hold in PayPal (Orders v2 with intent: AUTHORIZE). Money is reserved, not paid.
  5. An independent evaluator agent first confirms on PayPal that the money is really held, then compares the delivery with the deal: quantity, specification, lead time, and whether the evidence was reused.
  6. Pass: the authorization is captured and the supplier is paid. Fail: it is voided, the owner is never charged, and the buyer agent moves to the most trusted supplier left.

In the demo the cheapest supplier is a newcomer that paid for a sponsored slot. It ships 460 instead of 500 and a 2-part grade instead of 3-part, asks for full payment, and is rejected. The hold is voided. The next supplier ships exactly as agreed and is paid. Both outcomes appear as real PayPal sandbox transactions.

The agents work for their own account. Suppliers earn the sale when a delivery passes. Evaluators earn a fee for every check, whatever the verdict, so they have no stake in the outcome. The buyer agent keeps 10% of what it saves its owner. Agents also spend: a supplier outside the top four can bid its own earnings on a sponsored slot (which buys an invitation, never rank), and a supplier holding an order can hire another agent for part of it. After every order each supplier agent decides for itself how to price its next bid and whether to advertise. A Wilson-interval trust score ranks every supplier, so a short spotless record still scores lower than a long one.

How we built it

  • PayPal as the escrow. Orders v2 with intent: AUTHORIZE holds the buyer's funds; /v2/payments/authorizations/{id}/capture releases them and /void returns them. Every write carries a PayPal-Request-Id, so a retry can never double-charge.
  • PayPal Agent Toolkit. The evaluator agent is given the toolkit's get_order tool and checks the hold on PayPal before judging. That result becomes a hard check, computed from PayPal's response rather than the model's summary. The toolkit's tools are handed to Claude through a small tool-use loop, so the model chooses the calls.
  • Claude agents. Claude (Haiku) writes every quote, counter-offer, award note, verdict and pricing decision. Plain code enforces every number that touches money: price ceilings, cost floors, a spend limit, and the rule that the model can never approve past a failed check.
  • Guardrails a human sets. A per-order spend limit enforced before PayPal is called, and a human approval in PayPal for every hold. Agents cannot change either.
  • A tamper-evident record. Every message between agents is hashed together with the one before it.
  • Two views. "Your order" walks the owner through five steps with one action at a time. "Agent network" shows the market: rankings, earnings, sponsored slots and live activity.
  • Node.js with no framework, a single HTML page, deployed on Render.

Challenges we ran into

  • Korean accounts cannot pay each other on PayPal. The default sandbox accounts were created in Korea, so the first approval failed. We moved to US sandbox business and personal accounts.
  • The toolkit has no authorize or void tool. We kept the escrow on direct REST calls and used the toolkit where an agent should look things up or act on its own.
  • Invoices. We built a supplier agent that issues a PayPal invoice with create_invoice and records the payment, but our sandbox app kept answering 403 after Invoicing was enabled, so it ships switched off (enable with TOOLKIT_INVOICES=on).
  • Letting a model near money. Every model output that could move money is clamped or double-checked in code, and a failed field check always blocks the payout.

Accomplishments that we're proud of

  • The full loop runs on the real PayPal sandbox: negotiate, hold, check, then capture or void.
  • An agent economy where agents earn, advertise, subcontract and reprice on their own, and where advertising cannot buy the buyer's money.
  • A screen a shop owner can follow: one sentence in, one approval, a clear answer out.

What we learned

Escrow is the part of agent commerce that matters to a small business, and PayPal's authorize, capture and void already provide it without a wallet or a smart contract. The hard design problem is not giving agents freedom but deciding which decisions they get to make alone.

What's next for ProofPay

  • Real delivery evidence: photos checked by a vision model, including detection of reused or AI-generated product photos (I have a background in forensic photo analysis).
  • Real supplier agents connected over an open protocol instead of in-process personas.
  • Re-authorization for long lead times (a PayPal hold is honored for 3 days and valid for 29).
  • Partial capture for partial deliveries, and PayPal Payouts for evaluator fees and multi-party splits.

Built With

Share this project:

Updates

Submission history