"Pause the payment. Not the person." SecondSight adds a calm AI safety check before PayPal checkout so coercive scams get paused before money ever leaves an older adult's account.


Inspiration

Scammers target older adults with fake arrest threats, IRS calls, tech support popups, or panicked "your grandchild is in jail" stories. Almost all of them use the same two tricks: push the victim to pay immediately, and tell them to keep it secret from their family.

Once an instant payment settles, the money is basically gone. On the other hand, normal fraud systems flash big red "FRAUD BLOCKED" warnings that embarrass people or make them think their account is broken.

We wanted something gentler and more practical: instead of accusing the person, just pause the payment inside PayPal and give a trusted family member a chance to look it over.


What it does

  1. Simple Elder Checkout + Voice Input: The older adult types who they are paying, the amount, and why. If typing feels slow or annoying, they can tap Speak instead and say it out loud using the browser's Web Speech API. We used warm paper tones (#F7F4EE), Atkinson Hyperlegible and Newsreader fonts, 20px+ input text, and large (48px to 52px) buttons so nothing feels cramped or stressful.

  2. Rule + AI Check Before PayPal Opens: Before creating an order, our backend (/api/check) runs quick rule checks alongside an AI model (xAI Grok on our Python FastAPI service, with Google Gemini or xAI fallback in Node). It looks for scam pressure signs like secrecy, arrest threats, gift cards, crypto kiosks, or remote access apps, while letting normal payments like a plumber bill or a $50 birthday gift card pass through.

  3. PayPal Authorize-Only Hold (No Money Moves):

    • Low risk: PayPal authorizes and captures the payment right away, so everyday spending stays fast.
    • Medium or high risk: We create the PayPal order with intent: "AUTHORIZE" instead of CAPTURE. PayPal reserves the funds on the buyer's side, meaning zero money goes to the recipient. The elder simply sees a calm screen saying the payment is paused for Sarah (their family contact) to double-check.
  4. Family Review (Approve or Void): On the Family Dashboard, Sarah sees what the elder wrote, the flagged reasons, and a short plain-English summary.

    • If it is legitimate (like a large roofing deposit), she clicks Approve and our server calls PayPal CAPTURE to complete it.
    • If it looks like a scam, she clicks Decline (or lets the hold timer expire: 24 hours by default, 2 minutes in demo mode). Our server immediately calls PayPal VOID, canceling the hold with zero money moved and zero chargeback fees.

How this differs from a simple AI chatbot

  • The AI never touches or moves money: In a typical chatbot demo, the LLM calls payment tools directly. In SecondSight, the AI only reads the payment note and suggests a risk score and calm wording. Deterministic backend code controls every PayPal call (AUTHORIZE, CAPTURE, and VOID).
  • A real PayPal hold state, not just a chat warning: Instead of putting an older adult inside a chat window or showing a text popup that can be ignored, SecondSight pauses the actual PayPal authorization until a second person approves or cancels it.
  • Built to handle bad AI outputs safely: Every model response goes through strict schema checks (Zod in Node, Pydantic in Python) plus a code-level FORBIDDEN_WORDS filter. If the AI times out, hits rate limits, or returns broken JSON, our server marks aiFailed = true and defaults to holding the payment rather than crashing or letting money leave.
  • Protected against live phone coaching: Because scammers often stay on the phone telling victims what to click, the elder's browser never receives the holdToken or family approval routes, making it impossible to self-approve a held payment from the elder screen.

How we built it

Elder Browser (React + Web Speech API) ──┐
                                         ├──> Express API (Node + TypeScript)
Family Browser (React Dashboard) ────────┘         │
                                                   ├──> Rule Engine (limits + keyword patterns)
                                                   ├──> Python Risk Engine (FastAPI + Grok)
                                                   ├──> Node AI Fallback (Gemini / xAI + Zod)
                                                   ├──> MongoDB Atlas (locked amounts + atomic holds)
                                                   └──> PayPal Orders v2 Sandbox (AUTHORIZE / CAPTURE / VOID)

