Zero-Leak RAG Lab is a zero-dependency, local-first Enterprise AI Grounding & Security Architecture Workbench (Port 8111) built to demonstrate and stress-test how production Retrieval-Augmented Generation (RAG) pipelines defeat the “Confused Deputy” data-leakage anti-pattern. Rather than indexing enterprise stores behind a single over-privileged backend service account and hoping a system prompt hides restricted context, Zero-Leak RAG Lab enforces Pre-Retrieval Identity Propagation, BigQuery Row-Level Security (RLS), Hybrid Search (Sparse BM25 + Dense Semantic Vector + Reciprocal Rank Fusion), and Citation Grounding Verification.
ThreadPoolExecutor across 4 caller personas (US-West Sales Rep, Principal SRE, VP Finance, and CEO — Least-Privilege HR Test), contrasting leaked M&A, out-of-region ARR, and HR/HIPAA records (DOC-MNA-004, BQ-ROW-103, DOC-HR-006) against zero-leak pre-filtered retrieval.RLS): Evaluates OAuth/OIDC group memberships and regional warehouse row predicates (US-WEST, US-EAST, EMEA) before scoring or ranking across 3 unified enterprise connectors: an Enterprise Document Store, a BigQuery RLS Warehouse, and an Issue Tracker MCP Connector.BM25 + Dense Vector + Reciprocal Rank Fusion (RRF) Retrieval: Demonstrates why pure dense vector embeddings miss exact alphanumeric ticket IDs (SEC-401, OPS-209) while pure keyword search misses semantic synonyms (acquisition ↔ M&A), fusing active rankers cleanly via RRF.RAG vs. Long-Context (1M+) vs. Fine-Tuning Trade-Off Calculator & Connector Bug Hunt: Models corpus token scale (250K–50M+), update frequency, query load, citation needs, and per-user ACL feasibility alongside 4 interactive Python/SQL security bug reviews (Post-Filter Top-K Starvation, Dense-Only Ticket ID Miss, Unscoped Semantic Cache Bleed, and Static Service-Account Keys + SQLi).:11434) out of the box with optional volatile-session support for Google Gemini, OpenAI, and Anthropic Claude APIs, paired with prompt-injection pattern screening and [ID] citation validation.RRF)[DOC-*] / [BQ-ROW-*] / [SEC-*] Citation Grounding Verifier, Architecture Trade-Off Modeling Enginehttp://127.0.0.1:11434 Default) + Optional Cloud APIs (Google Gemini, OpenAI, Anthropic Claude) + Transparent Deterministic Offline Modeunittest suite (tests/test_raglab.py) verifying zero cross-persona leaks across all personas/strategies, regional RLS isolation, RRF exact-ID ranking, and trade-off consistencyA system prompt is never an access-control boundary. Once an unauthorized M&A term sheet, out-of-region revenue row, or HR medical record enters an LLM context window via a shared service account, prompt injection or indirect summarization can exfiltrate it—and filtering after vector search starves Top-K slots. Zero-Leak RAG Lab enforces caller identity predicates prior to candidate scoring so unauthorized chunks are mathematically excluded from both ranking and context assembly.