Inspiration
In India, payment scams often arrive as ordinary messages — fake bank alerts, courier fees, electricity disconnection notices, or fraudulent job offers. I noticed family members frequently forwarding such messages and asking, “Is this real?” without getting evidence-based answers.
I wanted to build something better than a black-box risk score: a clear verdict, the evidence behind it, and transparency about what data leaves the device.
What it does
TrustLens AI analyzes suspicious messages and returns four outcomes: High Risk, Suspicious, Low Indicators (not a guarantee of safety), or Can't Tell.
It provides:
- Exact evidence and explanations behind each verdict.
- Privacy status, detected PII, and inference source.
- A routing trace showing which rules and AI models were used.
- Actionable next steps.
It offers three privacy modes: Local-only, Balanced, and Cloud-assisted. Cloud analysis always requires explicit consent and displays the redacted text before transmission. TrustLens AI is available as a web app and Chrome extension.
How we built it
Built using React, TypeScript, and Vite, TrustLens AI follows a five-stage pipeline:
- Language detection and PII detection/redaction.
- A deterministic, versioned rules engine with negation awareness.
- On-device analysis using Gemini Nano through Firebase AI Logic.
- An explicit consent gate before cloud processing.
- Cloud Gemini inference with schema validation and output checks.
Firebase provides AI Logic, App Check, Remote Config, and Hosting.
Two key design decisions shaped the project:
- Explicit inference modes prevent silent cloud fallback, protecting the Local-only promise.
- Critical rule combinations always override model predictions, protecting against prompt injection and unsafe model responses.
Challenges we ran into
The biggest challenge was making privacy an actual technical guarantee rather than a promise. Every blocked cloud request needed to produce a transparent result instead of silently falling back.
Configuring App Check across web and Chrome extension environments also required separate approaches because Chrome Manifest V3 restricts remote scripts.
Another challenge was balancing precision and recall. On our independent 30-message held-out set, the rules engine achieved 100% precision and 60% recall, with zero false positives. It missed six scams, demonstrating why it should be the first layer of a larger AI pipeline, not a standalone classifier.
We also addressed prompt injection, hallucinated evidence, and unsafe Remote Config patterns.
Accomplishments we're proud of
- A working privacy-first scam detection pipeline with three privacy modes.
- Consent screens showing the exact redacted payload before cloud transmission.
- Explainable verdicts with evidence and inference traces.
- Firebase integration across AI Logic, App Check, Remote Config, and Hosting.
- 176 passing assertions, alongside successful web and extension builds.
- Honest evaluation results, including missed scams and model limitations.
Most importantly, there is no numeric risk score. Users get evidence rather than artificial confidence.
What we learned
We learned that building a trustworthy AI product involves much more than calling a model. Privacy-aware routing, redaction, consent, output validation, prompt-injection protection, and honest evaluation are equally important.
We also learned that “Can't Tell” is better than a confident but unreliable answer. A system should clearly communicate its limitations instead of pretending to know everything.
What's next for TrustLens AI
- Better support for Indian languages and Hinglish.
- Larger, independently collected evaluation datasets.
- Smarter escalation between on-device and cloud inference.
- Store-ready Chrome extension packaging.
- Optional on-device personalization without server-side profiling.
Our goal remains simple: Every verdict should come with an answer to one question — “Why should I trust this?”
Built With
- css
- html5
- javascript
- manifestv3
- nano
- node.js
- npm
- react
- recaptcha
- typescript
- vite