Inspiration

PayPal's fraud systems protect PayPal. Almost nothing protects the buyer in the moment before they click "pay" — and that's exactly when invoice scams land: a lookalike merchant name, a typosquatted domain, an amount that's almost right, language engineered to make you hurry. I've been on the receiving end of payment fraud, and I wanted the buyer to have the same kind of risk picture the platforms keep to themselves.

What it does

Aegis Pay has two halves:

  1. See — Paste in a PayPal invoice or payment request and an AI agent scores it 0–100 for scam patterns: lookalike/typosquatted merchant names and domains, anomalous amounts, urgency and pressure language, and mismatches between who is asking and who usually gets paid. A deterministic signal engine does the measuring; an LLM reasoning core weighs the signals and returns a plain-English verdict — SAFE, CAUTION, or LIKELY SCAM — with the reasons spelled out.
  2. Block — For requests that pass, the agent mints a single-use virtual card (via the Privacy.com API) capped at the exact invoice amount, to the penny. The merchant never sees your real card number, and any later rebill or inflated charge is hard-declined at the network. Scam verdicts get no card at all.

How I built it

Python and Flask, stdlib-first where it counts. A PayPal sandbox REST client pulls the invoice; five deterministic detectors extract signals; the verdict layer calls an LLM (OpenRouter, GPT-4o-mini by default) with a rule-based fallback; the card layer talks to the Privacy.com API. Everything runs in a fully functional mock mode — five labeled demo fixtures (3 scams, 2 legitimate) score end-to-end with zero API keys, so judges can run the whole flow in one command: python demo.py. The web UI is a single-page Flask app.

Challenges

Keeping the demo honest. It would have been easy to fake a slick front end; instead the mock mode runs the real pipeline against labeled fixtures, so the scores judges see are the scores the code actually produces. The other challenge was the verdict design — a raw score isn't useful to a buyer, so the agent has to explain itself in plain English, in order of what mattered most.

Accomplishments I'm proud of

The complete loop works: invoice in, risk verdict with reasons, and a capped single-use card minted for anything that passes — including the negative case, where a scam verdict blocks the card entirely. All five demo fixtures land on their expected verdicts.

What I learned

Fraud detection is an explanation problem as much as a scoring problem. People don't need another number; they need to know why a request smells wrong, in the ten seconds before they decide.

What's next

Live PayPal invoice pulls beyond the sandbox, a browser extension that scores payment requests in place, and letting the agent learn a user's normal payees so "unusual for you" becomes one of the signals.

Built With

Share this project:

Updates

Submission history