Inspiration
AI agents can now shop and pay for people. Today the approval is usually one number: "spend up to $120." The shopper never sees how the agent read their request, what it looked at, or why it picked what it did. I wanted the shopper to see the agent's reading of their words, check it, and choose before PayPal moves any money. Before human says 'okay', it should not pay.
What it does
The demo page shows one purchase from three sides: PayPal on the left, the shopper in the middle, the merchant on the right. Each side shows the system process as the purchase runs. The payment processes under 5 main steps.
- Approve. One sentence says what it will buy. Anything the AI had to interpret is a guess chip, and the shopper sets how much guessing is allowed: check each guess, allow guesses, or use best guesses. The shopper approves with the official PayPal button, which saves their PayPal account for this purchase.
- Shop. It searches real store listings and drops anything over the limit, from the wrong store, or a gift card. The shopper watches each removal happen.
- Check. For every must-have, the AI must quote the store's own words. Code checks each quote really appears in the listing or return policy.
- Choose. The agent choses up to 3 options. Before any money is held, code runs the same rules enforcement will use. An option that can't pass says "Won't pass" and why. If only the shopper's own must-haves are unconfirmed, they can choose it anyway, and it asks them before PayPal charges. Hard limits, like the amount or a gift card, never move.
- Pay. PayPal holds the exact total. Plain code then charges, releases, or asks the shopper first when the price is over their ask-first amount or the item can't be returned. After paying, the shopper gets a receipt with the product photo and a link to the store. Refunds live in Your purchases. The store panel shows the proof id carried on the PayPal order. A store or PayPal can open the proof at /verify, which confirms it matches the order but never shows the shopper's own request.
How we built it
LLM Model (Claude) does three narrow jobs: it turns the shopper's words into rules, reads each listing for proof, and recommends one option. Plain code handles everything that touches money. It sets the limit, keeps the saved PayPal account, and decides whether PayPal charges, releases or asks first. For all the three jobs, I evaluated multiple LLM models on synthetic test cases to compare the quality and token costs. The cases passed only if all the test cases passed 3 runs. The app runs on Next.js 16 and Render, with PayPal's sandbox APIs and Channel3 for live product search.
Challenges we ran into
- Reading what a shopper means was the hardest AI job. "Under $50 for all of them" is a total, "Brooks" means brooksrunning.com, and "ask me if it's over $100" is a question, not a limit. I wrote 39 test requests and ran each model 3 times on each. Any mistake that could spend money against the shopper's wishes failed the model. Only Claude Sonnet 5 at high effort had none; at medium effort it turned "Brooks" into brooks.com in 2 of 3 runs.
- Many stores block automated reads of their return policy. We only store policies we could read word for word, and treat "no policy found" as "can't be undone", so the shopper is asked first.
- Live search results change with wording. We made the search query depend on the shopper's rules, not on how the AI phrased the item.
Accomplishments that we're proud of
- One purchase seen from three sides at once: every PayPal call (Vault, hold, capture or void, read back) on the left and every store quote on the right, from real sandbox responses, not a scripted replay.
- Zero critical mistakes for the chosen drafter and checker in every eval run. The pick's one flagged case was not a false claim when read by hand.
- A prompt-injection demo: the same fooled agent takes $100 under a total-only approval and is blocked twice under ours.
- 181 automated tests, including 10,000 random cases where no charge ever breaks a promise to the shopper.
- A proof id on every PayPal order (custom_id), so a store can match the order to what the shopper approved.
What we learned
Trust comes from what the shopper can check and track transparent reasoning on agentic payment. Showing a guess as a guess, and "couldn't confirm" as a no, mattered more than a smarter model.
What's next for Okay-Pay
Return policies for more stores, the proof record in PayPal disputes, and testing the approval screen with real shoppers.
Built With
- anthropic
- channel3
- claude
- next.js
- node.js
- paypal
- react
- render
- tailwindcss
- typescript
- zod