Lakshman Rekha is an Android application that protects users — especially seniors and vulnerable individuals — from phone scams, OTP fraud, UPI manipulation, phishing messages, and social-engineering attacks.
Unlike traditional spam detectors, Lakshman Rekha works at the moment of decision.
It detects intent, pressure, and risky user actions in real time and intervenes before damage happens.
Inspired by real scam patterns seen daily in India, Lakshman Rekha is designed around prevention, interruption, and education, not post-fraud reporting.
Modern scams do not rely on ignorance.
They rely on timing, fear, urgency, and manipulation.
Common attack patterns include:
- Fake customer-care & police calls
- OTP and UPI payment pressure during calls
- “Account blocked” or “legal case” threats
- Links sent during live conversations
- Remote app installation coercion
Why existing tools fail:
- Truecaller only labels numbers
- Keyword filters miss context
- Malware scanners ignore social engineering
Scams are not single events. They are sequences.
Lakshman Rekha is built to detect and stop those sequences.
“The most dangerous moment is not when a message arrives —
it’s when the user is being pushed to act.”
Lakshman Rekha does not ask:
“Is this message a scam?”
It asks:
“Is someone pushing the user to take a dangerous action right now?”
That shift defines the entire system.
Lakshman Rekha uses a hybrid detection engine:
- ✅ Rule-based real-time signals (behavior & context)
- ✅ On-device ML inference (intent & semantic understanding)
- ❌ No single keyword triggers action
- ❌ ML never directly blocks the user
All outputs flow through a deterministic risk-scoring layer.
- Notification Monitoring
Reads notifications from SMS, WhatsApp, and banking apps. - On-Screen Text Analysis (Accessibility)
Detects scam prompts inside apps, not just notifications. - Context Awareness
- Call ongoing
- Unknown caller
- UPI opened during call
- OTP visible
- Rapid app switching
Each signal contributes weighted risk — no binary decisions.
- Score range: 0–100
- Signals combined deterministically:
- Call context
- User behavior
- ML confidence
- Threat mapping:
| Score | Threat Level |
|---|---|
| 0–20 | SAFE |
| 21–45 | CAUTION |
| 46–70 | RISKY |
| 71–100 | DANGEROUS |
This minimizes false positives and avoids unnecessary panic.
| Mode | Designed For | Behavior |
|---|---|---|
| 🤝 Saathi Mode | Tech-aware users | Silent monitoring, logs only |
| 🟡 Lakshman Mode | Average users | Visual warnings + explanations |
| 🛑 Raksha Mode | Seniors & vulnerable users | Full intervention + SOS |
Modes control response behavior, not detection logic.
- Overlay Warnings (SYSTEM_ALERT_WINDOW)
High-visibility banners over any app. - Emergency Overlays
Triggered for dangerous scenarios in Raksha Mode. - Senior-Friendly Dismissal
Tap anywhere to dismiss.
- Trusted Contacts System
- Family members added during onboarding
- One-Tap Actions
- Call trusted contact
- Block source
- Report scam
- SOS Trigger
- Volume-button sequence
- Emergency SMS auto-sent to trusted contacts
- Post-Call Safety Summary
- Clear explanation of what happened
- English + Hindi guidance
- Framework: TensorFlow Lite
- Runs fully offline
- Latency: ~15 ms on-device for short text windows
- Input: Normalized text tokens (64 tokens)
- No cloud, no audio, no storage
- Scam probability
- Severity (1–5)
- Scam stage (Lure / Action / Threat)
- Requested intent
- Scam family classification
- Binary flags:
- OTP
- UPI
- URL
- QR payment flow
- Callback number
- Threat language
- Urgency
ML provides signals only.
Final decisions are rule-based and deterministic.
Lakshman Rekha now uses a rebuilt multi-task on-device ML pipeline with a shared normalization/tokenization contract between Python training and Android inference.
- Training corpus: expanded from
296seed samples to30,296labeled rows - Model architecture: multi-scale convolutional text encoder with shared trunk + 12 heads
- Primary heads:
is_scam,severity,stage,action,scam_type - Binary heads:
has_otp,has_upi,has_url,has_qr,has_phone,has_threat,has_urgency - Artifact contract:
tokenizer.json+model_metadata.json+scam_signal.tflite - Evaluation: separate train / validation / holdout split with exported reports
- Scam detection macro F1:
1.00 - Severity macro F1:
0.9935 - Stage macro F1:
0.9934 - Action macro F1:
0.9743 - Scam type macro F1:
0.9346 - Flag accuracy range:
96.2%to99.9%
The ML stack under ml-training/model
now includes:
expand_dataset.pyfor deterministic large-scale dataset augmentationcommon.pyfor shared normalization, vocabulary, metadata, and split utilitiestrain.pyfor model training and metric exportevaluate.pyfor holdout evaluation reportsexport_tflite.pyfor Android-safe artifact export
Generated outputs are written to
ml-training/output,
and the runtime assets used by the app are synced into
app/src/main/assets.
- Large readable text
- High-contrast overlays
- Color + emoji risk cues
- Minimal interaction required
- Works even if notifications are ignored
Current:
- English
- Hindi
Planned:
- Regional Indian languages
- Device-locale based auto-selection
- Language: Kotlin
- UI: Jetpack Compose
- Architecture: Service-based, decoupled layers
- Minimum SDK: Android 7 (API 24)
- AccessibilityService
- NotificationListenerService
- Overlay windows
- Foreground & background services
- SMS Manager
- Text-to-Speech
- Volume-key event hooks
- TensorFlow Lite
- Fully on-device inference
Signals → ML + Rules → Risk Score → Mode Logic → Action
Decoupled layers:
- Ingestion
- Inference
- Decision
- Action
| Feature | Status |
|---|---|
| Hybrid risk scoring | ✅ |
| On-device ML | ✅ |
| Overlay warnings | ✅ |
| Trusted contacts & SOS | ✅ |
| Multi-mode protection | ✅ |
| Call audio analysis | ❌ Planned |
| Smartwatch alerts | ❌ Planned |
- No call recording
- No message storage
- No cloud uploads
- Memory purged after sessions
- DPDP-compliant by design
- Regional language ML models
- One-tap 1930 cybercrime reporting
- Smartwatch haptic alerts
- Federated learning without raw data sharing
Lakshman Rekha is not just an app.
It is a real-time digital boundary —
drawn exactly at the moment when a user is most vulnerable.
Just like the original Lakshman Rekha,
it warns you before you cross the line.
🛡️🇮🇳