Skip to content

About

UPI Intent Guard is an offline-first, privacy-preserving security system that correlates live conversational cues with incoming UPI payment intents. By performing on-device multi-vector context fusion, it detects psychological manipulation (bank impersonation, fake KYC, refund traps) and triggers actionable Pre-PIN interventions to stop fraudulent

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

ย 

History

10 Commits

Folders and files

Repository files navigation

๐Ÿ›ก๏ธ UPI Intent Guard

An on-device AI firewall that stops UPI fraud before the payment happens.

Most fraud detection watches the transaction. This watches the conversation that leads to it.

Track Status License

React TypeScript Vite FastAPI Python TailwindCSS

Demo Flow ยท How It Works ยท Architecture ยท Setup ยท Privacy


๐ŸŽฏ The Problem

Most UPI fraud isn't a hack โ€” it's a conversation. A caller impersonates a bank official, manufactures urgency, and walks the victim through authorizing their own transaction. From the bank's side, the payment looks completely legitimate: the real account holder approved it.

Common patterns:

Pattern Example
๐Ÿฆ Bank impersonation "I'm calling from your bank's verification team."
โฐ Urgency + threats "Your account will be blocked today."
๐Ÿ”‘ OTP / PIN requests "Share the OTP to confirm your identity."
๐Ÿ“„ Fake KYC claims "Your KYC has expired, update it now."
๐Ÿ’ธ Refund manipulation "We're refunding โ‚น5,000, just confirm the UPI PIN."
๐Ÿ“ˆ Investment scams "Guaranteed 30% returns, act before market close."
๐Ÿ–ฅ๏ธ Remote-access requests "Install this app so I can help you."

UPI Intent Guard reads the intent behind the payment โ€” not just the payment itself.


๐Ÿš€ How It Works

Three signal sources are fused into a single explainable risk score:

Conversation Context  โ†’  Scam Signal Detection  โ†’  Conversation Risk
Payment Details       โ†’  Intent Analysis         โ†’  Payment Intent Risk
Recipient Info         โ†’  Recipient Intelligence  โ†’  Recipient Risk
                                    โ”‚
                                    โ–ผ
                          Context Fusion Engine
                                    โ”‚
                                    โ–ผ
                          Final Risk Score (0โ€“100)
                                    โ”‚
                                    โ–ผ
                       Explainable User Intervention

Risk Tiers

Score Level Response
0โ€“30 LOW No action needed
31โ€“60 MEDIUM Caution flagged
61โ€“80 HIGH Strong warning shown
81โ€“100 CRITICAL Payment intervention triggered

Example: Signal โ†’ Detection

"I'm calling from your bank."             โ†’  Bank impersonation
"Your account will be blocked today."     โ†’  Urgency + Account threat
"Transfer โ‚น5,000 to verify your account." โ†’  Verification request + Payment request

Output:

๐Ÿšจ CRITICAL RISK โ€” 90/100

โœ“ Bank impersonation
โœ“ Urgency
โœ“ Account threat
โœ“ Verification request
โœ“ Payment request

๐Ÿ’ณ Payment Intervention

When a risky conversation is followed by a risky payment attempt, Context Fusion kicks in:

Conversation Risk       82
Payment Intent Risk     90
Recipient Risk          70
โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
Final Risk               94  โ†’  ๐Ÿšจ CRITICAL

The user is shown a clear intervention screen โ€” "This payment may be part of a scam" โ€” with two explicit choices: STOP PAYMENT or CONTINUE ANYWAY. No real UPI transaction is ever performed by the prototype.


๐ŸŒ Multilingual by Design

Scam-pattern detection works across English, Hindi, Telugu, and Hinglish โ€” because scam warnings only help if people can actually understand them in the language they think in.


๐ŸŽ™๏ธ Controlled Live Demo

Two demo modes are built in for reliable, repeatable presentation:

  • Simulated Conversation โ€” six scripted scenarios (bank impersonation, OTP scam, KYC scam, refund scam, investment scam, and a safe control conversation) play out progressively for consistent hackathon demos.
  • Microphone Demo โ€” an optional, controlled browser speech-recognition mode. This is not cellular call interception, and raw voice recordings are never stored.

๐Ÿ” Privacy First

The prototype does not:
Perform real UPI transactions
Collect banking credentials
Store raw voice recordings
Require real OTPs
Access real bank accounts

