Inspiration

A store's own pricing mistake can sell out before anyone notices. In 2024 a Tmall franchise listed Little Swan washing machines at ¥299 instead of ¥1,699 and took over 40,000 orders in about 20 minutes. MediaWorld sold iPad Airs at €15, and Digitec sold cameras at CHF 35. In every case the buyers had paid before a human looked. Deal bots and AI shopping agents now find a mispriced listing in seconds, so that window keeps shrinking.

We wanted to stop it at the one place every order passes through: PayPal checkout.

What it does

Tripwire sits between a store and PayPal checkout, and shows each product as a breaker on a panel.

  • A clear mistake trips that product's breaker. A slipped decimal (down or up), a price below cost, or a price the AI calls implausible is refused before a PayPal order exists.
  • A deep discount that might be real goes under review. It keeps selling, but every order is only authorized: PayPal reserves the money and capture waits for the merchant. One click confirms and captures; a reset voids.
  • A rush trips the breaker. More than 5 units of one item in a minute, the shape of a bot or AI-agent rush, trips it, and the rest are refused before PayPal.
  • Code decides first. The AI can add a hold but never lift one. Only the merchant resets a breaker.

In the demo, a fictional electronics shop (Fernbrook Supply) runs Tripwire. Its TV's price slips from $1,299.00 to $129.90 and 25 bots rush it. PayPal's panel ends at 0 of 25 bots reached PayPal, and the merchant presses and holds a lever to reset the TV at the right price. Every authorization, capture and void on screen carries a real PayPal sandbox ID.

How we built it

  • PayPal Orders v2 with intent AUTHORIZE, and Payments v2 capture and void, with a PayPal-Request-Id idempotency key on every POST, retries on 429 and 5xx, and debug_id logged.
  • PayPal JS SDK v6 buttons (PayPal and Venmo) in the demo store.
  • PayPal webhooks, each checked with verify-webhook-signature, so a void, capture or refund made directly in PayPal shows up in Tripwire. Settlement also asks PayPal for the order in case a webhook is missed.
  • AI price check: Groq openai/gpt-oss-120b estimates the market range as validated JSON. Live US retailer prices from Channel3 can only make a decision stricter.
  • A merchant gate API (/api/v1/check, /api/v1/capture-check) and an MCP server (check_price, check_capture), so a real store or an AI agent asks Tripwire before it creates and before it captures a PayPal order.
  • Cloudflare Workers with one SQLite Durable Object per store. Every decision is synchronous SQL before any PayPal call, so a rush cannot race past the breaker.
  • Plain ES modules with no dependencies, 215 automated tests, and four live end-to-end scripts against the PayPal sandbox.

The rush rule counts units, not orders. An item trips when \( \sum q_i > 5 \) over the last 60 seconds, so one 500-unit order trips it just like 6 bots do.

Challenges we ran into

  • Not blocking real sales. A 53% doorbuster may be genuine, so it keeps selling and waits for capture instead of being refused.
  • Keeping the AI away from the money. It runs after the code rules and can only make a decision stricter, never release a hold.
  • Settling what happens outside our own calls: buyers whose page never came back, expired authorizations, and refunds or voids made directly in PayPal.
  • Making a safety tool readable in seconds. We drew it as a real breaker panel, so you can see what tripped and why at a glance.

Accomplishments that we're proud of

  • The full loop runs live on the PayPal sandbox: a refused bot rush, an authorized order captured only at a confirmed price, and a void made in PayPal reaching Tripwire in 16 seconds.
  • A real LLM shopping agent calling our MCP server was told to buy the $1,299 TV listed at $129.90. It got HOLD and told its user it could not order.
  • In a sourced evaluation of 30 documented price mistakes and 27 genuine deep sales, Tripwire stopped 28 of the mistakes before capture and turned away only 3 of the real sales.

What we learned

The best moment to catch a pricing mistake is between "buy" and "capture", and PayPal's authorize-then-capture flow makes that moment real. The AI is good at spotting a price that looks wrong, but the decision to release money belongs to code and the merchant.

What's next for Tripwire

Shopify and WooCommerce plugins that call the gate, per-merchant thresholds, and alerts when a breaker trips.

Built With

Share this project:

Updates

Submission history