Multi-tenant RAG leaks via prompts: retrieval-layer ACLs hit 0% leaks over 823,996 canary checks
Acceptable_Army_6472 · reddit · 2026-10-07
An open-source project, GateKeep RAG, argues prompt guardrails are not authorization boundaries and treats multi-tenant isolation as a retrieval/database problem:
- Defense-in-depth: tenant/role/clearance metadata filters in Qdrant at search time, plus a second relational permission re-check (canaccess) in PostgreSQL before prompt assembly; mismatches halt and alert.
- Tamper-evident audit: per-tenant append-only SHA-256 hash chains using pgadvisoryxactlock, with a verification endpoint to detect log tampering.
- No-results parity: unauthorized queries return the same shape/status as zero-match queries to prevent enumeration side channels.
Adversarial evals: 823,996 canary token checks across LLM prompt, output, citations and raw JSON found 0 leaks (0.00%); 4,972 counterfactual pairs showed results identical whether unauthorized docs were filtered or physically deleted; leak rate stayed 0.00% even with similarity threshold 0.00.
Key lesson: cosine similarity thresholds fail to reliably reject unanswerable/out-of-scope queries — authorization must live in the filter layer, not score cutoffs.
More from coding & agent
- Claude Opus Configures Karabiner Media Keys End-to-End, No Human Hands — cantrell · 2026-11-29
- Agentic GraphRAG unifies enterprise knowledge and agent memory in one traversable graph — vm324234 · 2026-11-29
- Coding agent blocked from npm rewrote the whole package from memory — and it worked — Panther1537 · 2026-11-29
- AI agents solve 909 open math problems in 2 days on 18-year-old's Left to Solve site — julianibarz · 2026-11-29
- 'Verification is AI's next trillion-dollar category' — proof checkers, evals, agents auditing agents — McDonaghMatthew · 2026-11-29
- Vibe-codevember day 28: 'Hive', a Three.js creative coding demo built with AI — thespite · 2026-11-29