Don't just detect scams — learn to kill them.

Inspiration

Every detector gives you the same dead end: "this is a scam." Then it leaves you alone — and the next real scammer doesn't warn you first.

Last year, scam victims worldwide lost over one trillion dollars. Every one of them got a warning sign first — a message they didn't know how to fight. Research on fraud victimization is blunt: people who know the tricks still pay out, because knowledge doesn't survive pressure. Rehearsal does. You don't learn to fight by reading a manual — you learn by sparring.

So we built SPAR: paste the scam message you actually received, and instead of a verdict, you get an opponent.

What it does

SPAR runs a four-stage pipeline on any pasted SMS, email, or call transcript:

  • 🧪 Autopsy — a deterministic forensics engine matches the message against 14 hand-built manipulation signatures (false urgency, authority impersonation, OTP fishing, secrecy demands, remote-access…), profiles four emotional pressure levers (urgency / fear / greed / obedience), classifies the scam family, and quotes your actual text as evidence. Every link runs through an offline Link Autopsy (unencrypted http, raw-IP hosts, punycode lookalikes, shorteners, high-abuse TLDs, brand impersonation — each flag with a risk score and a stated reason). A deterministic Attack Chain maps the escalation from borrowed authority to money/credential loss — click any node to see how to break the chain there. A PAUSE · VERIFY · REPORT protocol with a counterfactual reality check (what would have to be true for this to be legitimate?) turns the verdict into a safe next step, and one click generates a structured incident report with victim-side data auto-redacted — ready to file with your carrier, platform, or national anti-scam hotline. A benign paste (try the Genuine courier SMS sample) triggers a skeptic check explaining why it was not flagged — false positives matter too.
  • 🔥 Digital Twin — the scammer's psychology is rebuilt as a training opponent: persona, goal, and a 5-rung escalation ladder (patient → pushy → authoritarian → threatening → retreat), forged by the LLM from your message.
  • 🥊 The Duel — you spar against the twin live. A pressure gauge reacts to every word you send; hesitate and the twin climbs its ladder, deploying new tactics that surface as chips the moment they appear. Turn on the scammer voice and the pressure becomes physical. Leak detection ends the drill the instant you'd have handed over a real OTP, password, or card number.
  • 📋 Debrief — an LLM coach grades your defense S/A/B/C/D, quotes your exact sentences back at you, and distills golden rules from this duel. One scary message in, permanent muscle memory out.

🎲 Daily Drill — no scam message needed: one click drops you into a random scenario from a hidden 9-family bank, twin auto-forged, straight to the duel. Train like it's a push-up routine.

How we built it

  • Next.js 16 (App Router) + React 19 + TypeScript across UI and server routes, Tailwind CSS 4 for the forensic-lab design system (dark lab, CRT scanlines, gauges, stamps).
  • A deterministic ground-truth layer: 14 hand-written manipulation signatures with evidence extraction, structural link inspection, attack-chain generation, and the defensive-protocol generator — all zero-dependency. The app is fully playable with no API key at all.
  • Four specialized LLM routes (forensic narrative, twin forging, live scammer method-acting, duel debrief) over Featherless AI (OpenAI-compatible), with a live-verified fallback chain: DeepSeek-V3-0324 → Llama-3.3-70B → Mistral-Small-24B → Qwen3-32B — reasoning-model output is normalized (think-blocks stripped) before parsing.
  • PII redaction before hosted inference: card numbers (Luhn-validated), OTP codes, emails, phones and NRIC/SSN patterns are scrubbed server-side before any text reaches the LLM, across all four routes. Evidence quotes are extracted locally from the original; a privacy chip in the report states exactly how many items were redacted.
  • Safety scrubbing on every twin output: URLs and phone numbers are replaced with placeholders; all LLM JSON is parsed defensively and clamped.

Challenges we ran into

  • Making an LLM act like a scammer without becoming one. The twin must stay in character and escalate, yet never emit a working link, real number, or actionable harm. We solved it with constrained persona prompts + a hard output scrub layer + defensive JSON parsing — and the twin still improvises convincingly (judges can try it live).
  • Reasoning models break JSON. Some fallback models wrap answers in <think> blocks or return a stray reasoning field. The client normalizes both before parsing, so the model chain can degrade gracefully instead of exploding.
  • False positives destroy trust. A "Genuine courier SMS" scoring as a scam would be embarrassing — so we added a skeptic mode that deliberately argues the legitimate case and shows why a benign message wasn't flagged.
  • Privacy vs. evidence. The incident report must keep the scammer's links and numbers as evidence while masking the victim's data — two different redaction policies in one report, resolved by design.

Accomplishments that we're proud of

  • The entire experience works with zero API keys — offline forensics mode, handcrafted twins, rule-based scoring — then upgrades itself when a key is present.
  • The full LLM pipeline is live on production right now (all four routes on engine=llm), not a demo video.
  • Leak detection auto-ends the drill and auto-grades: deliberately leak an OTP in testing and you get the D you deserve.
  • Every claim in the autopsy is evidence-first — quoted from your own message, never hallucinated.

What we learned

  • Deterministic ground truth + LLM narration is the right split. The rules engine can't hallucinate; the LLM can't be trusted alone. SPAR uses each for what it's good at.
  • Graceful degradation is a feature, not a fallback plan. "No key? Still fully playable" made the demo bulletproof.
  • Privacy has to be architectural. Redaction before inference (not after) means a leak in the LLM layer can't leak PII. Over-redaction is the safe failure mode.

What's next for SPAR — Sparring Partner Against Real Scammers

  • URL-reputation integration and QR-code decoding for the Link Autopsy (disclosed in-app via the uncertainty statement — SPAR is decision support, not proof).
  • Multilingual twins: the deterministic engine is language-agnostic; the narrative layer is English-only today.
  • Persistent cross-session stats and spaced-repetition drills, plus a mobile-first pass.

▶ Try it live: https://spar-anti-scam.vercel.app — LLM mode is already enabled for judges, no setup needed. Or run offline: clone the repo, npm install && npm run dev, no key required.

Built With

Share this project:

Updates

Submission history