Multi-tenant RAG: making sure one customer never sees another customer's documents

A shared vector index serving multiple customers needs strict isolation, not just a metadata filter that a bug could silently bypass. What actually guarantees separation.

In a packed college auditorium
In a packed college auditorium

A SaaS product built on RAG, serving multiple customers from one system, has one non-negotiable requirement: customer A must never retrieve customer B's documents. A metadata filter alone is a fragile way to guarantee this — one bug in the filter logic and the guarantee is gone.

Stronger isolation options

  • Separate indexes or namespaces per tenant, where the vector store itself enforces the boundary structurally, not just via a query filter.
  • If sharing an index, enforce the tenant filter at the database or API layer, never trusting application code alone to always include it correctly.
  • Test isolation explicitly: a test that logs in as tenant A and tries to retrieve tenant B's known documents should be part of your test suite, not an afterthought.

Why this deserves more caution than most RAG advice implies

A retrieval bug that leaks one wrong chunk into an answer is embarrassing. A retrieval bug that leaks one customer's confidential documents to another is a genuine incident. Design the isolation boundary as if a filter bug is inevitable, not unlikely.

RAGMulti-tenancySecurity
Pranjul Rathour
Pranjul Rathour
GenAI Engineer · India

GenAI engineer and AI product builder with 2+ years shipping production-grade AI systems: RAG pipelines, fine-tuned LLMs, hybrid retrieval and multi-modal apps across vision, speech and OCR, architected end to end from ingestion to deployment. Leads engineering for SCULT INDIA's 14-member team, founded the 500+ member TechVerse Enclave community and has mentored 200+ students. Three hackathon first prizes: Changethon 2025 (IIT Roorkee), Product Genesis at Vividhotsava 2025 (CSJMU) and BYTEBATTLE (MeetKats).

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way. Email pranjulrathour41@gmail.com.

Keep reading

More on RAG & retrieval

All RAG & retrieval posts →
Campus talks · hackathon judging · mentoring

Want this as a live session at your college?

Open to GenAI roles, hackathon judging, mentorship sessions and guest talks at colleges. For campus sessions the inviting institution covers the visit end to end: travel (a First AC train ticket for journeys up to five hours, a flight for anything longer), accommodation, meals, and pickup and drop; the honorarium and workshop fees are negotiable on WhatsApp or on the call, and requests are welcome from institutions that can cover the visit this way.

Pranjul Rathour, GenAI engineer in India