What existed before this hackathon
I'm being upfront about this because the rules ask for it. I built Prahari before 11 October 2026. The first version was made in a 36-hour sprint for the Innovation Challenge 2026 and committed on 2 August 2026. During this hackathon I changed only these things:
- rewrote the README and the slide deck in my own voice
- made a new thumbnail and wrote this description
The detection engine, the app and the demo video are all from before 11 October.
Inspiration
In India there is a scam called "digital arrest." Someone calls pretending to be from the police, the CBI or the RBI. They tell the victim their Aadhaar card is linked to money laundering and that they are now under "digital arrest," which does not exist anywhere in Indian law. They keep the victim on a video call for hours, forbid them from telling their family, and finally make them transfer their savings to a "verification account."
The Indian Cyber Crime Coordination Centre (I4C) counted 1,23,672 cases and ₹1,918 crore lost in 2024 alone. Most victims are elderly.
What struck me was that apps like Truecaller and bank SMS alerts already warn people, and people still lose money. A small "this may be a scam" notification can't win against a man in a police uniform who has spent ninety minutes telling you your family will be arrested tonight. Cases fell sharply in 2025, and that was because of a national awareness campaign, not better detection: someone interrupted victims and told them what was happening. I wanted to build that interruption into the phone itself, at the moment it matters.
What it does
- Live Call Shield. It scores the call transcript as the conversation happens and shows the exact words that raised the score.
- Stage-based detection. Each sentence is matched to one of five attack stages: pretending to be an authority, creating fear, isolating the victim, taking control (screen sharing, AnyDesk), and taking money.
- Pause Protocol. When the scam pattern is confirmed, Prahari takes over the screen for 30 seconds and the dismiss button is disabled. It gives one tap to call a family member and one tap to call the 1930 cybercrime helpline.
- Guardian alert. In Elderly Mode, a family member is alerted automatically, because the victim is often too scared to act.
- Message, link and email scanners for courier, KYC and phishing scams, in English and Hindi.
- Forensic incident record. A timestamped report, hashed with SHA-256, that can be filed at cybercrime.gov.in.
How I built it
The app is React + Vite + Tailwind. The core is a scoring engine I wrote myself (src/lib/scamEngine.js).
Any single scam sentence could be said by an honest person. A real officer really can say "this is Inspector Sharma from Cyber Crime." What no real officer does is say that and forbid you from hanging up and ask you to move money. So the score depends on how many different stages show up together:
$$ \text{score} = \min\Big(100,\; \sum_i w_i \times m(k) \;+\; \text{combo bonus} \;-\; \text{trust signals}\Big) $$
Here \( w_i \) is the weight of each matched behaviour and \( k \) is the number of distinct stages seen. The multiplier \( m(k) \) goes from 1.0 for one stage up to 1.9 for all five. "Trust signals" lower the score. For example, a real bank tells you to call back on the official number and says it will never ask for your OTP.
Where AI comes in:
- Gemini Live API plays the scammer in an Adversarial Simulation. You argue with it out loud and it escalates through the scam playbook in real time, so the detector is tested on speech nobody scripted. In one five-turn session it went from "Inspector Rakesh Verma" to "transfer the amount to an RBI verification account" and the detector scored it 100/100 with all five stages.
- Gemini 3.1 Flash Lite explains each verdict in plain English or Hindi, powers the "Is this genuine?" investigator, and writes the complaint summary. The detection itself does not depend on Gemini. If the network drops, Prahari still detects the scam and interrupts the call. Only the explanation falls back to pre-written text.
Use of AI coding tools (disclosure): I used Claude (Anthropic) to critique my idea and scope, to debug and review code, and to help draft the README and this description. I wrote the detection engine, the scam patterns and the test cases, and I tested them myself.
Measuring it honestly
I built a labelled test set of 136 cases: 75 scams across 12 types and 61 genuine messages. The genuine ones include 24 deliberately tricky cases, such as real KYC reminders and fraud-awareness posts that quote the scam script word for word.
| Metric | Result |
|---|---|
| Precision | 100% |
| Recall | 80% |
| False alarms | 0 of 61 |
This number is not independent. I wrote both the detector and the test cases, so it is a development tool, not a real benchmark. My next step is to test it on scam scripts I didn't write, taken from official cybercrime advisories and written by classmates, and to try it with older family members.
Challenges
- My first test run found only 24% of scams. I had built the engine for digital arrest only, so it had no patterns at all for task scams, loan harassment or UPI collect requests. One very dangerous sentence ("install AnyDesk and share your screen") scored only 20 because a single stage couldn't pass the multiplier. I fixed this with a minimum score for these sentences and new scam families.
- Talking about fraud is not fraud. An early version raised an alarm when someone described a scam they had read about in the news. I added a check for reported speech, because a detector that panics at the news gets muted.
- The email scanner flagged a security-awareness email as fake. It read the body to decide who the sender claimed to be. A sender's identity belongs in the header, so I changed it to read the header instead.
- What I still miss: most of the remaining 20% are scams that never use the trigger words, for example "your identity documents were used in a serious financial crime." Matching words can't catch those without causing false alarms. That is the case for adding a meaning-based AI layer.
Privacy
I want to be exact here, because call audio is very sensitive:
- The scoring runs entirely in the browser. No audio is needed for it, only text.
- The live Adversarial Simulation sends microphone audio to Google's Gemini Live API. The transcript it scores also comes from Google. That simulation is a testing and demo tool, not the product.
- Pasted messages, investigator questions and the incident summary are sent to Gemini as text to generate explanations.
- On a real phone, transcription would have to run on the device (for example, Whisper or Vosk for Hindi) for the "nothing leaves your phone" promise to be true. That is on my roadmap and not built yet.
What I learned
- Detection is the easy half. The hard part is getting a frightened person to act, which is why the Pause Protocol takes over the screen instead of showing a pop-up.
- The scams I missed taught me more than my headline score. Listing every miss is what showed me where word-matching stops working.
- Being honest about limits is part of the engineering. That includes saying the test set is mine and saying exactly where audio goes.
What's next
- Test on scam scripts I didn't write, and with elderly users.
- Add on-device speech recognition so call audio never leaves the phone.
- Add a meaning-based layer for scams that avoid the obvious words.
- Build an Android version that listens on speakerphone and scans WhatsApp and SMS notifications.
Built With
- gemini-api
- gemini-live-api
- google-ai-studio
- javascript
- netlify
- node.js
- react
- tailwindcss
- vite
- web-audio-api
- web-crypto-api
- websockets