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:

  1. Stage 01 — ClaimExtraction (LLM): Uses Gemini (gemini-3.5-flash-lite via google-genai) with a strict Pydantic response_schema to 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.
  2. 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.
  3. 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.85 AUTO_APPROVE, 0.50–0.84 ESCALATE_HUMAN, and < 0.50 HARD_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 DEBIT as REVERSED (never deleting rows), appending a compensating REVERSAL transaction, and logging an immutable AuditEvent.
  • Built-In Live Test Runner: Run 12 deterministic verification tests directly inside the dashboard (System & Tests tab).

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-genai SDK (gemini-3.5-flash-lite), deployed on Render.
  • Frontend: React 19, Vite 6, Tailwind CSS v4, and lucide-react, deployed on Vercel.
  • Verification: pytest suite 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_ERROR path (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 pytest tests 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

Share this project:

Updates

Submission history