Exit
MO
Morgan Stanley AIAudited Advisory RAG & Abstention
VP Wealth Advisor Copilot & Hallucination Defense • ₹40 LPA – ₹85 LPA+ (VP / Director)
Wealth Copilot & Zero-Hallucination RAGCore Systems: No-AI
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
Audited Advisory RAG & Abstention
Before You Start (Morgan Stanley AI)
Run Codebase 3 (`python app.py`) and verify how missing abstention and RBAC cause policy hallucinations and confidential leaks.
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!
Google / Microsoft / Deloitte / Morgan Stanley RAG Style
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']}..."
})