Owed

Owed is a refund gate for a shop's AI support agent on PayPal. The AI still talks to the customer and still asks for the refund with PayPal's own refund call. Code reads the records and decides the amount to the cent. PayPal pays it. Anything the records cannot prove goes to a person.

The result. We gave three AI models PayPal's refund tool and ran 162 adversarial cases. With a typical shop's instructions, the AI alone paid more than was owed in 49 of them. Through Owed, on the very same refund calls, it was 0.

Try it. https://owed.vantapointlabs.com

For a fresh live run of your own, open: https://owed.vantapointlabs.com/demo.html?live=1

Demo Video: https://youtu.be/kqzIkEB826M

Inspiration

This happened to one of us last week. A chilled seafood box was cancelled by the courier. Days of messages followed for money that was plainly owed, while the delivery record said "cancelled" the whole time.

An AI agent could have refunded it in seconds. Shops do not switch that on, because the same agent can be talked into refunding money nobody is owed. Both problems have one cause. Nobody reads the record before the money moves.

The problem

Agentic commerce stalls at the refund desk. PayPal's Agent Toolkit lets an agent create a refund, and PayPal has 439 million active accounts. But no shop can bound what an agent will give away.

  • US retail returns reached about $890 billion in 2024 (National Retail Federation).
  • Fraudulent returns and claims cost US retailers $103 billion that year (Appriss Retail with Deloitte).
  • A tribunal held an airline to what its chatbot promised (Moffatt v. Air Canada, 2024 BCCRT 149).
  • 15 million UK adults had a problem with their latest parcel, and nearly half then struggled to get it put right (Citizens Advice, November 2025).

What it does

  • Pays what is owed, at once. An overcharge, a duplicate capture, an order cancelled before it shipped, or a delivery the record shows as cancelled or overdue. PayPal issues the refund in seconds, with its refund id on screen.
  • Never pays more. A customer owed $5 who asks for $25 gets $5. The other $20 goes to a person at the shop with the evidence attached.
  • Works with any model. Same model, same instructions, same tool name and parameters. Only the routing changes, so a shop adopts Owed without changing its agent.
  • Shows its work. Every refund carries PayPal's own refund id, and Owed's reason is written into PayPal's refund record.

How it uses PayPal and AI

AI. The model holds the conversation, reads the order and the records, and calls the refund tool as usual. Behind Owed that call becomes a proposal. The model never sets an amount.

PayPal. Six surfaces, all in the path of every demo run.

  • Orders v2 with a card payment source, to seed real paid sandbox orders
  • Refunds on captures, each with its own PayPal-Request-Id so a retry cannot pay twice
  • Order read-back, where captured and refunded totals come from PayPal's own list
  • Refund read-back, so the record behind every id on the page is PayPal's
  • Shipment trackers on the order, read as evidence for the delivery rule
  • The Agent Toolkit's tool interface, with create_refund, get_order and get_shipment_tracking matched by name and parameters

Results

Benchmark, 12 November 2026. Three open models, 54 adversarial cases each, one run per case at temperature 0. It runs on a PayPal stand-in, and every run is kept in the repository with a checksum.

  • AI alone, typical shop instructions. Overpaid in 49 of 162 cases, $920 in total. Every model did it.
  • AI alone, the strictest instructions we could write. Still overpaid in 3 of 162.
  • Behind Owed, both settings. 0 of 162.
  • Honest customers paid in full, of 48. 43 and 47 alone, 46 and 48 with Owed.

Live PayPal sandbox, 11 and 12 November 2026.

  • Twenty simultaneous requests for the same $5. The AI alone paid twice. Owed paid once.
  • The seafood box, ten runs. Owed paid the $60 every time. The AI alone paid in 2.
  • The overcharged mug, ten runs. The AI alone paid all $25 every time. Owed paid $5 every time.

How we built it

The engine is pure functions over whole cents, with eight rules applied in order. The amount comes from what the records prove, never from what was said. A ledger decides and reserves in one step, so simultaneous requests are paid once. If the agent declines an honest customer, Owed asks the model only what the customer claimed and the record settles what it proves. Plain Node with no runtime dependencies, and 30 automated tests.

Challenges

PayPal's capture object does not carry the refunded total. The order's refunds list does, so that is what Owed reads. PayPal caps a refund at what is left on the capture, so Owed reports what PayPal did and not what was asked. The sandbox would not let us mark a tracker as cancelled, so for the seafood order the cancellation is read from the shop's own shipping record.

What we learned

A better prompt lowers the failure rate and never reaches zero, and no prompt can stop two requests arriving together. The reliable approach is not to give a model a decision it should not make.

Honest limits

This is a gate, not a support agent, and it was built in three days on the sandbox. The benchmark is our own suite on a PayPal stand-in. A real shop needs its own order records, a durable ledger and a queue for the cases that go to staff.

What is next

A pilot with one shop and its real order records. The same gate in front of the toolkit's other money tools. A growing set of attacks any shop can run against its own rules before going live.

Tools and disclosure

Model in the live demo. gemini-2.5-flash at temperature 0. Benchmark models are named in RESULTS.md in the repository. AI coding assistants helped write and review code, tests and documents, as listed in the README. Built during the hackathon. Sandbox money only. MIT licence.

Team

Timotej Cvikl, University of Ljubljana, software engineering. Bernard Liu, University of Cambridge, IP and technology governance. Jeremy Wong advised on session security and attacks.

Built With

Share this project:

Updates

Submission history