Core detection is designed to run locally, without requiring conversation audio to leave the device. Full details in SECURITY.md.


Architecture

                          UPI INTENT GUARD
                                 โ”‚
                 โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
                 โ”‚                                โ”‚
           Conversation                        Payment
                 โ”‚                                โ”‚
                 โ–ผ                                โ–ผ
          Signal Detection                Intent Analysis
                 โ”‚                                โ”‚
                 โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜
                                 โ–ผ
                          Context Fusion
                                 โ”‚
                                 โ–ผ
                            Risk Engine
                                 โ”‚
                                 โ–ผ
                       Explainable Warning
                                 โ”‚
                                 โ–ผ
                            Intervention

Tech Stack

Frontend

  • React
  • TypeScript
  • Vite
  • Tailwind CSS
  • Framer Motion
  • Lucide React

Backend

  • Python
  • FastAPI
  • Pydantic

AI / Detection

  • Scam-signal detection
  • Intent classification
  • Risk scoring
  • Explainable output
  • Speech-to-text abstraction

Infra

  • REST API
  • WebSocket (progressive analysis)
  • Local browser storage

Project Structure

UPI-intent-Guard/
โ”‚
โ”œโ”€โ”€ src/
โ”‚   โ”œโ”€โ”€ components/
โ”‚   โ”œโ”€โ”€ pages/
โ”‚   โ”œโ”€โ”€ services/
โ”‚   โ”œโ”€โ”€ models/
โ”‚   โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ hooks/
โ”‚   โ””โ”€โ”€ utils/
โ”‚
โ”œโ”€โ”€ backend/
โ”‚   โ””โ”€โ”€ app/
โ”‚       โ”œโ”€โ”€ api/
โ”‚       โ”œโ”€โ”€ models/
โ”‚       โ”œโ”€โ”€ services/
โ”‚       โ”œโ”€โ”€ ai/
โ”‚       โ”œโ”€โ”€ risk/
โ”‚       โ””โ”€โ”€ tests/
โ”‚
โ”œโ”€โ”€ docs/
โ”œโ”€โ”€ SECURITY.md
โ””โ”€โ”€ README.md

๐Ÿš€ Running the Project

Frontend

npm install
npm run dev
npm test        # run tests
npm run build   # production build

Backend (optional)

cd backend
python -m pip install -r requirements.txt
python -m uvicorn app.main:app --host 0.0.0.0 --port 8000 --reload
python -m pytest app/tests/ -v   # run backend tests

๐Ÿงช Demo Flow

START DEMO
     โ”‚
     โ–ผ
Simulated Bank Call
     โ”‚
     โ–ผ
"Your KYC has expired."          โ†’  Risk โ†‘
     โ”‚
     โ–ผ
"Your account will be blocked."  โ†’  Risk โ†‘
     โ”‚
     โ–ผ
"Transfer โ‚น5,000 to verify."     โ†’  ๐Ÿšจ CRITICAL RISK
     โ”‚
     โ–ผ
Payment Simulator โ†’ Context Fusion โ†’ 94/100
     โ”‚
     โ–ผ
STOP PAYMENT
     โ”‚
     โ–ผ
๐Ÿ›ก๏ธ โ‚น5,000 PROTECTED

All demonstrations run on synthetic data. No real money ever moves.


๐Ÿ”ฎ Roadmap

  • Android implementation with deeper device-level integration
  • Optimized on-device multilingual speech models
  • Improved scam-intent classification
  • Stronger recipient intelligence
  • Accessibility features for elderly users
  • Integration with legitimate payment apps (where platform policy permits)

โš ๏ธ Disclaimer

UPI Intent Guard is a hackathon prototype for demonstrating proactive, conversation-aware scam detection. Risk scores are experimental and should not be treated as a guarantee against fraud. The current web MVP does not intercept cellular calls or perform real financial transactions.

Built to protect the moment before the payment โ€” not just the payment itself.

About

UPI Intent Guard is an offline-first, privacy-preserving security system that correlates live conversational cues with incoming UPI payment intents. By performing on-device multi-vector context fusion, it detects psychological manipulation (bank impersonation, fake KYC, refund traps) and triggers actionable Pre-PIN interventions to stop fraudulent

Topics

Resources

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages