Feature
Description
π Policy Ingestion
Upload any insurance PDF β Agent extracts & freezes rules in seconds
π AI Eligibility Check
Multi-agent pipeline analyzes patient case against frozen policy rules
βοΈ Deterministic Verdict
6-phase rule engine with zero LLM involvement in financial math
π§ Medical Coding
Automatic ICD-10-PCS code lookup for 500+ procedures
ποΈ City-Tier Classification
Auto-applies IRDAI Tier 1/2/3 room rent limits based on location
π° Agentic Savings
what_if_analyzer finds cheaper alternatives (e.g., room downgrade tips)
βοΈ Grievance Agent
Denied claim? Agent generates PDF report, formal letter & sends grievance email
π IRDAI Precedents
Searches real Ombudsman/NCDRC rulings to strengthen your dispute
π 51-Point Audit Trail
Every agent step logged for compliance transparency
π Multi-Model Failover
Auto-switches across 8+ LLM models on rate limits β never goes down
flowchart TB
subgraph INPUT["π Input Layer"]
PDF["Insurance Policy PDF"]
CASE["Patient Case Facts"]
end
subgraph POLICY_AGENT["π€ Agent 1 β Policy Agent (ReAct)"]
direction TB
PT1["π pdf_text_extractor"]
PT2["π pdf_table_extractor"]
PT3["βοΈ irdai_regulation_lookup"]
PT4["β
rule_validator"]
LLM1["π§ Gemini 2.5 Flash\n(JSON Rule Extraction)"]
PT1 --> LLM1
PT2 --> LLM1
PT3 --> LLM1
LLM1 --> PT4
end
subgraph CASE_AGENT["π€ Agent 2 β Case Agent (ReAct)"]
direction TB
CT1["π₯ medical_term_normalizer"]
CT2["π¬ icd_procedure_lookup"]
CT3["ποΈ city_tier_classifier"]
CT4["π° hospital_cost_estimator"]
CT1 --> CT2 --> CT3 --> CT4
end
subgraph ENGINE["βοΈ Decision Engine (Deterministic)"]
direction TB
DE["6-Phase Rule Evaluator\n(Zero LLM β Zero Hallucination)"]
PHASE["β Exclusions β β‘ Room Rent β β’ Sub-limits\nβ£ Waiting Periods β β€ Deductibles β β₯ Co-pays"]
DE --> PHASE
end
subgraph EXPLAIN_AGENT["π€ Agent 3 β Explanation Agent (ReAct)"]
direction TB
ET1["π clause_explainer"]
ET2["π‘ savings_calculator"]
ET3["π what_if_analyzer"]
LLM2["π§ Gemini 2.5 Flash\n(Patient-Friendly Language)"]
ET1 --> ET2 --> ET3 --> LLM2
end
subgraph GRIEVANCE_AGENT["π€ Agent 4 β Grievance Agent (ReAct)"]
direction TB
GA1["π search_irdai_precedents"]
GA2["βοΈ draft_grievance_letter"]
GA3["π generate_claim_report_pdf"]
GA4["π§ send_grievance_email"]
GA1 --> GA2 --> GA3 --> GA4
end
subgraph OUTPUT["π Output"]
VERDICT["β
Verdict (Approved / Partial / Denied)"]
EXPLAIN["π Plain-English Explanation"]
SAVINGS["π° Cost-Saving Suggestions"]
PDF_R["π PDF Claim Report"]
LETTER["βοΈ Formal Grievance Letter"]
end
PDF --> POLICY_AGENT
POLICY_AGENT -->|"Frozen Rules (JSON)"| DB[(SQLite)]
CASE --> CASE_AGENT
DB --> ENGINE
CASE_AGENT -->|"Structured Facts"| ENGINE
ENGINE -->|"Rule-by-Rule Verdict"| EXPLAIN_AGENT
EXPLAIN_AGENT --> VERDICT & EXPLAIN & SAVINGS
ENGINE -->|"Partial/Denied"| GRIEVANCE_AGENT
GRIEVANCE_AGENT --> PDF_R & LETTER
style POLICY_AGENT fill:#0f3460,stroke:#e94560,color:#ffffff
style CASE_AGENT fill:#0f3460,stroke:#16213e,color:#ffffff
style ENGINE fill:#533483,stroke:#e94560,color:#ffffff
style EXPLAIN_AGENT fill:#0f3460,stroke:#16213e,color:#ffffff
style GRIEVANCE_AGENT fill:#7b2d00,stroke:#e94560,color:#ffffff
style OUTPUT fill:#1a1a2e,stroke:#00d2ff,color:#ffffff
Loading
stateDiagram-v2
[*] --> LoadPolicy: Start
LoadPolicy --> AnalyzeCase: Policy loaded
AnalyzeCase --> DecisionEngine: Facts structured
DecisionEngine --> ExplainVerdict: Verdict produced
ExplainVerdict --> GrievanceAgent: Claim denied/partial
ExplainVerdict --> [*]: Claim approved
GrievanceAgent --> [*]: Grievance package sent
state DecisionEngine {
[*] --> CheckExclusions
CheckExclusions --> ApplyRoomRent
ApplyRoomRent --> ApplySublimits
ApplySublimits --> CheckWaiting
CheckWaiting --> ApplyDeductibles
ApplyDeductibles --> ApplyCopay
}
Loading
SecureShield has 4 specialized agents with 16 custom domain tools .
Reads insurance PDF β extracts & validates structured rules
#
Tool
Purpose
1
pdf_text_extractor
Extract raw text from insurance PDF (PyMuPDF)
2
pdf_table_extractor
Extract tables from PDF (premium plans, limits)
3
irdai_regulation_lookup
Cross-reference clauses with IRDAI regulations KB
4
rule_validator
Validate and freeze extracted rules into SQLite
Enriches raw patient case with medical coding and location intelligence
#
Tool
Purpose
5
medical_term_normalizer
Expand abbreviations (CABG β Coronary Artery Bypass)
6
icd_procedure_lookup
Map procedure β ICD-10-PCS code (500+ procedures)
7
city_tier_classifier
Auto-classify city β IRDAI Tier 1/2/3 for room rent
8
hospital_cost_estimator
Benchmark procedure cost vs regional market rates
Agent 3 β Explanation Agent
Translates verdict into plain language + finds savings
#
Tool
Purpose
9
clause_explainer
Explain each triggered rule in simple language
10
savings_calculator
Find max savings via room downgrade or alternatives
11
what_if_analyzer
Re-run engine with modified params to show options
12
audit_trail_logger
Log every agent step for compliance traceability
Agent 4 β Grievance Agent β New
Turns a "No" into a formal dispute with legal backing
#
Tool
Purpose
13
search_irdai_precedents
Google Search + curated IRDAI/NCDRC/SC rulings
14
draft_grievance_letter
LLM drafts formal letter citing IRDAI regulations
15
generate_claim_report_pdf
Professional PDF report with rule-by-rule breakdown
16
send_grievance_email
Sends grievance to insurer GRO (mocked with tracking ID)
βοΈ Compliance Guardrails
SecureShield enforces IRDAI 2024 Master Circular rules deterministically β no LLM guesswork.
ποΈ The "Symbolic Shield" (Why We Don't Hallucinate)
LLM Agent β Extracts parameters from unstructured PDF
Deterministic Engine β Applies EXACT financial math (no LLM)
Guardrail β LLM never performs final math or verdict
Key Regulatory Rules Implemented
Rule
Implementation
5-Year Moratorium
Moratorium Period (IRDAI June 2024) : Claims after 60 continuous months cannot be denied for PED/non-disclosure.
Waiting Periods
Procedure-specific validation (e.g., Joint Replacement: 4yr, Cataract: 2yr) per 2024 norms.
Room Rent Proportional Deduction
Correctly applied per IRDAI PPHI Regulations 2017 (Section 7)
Age-Based Co-pay
20% co-payment auto-triggered for patients aged 60+
City-Tier Limits
Tier 1/2/3 room rent caps automatically applied based on hospital location
IRDAI Regulations Cited in Grievance Letters
IRDAI (Protection of Policyholders' Interests) Regulations 2017
IRDAI Health Insurance Master Circular 2024
IRDAI (Insurance Ombudsman) Rules 2017
Consumer Protection Act 2019 (Section 2(46))
π§ͺ Verified Test Results
β
Case 1 β Star Health Premier Gold (βΉ10L SI)
Parameter
Value
Patient
Rajesh Kumar, 45M
Procedure
Total Knee Arthroplasty
Hospital
Apollo Hospital, Hyderabad (Tier 1)
Room
Semi-Private @ βΉ4,500/day Γ 5 days
Total Claim
βΉ3,25,000
Rules Extracted
32
Verdict
β
APPROVED β 100% coverage
Eligible Amount
βΉ3,25,000
Pipeline Time
~16.5 sec (12 tools)
β οΈ Case 2 β ICICI Lombard Basic Shield (βΉ3L SI)
Parameter
Value
Patient
Amit Shah, 32M
Procedure
Appendectomy (Emergency)
Hospital
Fortis Hospital, Jaipur (Tier 2)
Room
Private @ βΉ10,000/day Γ 3 days
Total Claim
βΉ1,50,000
Rules Extracted
23
Verdict
β οΈ PARTIAL β 66.4% coverage
Eligible Amount
βΉ99,600 (room rent capped at 1% SI/day)
Agentic Savings
π‘ Switch to Semi-Private β +βΉ18,000 saved
βοΈ Case 3 β ICICI Lombard (Dispute Flow)
Parameter
Value
Verdict
PARTIAL (flagged for dispute)
Grievance Tools
search_irdai_precedents β draft_grievance_letter β generate_claim_report_pdf β send_grievance_email
PDF Report
Generated (~3KB, professional layout)
Email Status
Sent to grievance@icicilombard.com (Tracking: GRV-B780AED2)
IRDAI Precedents
4 relevant Ombudsman rulings cited
π LLM Resilience β Multi-Model Failover
gemini-2.0-flash β gemini-2.5-flash β gemini-2.5-pro β gemini-2.0-flash-lite
β (if all exhausted)
openrouter/mistral β openrouter/llama β openrouter/deepseek
Global retry : 3 attempts Γ 60s exponential backoff. The pipeline self-heals on rate limits.
Layer
Technology
Backend
Python 3.11+, FastAPI, Pydantic v2, LangGraph 0.2
LLM Provider
Google AI Studio (Gemini 2.5 Flash/Pro) + OpenRouter
Frontend
Next.js 16, React 19, Vanilla CSS
Database
Async SQLite (aiosqlite)
PDF Parsing
PyMuPDF (text + table extraction)
PDF Generation
ReportLab (professional claim reports)
Knowledge Bases
IRDAI regulations, ICD-10-PCS procedures, Indian city tiers
Security
HMAC API keys, rate limiting, PDF sanitization
cd backend
pip install -r requirements.txt
# Add your API key
echo " GOOGLE_API_KEY=your-key-here" > .env
# Start server (note the Master API Key in output)
uvicorn main:app --port 8000
cd frontend
npm install
npm run dev
# β Open http://localhost:3000
Settings β paste the API key from the backend console
Upload Policy β drag any health insurance PDF
Check Eligibility β fill patient details β instant verdict + savings tips
Dispute Claim β pick a partial/denied claim β AI generates PDF report + formal letter
Method
Endpoint
Description
Auth
GET
/api/health
Health check
β
POST
/api/upload-policy
Upload & ingest policy PDF
β
GET
/api/policies
List ingested policies
β
GET
/api/policies/{id}
Policy details + extracted rules
β
POST
/api/check-eligibility
Run full agentic eligibility pipeline
β
GET
/api/history
Recent eligibility check history
β
GET
/api/audit-trail
51-point agent audit trail
β
POST
/api/dispute-claim
π Run Grievance Agent pipeline
β
GET
/api/download-report/{file}
π Download generated PDF report
β
All authenticated endpoints require the X-API-Key header.
SecureShield/
βββ backend/
β βββ agents/
β β βββ orchestrator.py # LangGraph state machine (main pipeline)
β β βββ policy_agent.py # Agent 1: PDF β structured rules
β β βββ case_agent.py # Agent 2: Patient case analysis
β β βββ explanation_agent.py # Agent 3: Verdict explanation + savings
β β βββ grievance_agent.py # Agent 4: Dispute letter + PDF + email β NEW
β β βββ model_router.py # Multi-model LLM failover chain
β βββ engine/
β β βββ decision_engine.py # 6-phase deterministic evaluator
β βββ tools/
β β βββ policy_tools.py # Tools 1-4: PDF extraction, rule validation
β β βββ case_tools.py # Tools 5-8: Medical coding, cost estimation
β β βββ explanation_tools.py # Tools 9-12: Clause explainer, what-if
β β βββ grievance_tools.py # Tools 13-16: PDF, letter, search, email β NEW
β β βββ audit_tools.py # Compliance audit logging
β βββ knowledge/
β β βββ irdai_rules.json # IRDAI Master Circular 2024 clause KB
β β βββ icd_procedures.json # 500+ ICD-10-PCS procedures
β βββ models/
β β βββ policy.py # Policy schema
β β βββ case.py # CaseFacts schema (with tenure, renewal)
β β βββ verdict.py # Verdict, RuleMatch schemas
β β βββ grievance.py # GrievanceRequest/Response β NEW
β βββ db/ # Async SQLite
β βββ generated_reports/ # PDF claim reports (auto-created)
β βββ security.py # HMAC keys, rate limiting, sanitization
β βββ config.py # LLM + system configuration
β βββ main.py # FastAPI application (9 endpoints)
β βββ requirements.txt
βββ frontend/
β βββ src/app/
β βββ page.js # Dashboard
β βββ upload/ # Policy upload (drag-and-drop)
β βββ check/ # Eligibility check form
β βββ dispute/ # β NEW: Grievance Agent UI
β βββ history/ # Past check results
β βββ audit/ # Agent audit trail viewer
β βββ settings/ # API key configuration
βββ LICENSE
βββ README.md
Layer
Implementation
API Auth
HMAC-SHA256 generated keys with constant-time comparison
Rate Limiting
Per-IP request throttling middleware
PDF Validation
Size check (20MB), magic bytes, MIME type before processing
Log Masking
API keys never appear in log output
Path Traversal
os.path.basename() enforced on all file downloads
Criteria
SecureShield Implementation
Innovation
Neuro-symbolic ReAct + LangGraph + Consumer Advocacy Agent
Domain Depth
ICD-10 coding, IRDAI 2024 compliance, City-Tier classification
Technical Depth
16 custom tools, multi-model failover, async SQLite, PDF generation
Feasibility
Deterministic engine β zero hallucination risk in financial math
Scalability
Multi-provider LLM chain (Google + OpenRouter) β never rate-limited
Compliance
IRDAI 2024 guardrails, 8-yr moratorium, Ombudsman escalation path
Decision
Why
Deterministic Decision Engine
Financial verdicts must be reproducible & auditable β LLMs hallucinate numbers
LLM only for NLP tasks
AI does what it excels at (extraction/explanation); math stays in code
Frozen rules in SQLite
Once extracted, rules are immutable β same case always β same verdict
16 domain-specific tools
Purpose-built tools (IRDAI lookup, ICD-10 resolver) beat generic search
Grievance Agent
Transforms "Denied" into a legally-backed action β unique differentiator
Multi-model failover
8+ models across 2 providers β free-tier rate limits are never a showstopper
Licensed under the MIT License β see LICENSE for details.
Built for the ET GenAI Hackathon 2026 π
4 Agents Β· 16 Tools Β· Zero Hallucination Β· Full Compliance