Since this touches payment rails, we tried not to cut corners on the backend or frontend:

  • Elder-friendly frontend: Built with React, Vite, TypeScript, and Tailwind CSS, supporting side-by-side live demo windows (?role=elder and ?role=family) that stay in sync via 3-second status polling, plus built-in browser speech-to-text (Web Speech API).
  • Server-locked amounts: Once /api/check evaluates a payment, the amount and payee are saved in MongoDB. Order creation reads strictly from the database, so nothing from the browser can alter the price after the check.
  • One-at-a-time database locks & idempotency: Every PayPal action (CREATE_ORDER, AUTHORIZE, CAPTURE, VOID) claims an atomic findOneAndUpdate lock (HELD -> PROCESSING) with a 60-second lease timer, checks existing PayPal order state before retrying, and sends a saved PayPal-Request-Id UUID header (idempotency key, so retries never double-charge or double-void).
  • Strict capture checks: Our server only marks a payment as CAPTURED when PayPal explicitly returns COMPLETED with a capture ID, rejecting PENDING or DECLINED responses.
  • Calm wording guard: Our FORBIDDEN_WORDS filter in Python strips words like "scam", "fraud", "blocked", or "danger" from any question shown to the elder.
  • Free-tier friendly expiry: On Render's free plan, containers sleep when idle. Expired holds are checked and voided lazily whenever status or hold endpoints are called, backed by a 30-second interval when awake and a PayPal webhook endpoint (PAYMENT.AUTHORIZATION.VOIDED, PAYMENT.CAPTURE.COMPLETED).

Challenges we ran into

  1. False alarms on normal life: Early keyword rules flagged a $50 "Happy Birthday gift card" or a "water bill due Friday" just for mentioning gift cards or due dates. We added trap cases to our evaluation dataset and tuned both the rules and prompt examples so warm family gifts and normal billing deadlines stay LOW risk, while combinations like secrecy + urgency + gift cards trigger a hold.
  2. Cold starts on free hosting: Running the Node/PayPal backend and Python risk service separately on Render's free tier meant a sleeping Python service could stall checkout. We added a 4-second timeout budget in Node whenever direct LLM keys are present so it falls back to direct Gemini/xAI calls without hanging the checkout flow.
  3. Approve vs. auto-expire race condition: If a family member clicks Approve right when the hold timer runs out, both jobs could try to hit PayPal at the same time. Tagging the lock with processingAction (CAPTURE vs. VOID) stops the expiry worker from voiding a payment that is actively being approved.

Accomplishments that we're proud of

  • End-to-End PayPal Sandbox Flow: Built a working, non-mocked checkout using PayPal Smart Buttons (intent=authorize), server-side order creation, authorization holding, family capture, family void, and automatic expiry.
  • Dignity-First Dual-Screen UX: Designed a calm, readable elder interface (large inputs, voice dictation, and zero alarmist words) paired with a live-updating Family Dashboard so judges can watch a hold and void happen in real time across two windows.
  • Fail-Closed Financial Architecture: Enforced strict server authority, hidden holdToken isolation, Zod/Pydantic validation, PayPal-Request-Id idempotency, an OpenAPI spec (openapi.yaml), and a dual-service Render deployment config (render.yaml).
  • 10 Lifecycle & Concurrency Tests (server/test/lifecycle-test.ts): Test scenarios covering concurrent order locking, expired lease recovery reusing the same PayPal-Request-Id, strict capture status rejection, and approve-vs-expiry conflict safety.
  • 30-Case Scam & Trap Dataset (services/risk-engine/tests/scam_test_dataset.json): 17 realistic scam cases and 13 normal payments (including birthday gift card and utility-bill traps). In our recorded offline deterministic fallback run (services/risk-engine/tests/results.json), the fallback engine caught 17/17 scams (100% recall) with 94.4% precision, 0.9714 F1 (1.0000 F1 treating the $6,500 new-contractor deposit hold as an intended co-sign), and 90.0% exact risk-level match.

What we learned

Stopping elder scams does not require scaring people with louder fraud alerts. Most of the time, it just takes buying the family a short pause before money moves, and PayPal's AUTHORIZE and VOID endpoints fit that job really well.


What's next for SecondSight - AI Payment Pause for Elder Safety

  • Turn on live SMS alerts in production by adding Twilio credentials (the notify.ts Twilio integration is already wired up).
  • Learn trusted recurring payees over time (regular utilities, doctors, family) while keeping extra checks on brand-new recipients.
  • Add PayPal webhook signature verification and real family authentication (passkeys / OAuth) before production rollout.
  • Add more language options to the Web Speech voice input for non-English speaking seniors.

Built With

Share this project:

Updates

Submission history