Inspiration

AI agents are starting to shop and pay for people. But checkouts are full of dark patterns: protection plans already ticked, passes slipped into the basket, fees that appear only at payment, amounts no line explains. India's consumer regulator listed 13 of them in 2023, and the same tricks run on stores everywhere. A person sometimes notices. An agent following instructions usually doesn't, and some pages now carry text written to instruct AI agents.

We wanted agents to pay with PayPal safely, without anyone having to trust the AI with money.

Who it's for

  • People who let an AI agent shop for them, so the agent can't be tricked into paying more than they agreed to.
  • PayPal, as a wallet-side guard for agentic commerce. The wallet already sees every order and knows what the buyer approved, so it is the natural place for this check.
  • Honest merchants, who get a fairness record that shows they don't play these tricks.

What it does

You tell your agent what to buy and the rules: the most to spend, and which fees are fine. PennyWise signs this as an intent mandate.

The agent shops a real-looking store of 174 products in a live browser. PennyWise reads every page and marks each trick it finds with a numbered badge. The agent undoes what it can: it declines upsells, unticks add-ons, removes what you never asked for, and disputes amounts nobody explains.

At checkout, a deterministic checker re-adds the bill and compares it with your mandate. Anything outside the rules is blocked, and only you can approve an extra fee, by name.

When the cart matches, PennyWise signs a cart mandate. You log in to PayPal once, at the end, and the agent pays by itself:

  1. PayPal authorizes and holds the money.
  2. PennyWise reads the order back from PayPal and checks it line by line.
  3. Only then is it captured.

The receipt shows what the store tried to charge, what was blocked, and what you paid. In the demo: DemoMart tried $21.95. You paid $13.97.

  • Peek shows any product's hidden costs without buying anything.
  • Merchant fairness, built with AG Grid, turns every run into a per-merchant honesty record.
  • The site opens with a 45-second product demo that plays by itself.
  • Try it yourself runs the live agent and PayPal sandbox on two stores with the same shelves: DemoMart, with a trick on every product, and FairMart, the honest control.

How we built it

  • AI planner: Google Gemini plans one page at a time through a single forced function call. Every action is checked against the controls actually on the page. The planner never sees raw HTML and has no tool that can pay, approve a charge or change your rules. A labelled backup planner (no AI) covers any page where Gemini is unavailable.
  • PayPal:
    • Orders v2 through PayPal's TypeScript Server SDK (generated by APIMatic);
    • Vault v3 to save the buyer's wallet for the agent;
    • intent AUTHORIZE, then verify, then capture (or void on any mismatch);
    • JS SDK buttons for buyer-approved payments;
    • verified webhooks to settle captures.
  • Engine: FairCart, our dark-pattern engine: a rule pack for the 13 regulator-listed categories, page adapters that read prices, bills, add-ons and pop-ups from any store page, and a journey model that catches fees appearing late.
  • Checker: a pure TypeScript function. Money is integer cents; mandates and authorizations are HMAC-signed and single-use.
  • Product: a React console and a Hono server on Render, deployed from a Blueprint with a persistent disk for the fairness ledger.

Challenges we ran into

  • Agents don't see what people see. We read pages through FairCart's structured adapter, so text on the page aimed at AI can't steer payments.
  • A saved wallet could pay before anyone checks. We use intent AUTHORIZE, so PayPal only holds the money until PennyWise has compared the order.
  • Free-tier AI is sometimes slow or overloaded, and sometimes returns a plan that doesn't fit the page. The labelled backup planner covers that page, and finishes the run if the AI can't be reached.
  • Making the product easy to understand. We rebuilt the experience several times after a teammate's honest feedback, ending with a self-playing demo first and a simple "Try it yourself" second.

Accomplishments that we're proud of

  • Nothing the AI outputs can move money or change an amount.
  • The same engine works on any product in either store, with nothing written for a particular product.
  • The vocabulary lines up with the Agent Payments Protocol: intent and cart mandates, human-present and human-not-present payment.

What we learned

Trust in agent payments shouldn't depend on the model being smart. It should depend on a small piece of code the model can't talk its way past, and on the wallet seeing what the merchant charges.

What's next for PennyWise for PayPal

  • Run the checker inside the wallet, where PayPal already sees every order.
  • Attach mandate IDs to disputes as evidence.
  • Bring the same engine to people shopping by hand, through the FairCart browser extension.

Built With

  • ag-grid
  • agent-payments-protocol
  • apimatic
  • gemini-api
  • google-gemini
  • hono
  • node.js
  • paypal
  • paypal-javascript-sdk
  • paypal-orders-api
  • paypal-server-sdk
  • paypal-vault
  • paypal-webhooks
  • react
  • render
  • typescript
  • vite
  • vitest
  • zod
Share this project:

Updates

Submission history