Inspiration
Settlement funds are flooded with fake claims. One administrator received 80 million fraudulent claims in 2023, up 19,000% since 2021 (Jones Day), and 49% of 1.77 million claims in the Celsius settlement were fraudulent (FRT). Every fake that is paid comes out of a real class member's share.
Today's choices are to pay everyone, deny in bulk, or let a model decide. Checking who files only goes so far: a claim also rests on its proof, and a convincing fake receipt is cheap to make. We wanted a desk where AI does the reading, code does the deciding, people approve the money and PayPal moves it, with every dollar traceable.
What it does
- The AI examines the evidence, and the rules can overrule it. Claude reads each receipt photo into structured findings (store, address, date, line items, subtotal, tax, total). It cannot decide or pay. Twelve checks in code (class period, product, arithmetic, sales tax against the store's address, geography, duplicate images, template declarations, identity, velocity, visual anomalies, units, repeat receipts) feed a versioned decision table: approve, deny, ask for one more document, or send to a person.
- Money needs two people. An analyst proposes the exact round and signs it; a different supervisor approves; only then does PayPal Payouts send it. Every item is read back from PayPal and shown as unconfirmed until PayPal confirms it.
- Leftover money goes to the court's charity (cy-près). Unclaimed money comes back after 30 days, is offered to the claimant again, then goes to the court's chosen nonprofit in a second Payouts batch, again with two people.
- A pre-registered test with honest misses. The claims, labels and pass mark were committed before any run, and every miss is named in the repository.
Around that core: every claim starts with Log in with PayPal (one verified PayPal account, one claim, and the money can only go to that account); linked claims (shared device, inbox or near-identical words) are held as a group for a person; a public court report and ledger let anyone verify every decision in the browser; and AI assistants can file for people through an MCP server, with the person confirming via Log in with PayPal.
How we built it
- PayPal: Payouts (batch IDs that make retries safe; every item read back), Log in with PayPal (verified status and payer ID; payouts go to the payer ID), Webhooks (each delivery verified with PayPal before it is stored), Transaction Search and Balances through PayPal's Server SDK (generated by APIMatic, set up with the APIMatic Context Plugin). Sandbox only, enforced in the client.
- AI: Claude Haiku 5.5 reads receipts and writes the ring investigator's notes; Claude Sonnet 5.5 was the comparison. Findings follow a strict schema; spend is capped in code. AG Studio's desk agent runs on Claude with read-only tools.
- Evaluation: 157 labelled claims (real restaurant receipts from a public dataset, plus rendered and edited fakes), committed with the pass mark before any run, scored three ways: pay everyone, model alone, Proof of Claim. An eval gate runs before every deploy.
- Next.js, TypeScript, PostgreSQL, a worker for read-backs and cy-près, Railway, AG Grid and AG Studio, Bryntum Scheduler, Playwright and Vitest (1,004 unit tests, 26 browser tests).
Results (100 held-out claims no rule or prompt was tuned on)
- $40 of fraud paid, against $1,620 if everyone were paid (worst case, if every claim sent to a person were approved: $245).
- 3 of 41 honest claimants wrongly denied (the model deciding alone denied 8).
- The rules overruled Claude's "approve" 30 times; 28 of those were fraud or didn't qualify. 7 fake receipts were caught by a sales tax their store's address can't have.
Challenges we ran into
- Our first idea, a guard for AI refund agents, failed our own pre-registered test: Claude agents were not talked into bad refunds (0 of 33 attacks). We stopped and moved to settlement fraud.
- On our first live payout, PayPal refused a batch ID our laptop had already used on the same sandbox app, and our retry-safe code adopted the old batch. No money moved twice; every batch ID now carries its own database's name.
- PayPal's sandbox transaction history stopped refreshing for over five hours, so the app shows "waiting for history" instead of pretending a payout is confirmed.
Accomplishments that we're proud of
The held-out numbers above, with every miss written down. And the end-to-end money path in the video is real: a sandbox claimant logs in with PayPal, is approved, two people pay him, PayPal reports PROCESSING then SUCCESS, and his $10 lands in his PayPal account.
What we learned
Letting the model decide is the weak point; letting it read is the strength. A fake with an impossible sales tax fools the model and not the rule. And every honest miss we found is something a person can review, which is why unknown never shows as safe.
What's next
A real claims administrator's settlement, purchase proof from the merchant's own PayPal records, a private demo copy per visitor, and fixing the duplicate-image false positive we kept and reported.
Built With
- ag-grid
- ag-studio
- anthropic
- apimatic
- bryntum
- claude
- log-in-with-paypal
- model-context-protocol
- next.js
- paypal-payouts
- paypal-server-sdk
- paypal-transaction-search
- paypal-webhooks
- playwright
- postgresql
- railway
- typescript