Inspiration

AI agents can now refund and cancel on PayPal, so one tricked chat can cost a merchant real money. I wanted a billing agent a merchant could trust: the AI proposes, our code decides.

What it does

Customers ask in plain English. PayPilot explains charges, cancels subscriptions, requests refunds, and hands off to a human, all through PayPal's sandbox API.

  • Each action is a skill with conditions checked in code: it's the customer's item, the AI looked it up, and the customer said "yes" in a separate message.
  • The merchant's policy then decides: do it, send it to a person, or decline. Every decision needs a reason, which the customer sees.
  • It never pushes cancel or refund. If someone asks to cancel, it makes one warm retention offer.
  • Every action goes into a tamper-evident audit log.

How I built it

TypeScript, Node, Express, React, SQLite, PayPal Sandbox, and NVIDIA Nemotron, with Gemini and a scripted AI as fallbacks. It runs with no keys in demo mode. Claude Code helped me code it.

Challenges

  • The AI claimed "discount applied" when nothing happened, so I added checks that replace false claims with facts.
  • "Refund everything" attacks slipped small refunds through, so I limited each message to one account change.
  • My first PayPal sandbox accounts couldn't take payments, so I rebuilt them in the US region.

What I learned

Prompts aren't security. Code the AI can't talk past is.

Code: https://github.com/sinehan001/PayPilot (MIT)

Built With

Share this project:

Updates

Submission history