This project implements a rule-based fraud risk scoring engine for UPI and digital payment transactions.
It evaluates incoming transactions in real time and generates an explainable risk verdict before payment confirmation.
- Builds a transaction context using user behavior and current transaction data
- Applies heuristic rules to detect suspicious patterns
- Generates a cumulative risk score (0–100)
- Classifies risk as Low, Medium, or High
- Returns clear reasons for the risk decision
-
Context Builder
Prepares a unified transaction context from user history and transaction input. -
Rules Engine
Independent heuristic rules for:- New receiver detection
- New device detection
- Unusually high transaction amount
- Odd-hour transactions
-
Risk Engine
Aggregates rule outputs, applies thresholds, and produces a final verdict. -
Flask API
Exposes the risk engine through a REST endpoint for frontend or service integration.
- Python
- Flask
- Rule-based heuristics
- JSON / Supabase (data source)
GET /evaluate_risk_score
Returns:
- Risk score
- Risk level
- Verdict
- Reasons for the decision
The goal of this module is to provide a fast, interpretable, and explainable fraud detection layer that can be extended later with machine learning models.
Rule-based risk engine completed.
Ready for database and frontend integration.