-
-
3-stage decision pipeline: Gemini extraction, deterministic RBAC policy checks, and Z-score risk routing.
-
Treasurer Escalation Queue with editable overrides and mandatory audit notes for flagged claims.
-
Immutable double-entry ledger with 1-click atomic rollback and compensating REVERSAL audit trail.
-
Built-in verification harness passing 12/12 core, boundary, adversarial, and recovery tests live.
Live Demo: https://claim-guard-five.vercel.app/ (Backend runs on Render's free tier — please allow ~30–40s on first load if the server is waking up. Click **Reset Demo* in the top-right bar anytime to restore clean seeded balances.)*
GitHub Repository: https://github.com/abhiman1251070675-dotcom/ClaimGuard
Demo Video: https://youtu.be/9i5rO0MRKLU
Track: Community & Operations (Paperwork People Avoid)
Inspiration
Student organizations handle dozens of reimbursements every week through messy WhatsApp messages, Hinglish receipt notes, and informal spreadsheets. Because nobody wants to fill out formal expense paperwork, club treasurers end up either bottlenecking every small spend or accidentally approving duplicates, over-limit claims, and personal purchases with zero audit trail. We built ClaimGuard to automate the paperwork without handing unchecked financial authority to a black-box AI.
What it does
ClaimGuard transforms unstructured expense claim text into a transparent, 3-stage typed decision pipeline backed by an immutable double-entry SQLite ledger:
- Stage 01 —
ClaimExtraction(LLM): Uses Gemini (gemini-3.5-flash-liteviagoogle-genai) with a strict Pydanticresponse_schemato parse messy English or Hinglish claim text into typed fields (vendor,amount,currency,category,event_name,item_summary,missing_fields,extraction_confidence) without hallucinating missing values. - Stage 02 —
PolicyGateDecision(Deterministic Python + RBAC): Enforces hard financial rules an LLM can never override—role-based caps (Member ₹1,500 | Club Lead ₹5,000 | Treasurer Unlimited), prompt-injection blocking, prohibited-item filtering, SHA-256 duplicate-claim detection, and live budget checks. - Stage 03 —
RoutingDecision(Weighted Risk & Z-Score Anomaly Model): Combines extraction confidence with historical category Z-score anomaly penalties and routes every claim across explicit thresholds:≥ 0.85AUTO_APPROVE,0.50–0.84ESCALATE_HUMAN, and< 0.50HARD_REJECT.
On top of the pipeline, ClaimGuard provides a full Accountability & Recovery Layer:
- Decision Trace Inspector: Shows all 3 decision cards plus collapsible raw JSON for every claim.
- Treasurer Escalation Queue: Allows field overrides (
vendor,amount,category) and enforces a mandatory non-empty audit note before approval or rejection. - 1-Click Atomic Ledger Rollback: If an auto-approved claim is later flagged as an error during audit, a treasurer can revert it in one click—atomically restoring the exact category balance, marking the original
DEBITasREVERSED(never deleting rows), appending a compensatingREVERSALtransaction, and logging an immutableAuditEvent. - Built-In Live Test Runner: Run 12 deterministic verification tests directly inside the dashboard (
System & Teststab).
How we built it
We intentionally skipped opaque multi-agent frameworks (like LangChain or CrewAI) in favor of clean, inspectable software boundaries:
- Backend: Python, FastAPI, Uvicorn, SQLAlchemy, SQLite, Pydantic v2, and the official
google-genaiSDK (gemini-3.5-flash-lite), deployed on Render. - Frontend: React 19, Vite 6, Tailwind CSS v4, and
lucide-react, deployed on Vercel. - Verification:
pytestsuite with 14 automated tests (7 core/boundary/recovery, 5 adversarial/failure, and 2 live Gemini E2E tests) running against isolated per-test SQLite databases via dependency overrides.
Challenges we ran into
- Preventing LLM authority creep: Ensuring the model acts strictly as an untrusted parser while keeping RBAC caps, duplicate hashes, and prompt-injection blocks 100% deterministic in pure Python.
- Safe failure modes under LLM outages: Designing a
FALLBACK_ERRORpath (with a live Simulate LLM Outage toggle in the UI) so API timeouts or schema failures cleanly escalate to the Treasurer Queue rather than crashing or silently approving funds. - Atomic rollback without mutating history: Ensuring 1-click reversals update balances, claim status, ledger history, and audit events in a single database transaction while blocking double-revert attempts (
400).
Accomplishments that we're proud of
- Turning messy, real-world Hinglish reimbursement messages into reproducible, schema-validated financial traces.
- Proving every edge case—including prompt injections, exact ₹1,500 role boundaries, Z-score spending anomalies, duplicate SHA-256 claims, LLM outages, and 1-click atomic rollbacks—across 14/14 passing
pytesttests plus an interactive in-app test harness. - Deploying a full-stack live demo where judges can test both normal workflows and adversarial attack scenarios in seconds.
What we learned
Accountable AI systems are less about clever prompting and more about architecture: separating probabilistic extraction from deterministic policy enforcement, exposing confidence thresholds openly, and designing clean human-in-the-loop recovery paths for the inevitable moment an automated decision turns out to be wrong.
What's next for ClaimGuard — Accountable Expense Gatekeeper
- OCR Receipt Verification: Cross-checking uploaded receipt images against extracted vendor and amount fields before auto-approval.
- Direct WhatsApp & Slack Bot Ingestion: Capturing club expense messages directly from group chats into the same 3-stage pipeline.
- Multi-Club Auth & Exportable Audit Reports: Supporting multiple student societies with CSV/PDF end-of-semester treasurer audit packs.
Built With
- fastapi
- gemini-api
- pydantic
- pytest
- python
- react
- render
- sqlalchemy
- sqlite
- tailwindcss
- vercel
- vite

