Inspiration
Fraud detection in many digital finance systems today is either opaque (“transaction blocked, no explanation”) or reactive (fraud is discovered after damage is done). As a builder working closely with fintech systems, I kept seeing the same pain points: • Users don’t understand why a transaction is flagged • Compliance teams struggle to justify decisions during audits • Engineers hard-code rules that don’t adapt well to context
I wanted to build a system that doesn’t just detect fraud, but explains it clearly and lets humans respond quickly.
That idea became Fraud Sentinel.
What it does
Fraud Sentinel is a real-time transaction monitoring system that: • Evaluates transactions using deterministic risk rules • Assigns a risk score and risk level (LOW / MEDIUM / HIGH) • Uses AI (Gemini) to generate human-readable explanations • Persists immutable audit logs for compliance • Notifies users of suspicious activity and allows them to act
How we built it
The system is split into three major layers:
- Backend — FastAPI + Async SQLAlchemy • FastAPI for async request handling • SQLite (aiosqlite) for fast, append-only audit logs • JWT authentication with role separation (admin vs user) • Clean domain separation: • Risk engine • AI explainability • Alerts • User actions (approve / flag fraud)
RiskScore = Σ (w_i × f_i), for i = 1 … n Where: • f_i = risk factors (amount, velocity, merchant category, behavior) • w_i = configurable weights • Final score is capped at 100 and mapped to a risk tier
- AI Explainability — Google Gemini Instead of letting AI decide fraud (which is risky and non-deterministic), I used it for what it does best:
Explanation • Gemini receives: Transaction details, Risk scoreRule-based reasons • It returns a concise explanation written like a human analyst • No mention of AI, models, or automation
This keeps the system: • Auditable • Predictable • Trustworthy
- Frontend — Flutter (User Experience) The Flutter app focuses on clarity and action: • Secure login & registration • Live fraud alerts (MEDIUM / HIGH only) • Detailed alert screen with AI explanation • Action screen where users can: • Confirm the transaction • Flag it as fraud
The app automatically: • Redirects unauthenticated users to login • Handles token expiry cleanly • Refreshes alerts periodically for live monitoring
Challenges we ran into
This project was not smooth sailing — and that’s part of the learning.
Cloud Deployment Pitfalls • Cloud Run containers failed due to missing environment variables • Gemini client initialization at import time caused startup crashes • Fixed by lazy-loading AI clients and hardening startup logic
Authentication & State Management • Admin vs user roles needed clean separation • Flutter UI initially showed alerts even when not logged in • Solved with proper auth guards and navigation flow control
AI Reliability • AI calls can fail or rate-limit • I designed safe fallbacks: • Deterministic explanations for LOW risk • Graceful degradation when AI is unavailable
This made the system robust instead of brittle.
Accomplishments that we're proud of
• Built a full end-to-end fraud detection system in record time — from transaction ingestion to AI explainability and user alerts
• Implemented real-time risk scoring using a hybrid approach (deterministic rules + AI explanations) for both speed and reliability
• Designed an explainable AI layer that translates complex risk signals into clear, human-readable reasoning for users and compliance teams
• Delivered dual dashboards:
• Admin compliance dashboard (audit logs, risk distribution, trends)
• User-facing mobile alerts with actionable responses
• Implemented secure authentication flows with role separation (admin vs user) and JWT-based access control
• Persisted immutable audit logs suitable for regulatory review and forensic analysis
• Deployed successfully to Google Cloud Run, proving real-world cloud readiness beyond a local demo
• Handled real production challenges: async APIs, database migrations, CORS, auth edge cases, and mobile/backend sync issues
• Built with scalability in mind, using async FastAPI, modular services, and clean separation of concerns
• Turned a complex problem into a usable product, not just a model or prototype
What we learned
• AI should augment systems, not replace logic
• Explainability matters as much as accuracy
• Production readiness (auth, errors, retries) matters even in hackathons
• Clear architecture beats clever hacks every time
Most importantly: Trust is the real product in financial systems.
What's next for Fraud Sentinel
Fraud Sentinel was built as a production-ready foundation, not just a demo. The next phase focuses on scaling accuracy, intelligence, and real-world adoption.
Smarter Risk Intelligence • Replace static rule weights with adaptive ML models trained on historical transaction data • Introduce behavioral baselines per user (normal spend, time-of-day, merchant patterns) • Use LLM-assisted anomaly detection to flag subtle fraud patterns missed by rules
AI-Driven Decisions (Human-Readable) • Let AI co-assess risk, not just explain it: • AI suggests risk level • Rules act as guardrails • Add confidence scoring and alternative explanations for compliance teams
Stronger Security & Compliance • Role-based access control (User, Analyst, Admin) • Tamper-proof audit logs (append-only + hashing) • Exportable compliance reports (PDF / CSV) • Regional compliance support (PCI DSS, NDPR, GDPR)
User-Facing Protection • Real-time push notifications for high-risk activity • One-tap actions: Approve, Block, Report Fraud • Education prompts explaining why a transaction was flagged
Enterprise & Fintech Integration • Webhooks and SDKs for banks, wallets, and fintech apps • Multi-tenant architecture for institutions • Support for additional channels (USSD, POS, crypto wallets)
Scalable Cloud Architecture • Stream processing with Kafka / PubSub • Real-time dashboards with time-series analytics • Horizontal scaling for millions of transactions per day
Log in or sign up for Devpost to join the conversation.