Sonny — The grandson who never leaves you alone against a scam

"Before you tap a strange message, ask Sonny."

Sonny is an on-device, privacy-first AI scam detector designed specifically for older adults and anyone with low digital literacy. It detects smishing, fraudulent WhatsApp messages, phishing emails, and fake physical letters with zero technical jargon, delivering an instant traffic-light verdict with the warmth and patience of a loving grandson.


Inspiration

Every day, millions of older adults receive predatory text messages, WhatsApp alerts, and fake letters: "Mom, my phone broke, please text this new number", fake bank suspension warnings, and fraudulent package delivery fees.

Seniors are disproportionately targeted because fraudsters weaponize urgency, confusion, and fear. When seniors feel uncertain, they often hesitate to ask their busy children or grandchildren out of embarrassment or shame. Existing cybersecurity tools are either too technical, silent, or alarmist. Meanwhile, cloud-only AI assistants require accounts and transmit private, sensitive messages to third-party servers.

We built Sonny to give every older adult what they truly need: a patient, caring grandson always in their pocket. In English, "sonny" is a term of endearment an elder uses for a young boy. Sonny speaks in first person with warmth and patience, never makes anyone feel foolish for asking, and protects seniors without ever compromising their privacy.


What it does

Sonny is a privacy-first, on-device scam detector built specifically for older adults and anyone with low digital literacy:

  • Frictionless Input: Seniors simply take a photo of their screen or a physical paper letter, paste text, or use voice dictation.
  • Traffic-Light Verdict in One Large Sentence: 🛑 Scam / ⚠️ Suspicious / ✅ Looks normal. No complex graphs or confusing probability percentages.
  • Explains "Why": Highlights malicious phrases directly inside the message and flags deceitful domains (such as typosquatting banc-verify.xyz or risky URL shorteners).
  • Actionable Next Steps: Direct, concrete guidance (e.g., "Do not touch the link. Call your bank using the physical number on the back of your debit card" or a one-tap button to call a trusted family member).
  • 100% Offline Capable: Sonny runs its own machine learning models right inside the phone. Obvious scams are detected in ~0.1 milliseconds and never leave the device.
  • Empathetic Persona: Sonny reassures the user with phrases like "You did very well to ask me. That's what I'm here for."

How we built it

Rather than taking the easy route of building another commercial API wrapper, we engineered a complete on-device machine learning architecture:

  1. Two Custom Classifiers (English & Spanish): We trained character n-gram (char_wb) + logistic regression models on curated, balanced datasets (5,981 messages in EN, 2,384 in ES), plus a custom language detector (99.8% accuracy).
  2. On-Device TypeScript Scoring Engine: We exported trained models into a compact .sonny JSON format (0.8 MB) and engineered a zero-dependency TypeScript inference scorer that achieves bit-for-bit mathematical parity (< 0.001 delta) with Python Scikit-Learn.
  3. Mathematical Formulation: The on-device probability \( P(\text{scam} \mid x) \) is computed client-side using character n-gram TF-IDF representations: $$P(\text{scam} \mid x) = \sigma\left(w_0 + \sum_{i} w_i \cdot \text{TF-IDF}(n_i, x)\right)$$ where \( \sigma(z) = \frac{1}{1 + e^{-z}} \).
  4. Two-Tier Privacy Cascade:
    • Tier 1 (On-Device): The local model and link heuristics evaluate the message instantly. Clear scams are neutralized locally without network requests.
    • Tier 2 (AI Second Opinion): Only ambiguous messages consult Google Gemini 3.8 Flash via a secure server endpoint. A deterministic decision table guarantees the cloud AI can never downgrade a high-risk threat into "safe".
  5. On-Device OCR: Native Android builds bundle Google ML Kit (expo-text-extractor) directly into the APK (working offline from first launch); the web app utilizes tesseract.js.
  6. Cross-Platform UI: Built with Expo (React Native) supporting both Web deployment and Android APK builds, featuring senior-friendly high contrast, scalable typography, and toggleable voice readout.

Challenges we ran into

  • Adversarial Zero-Width Unicode Attacks: During our 10-point robustness evaluation, we uncovered a critical evasion attack: inserting invisible Unicode zero-width spaces (U+200B, U+200C) dropped our Spanish model recall from 92% to 57%. The model had erroneously associated invisible characters with legitimate marketing emails. We re-engineered our preprocessing pipeline to sanitize zero-width artifacts, rendering the attack completely ineffective (0% degradation).
  • Scarcity of Public Spanish Smishing Data: Unlike English, public Spanish SMS scam datasets are scarce and noisy. We had to manually audit and correct mislabeled samples in public datasets to avoid false positives on legitimate two-factor authentication (2FA) SMS.
  • Senior-First UX Constraints: Designing for seniors meant actively stripping away technical features. We had to resist the urge to show technical dashboards or risk gauges, replacing them with a single, calm, authoritative sentence.

Accomplishments that we're proud of

  • 35 Automated Quality Tests: 18 TypeScript parity tests, 17 Python quality gate tests, and 9 end-to-end app logic tests.
  • Sub-Millisecond Edge Performance: Verified inference speed of ~0.1 ms running entirely client-side.
  • High Classification Performance: Achieved an \( F_1 \) score of 0.946 (EN) and 0.930 (ES) with ROC-AUC of 0.997 (EN) and 0.978 (ES) on held-out test sets.
  • 17 Formal Model Evaluations: Conducted ROC-AUC, Brier calibration scores, cross-lingual verification, and learning curves documented transparently inside the app (model.tsx).
  • Genuine Privacy Preservation: Seniors can verify sensitive messages in complete Airplane Mode without leaking personal data to cloud servers.

What we learned

  • In accessibility, less is more: For vulnerable seniors, alarmist sirens and complex metrics induce panic. Empathy, large typography, and definitive instructions are what prevent victimization.
  • Edge AI is a moral necessity: When protecting people against sensitive fraud, forcing users to stream private communications to remote servers is a privacy failure. On-device ML proves that high security and complete privacy can coexist.

What's next for Sonny

  • WhatsApp & Telegram Forwarding Bot: Allowing seniors to simply forward suspicious messages directly within their daily messaging apps.
  • Community-Powered Threat Feeds: A privacy-preserving mechanism to aggregate newly emerging regional scam campaigns.
  • Partnerships with Senior Community Centers: Collaborating with eldercare and digital literacy organizations to distribute Sonny directly to the seniors who need it most.

Built With

Share this project:

Updates

Submission history