DE
Deloitte USI

GenAI Assurance, Tax & Audit Systems Lead • ₹28 LPA – ₹60 LPA (Manager / Sr Lead)

GenAI Assurance, Audit & RAGWith-AI Coding Allowed

Codebase 3: Enterprise Policy RAG & Salary-Leak Audit

Inspect a company HR & Policy RAG chatbot over Leave Policy Markdown and Payroll JSON. Trigger both real-world failures: (1) hallucinating intern leave carry-forward rules from cut tables, and (2) leaking Priya Sharma's confidential salary to interns due to missing RBAC pre-filtering + bloated FP64 linear scan.

System Design Perspective

Zero-Hallucination Audit & Tax RAG

Before You Start (Deloitte USI)

Launch Codebase 3 (`python app.py`) to inspect how broken Markdown chunking causes compliance hallucinations on HR leave tables.

Download & Run LocallyDownload .zip
Runtime: Python 3.9+ (Pure stdlib — zero pip install required)
unzip enterprise-policy-rag.zip
cd enterprise-policy-rag
python app.py
# Open http://localhost:8100, keep Role = intern, and click Test 1 & Test 2!
VECTOR_DIM = 256  # Unnormalized FP64 dense list -> bloated memory!

# BUG 1: Fixed 180-char slicing breaks Markdown leave tables mid-row!
for i in range(0, len(raw), 180):
    self.chunks.append({"source": "hr_leave_policy.md", "access_role": "all", "text": raw[i:i+180]})

# BUG 2: Confidential payroll JSON embedded into SAME flat index!
for rec in records:
    self.chunks.append({
        "source": "payroll_confidential.json",
        "access_role": rec["required_access_role"], # NEVER checked in retrieve()!
        "text": f"Employee {rec['name']} earns annual CTC INR {rec['annual_ctc_inr']}..."
    })