-
-
Home page: a second look before money leaves. The shield follows your cursor.
-
How it works: money is reserved on PayPal, rules and AI read the message, then low, medium or high risk decides.
-
Demo mode: three one-click scenarios so judges can try it with no keys.
-
Sender view: a high-risk payment is on hold, with the suspicious words highlighted and the screenshot beside them.
-
Guardian review: evidence labelled AI or Rule, the scam pattern, payee history, then Approve or Decline.
-
AG Grid case log: a plain-English question became two filter chips, with preset views and totals.
-
AG Charts insights: payments over time, top scam categories and the most-flagged recipients.
-
Medium risk: a real $350 payment to a new contractor is double-checked, not blocked.
Inspiration
Scammers don't hack accounts. They talk people into paying: a polite "bank" text, a "safe account", a gift card. Payment apps see the payment, but not the conversation that caused it. We wanted a second look before the money leaves, from someone the sender trusts.
What it does
SafePay Guardian checks a payment and the message (or screenshot) that asked for it.
- Low risk: goes straight through.
- Medium risk: the sender is asked to confirm.
- High risk: waits on hold for a guardian, who can ask the sender a question, then decline or approve.
The money is only reserved on PayPal (authorized), not taken. If the guardian declines or nobody answers in time, the authorization is voided and nothing is charged. If approved, it is captured.
The guardian's side has a live case log (AG Grid Community) with preset views, quoted evidence, totals and a CSV report, and an Insights page (AG Charts Community) with payments over time, top scam categories and flagged recipients.
How we built it
- PayPal sandbox (Orders and Payments v2): create order with AUTHORIZE intent, then capture or void. Every PayPal call carries a deterministic PayPal-Request-Id, so a retry can never charge twice. A background sweeper retries uncertain calls, and every authorization is read back from PayPal and checked.
- Gemini 3.1 Flash-Lite: reads screenshots of scam messages, writes the risk analysis as structured JSON, and turns a plain-English question into validated, read-only grid filters. An AI reason is kept only if it quotes the message word for word.
- Rules plus AI: a rules engine and a scam-pattern library run first, so the app still works (and says so) when the AI is unavailable.
- Backend: FastAPI and SQLite. Frontend: React, TypeScript and Vite, with AG Grid Community and AG Charts Community.
Challenges
- Never charging twice or losing track of a payment: a claim-before-PayPal state machine, idempotent requests, a capture-pending state and a hold-deadline guard.
- Trusting AI safely: quoted evidence only, labelled AI or rule, and a clear rule for when the AI is down.
- Being honest about results: we say "held from capture", not "money saved", because we cannot prove each held payment was fraud.
Accomplishments we're proud of
- On 69 unseen test cases, all 46 scams were flagged (44 held) and none of 17 everyday payments was held.
- 206 backend and 75 frontend tests, and a rehearsal that plays all three demo scenarios through the real PayPal sandbox and cross-checks every authorization.
- Anyone can run it with no keys: judge mode uses a built-in fake PayPal and stored AI replies.
What we learned
Money-moving code needs the boring parts first: idempotency, a clear state machine and read-back checks. The AI is most useful when it must show its evidence.
What's next
Real sign-in and guardian pairing, verified payee identity, webhooks and hosting.
Honest limits
Sandbox only (test money). No real login or guardian pairing yet. Rules alone miss some scams, which is why the AI and a human decide. The demo video uses stored Gemini replies so it does not depend on free-tier limits; the same prompts run live.