RAG Permissions and Access Control: Keeping Multi-Tenant Data Separate

An assistant must not know more than the person asking. Enforce that in the retrieval layer.


The most damaging RAG failure is leaking one user's or customer's data to another. Prompts cannot prevent it; retrieval design can.

Principles

Patterns

Test for leaks

Write tests where one user asks about another tenant's data and confirm nothing is retrieved or cited. Re-run on every change. Include prompt-injection attempts; see AI agent security.

Log and review

Record which documents were retrieved for each answer to support audits and incident analysis.

Privacy link

Personal data in indexes also triggers DPDP and GDPR duties such as deletion. Design for deletion by source ID. See RAG development.

Frequently asked questions

How do I stop RAG leaking confidential documents?

Enforce permissions in the retrieval layer using tenant and access-control filters, default to deny and test for cross-tenant leaks.

Is a separate index per customer necessary?

Not always. Filtered shared indexes can work if filters are enforced on every query and tested, but separate indexes give stronger isolation.

Can the prompt enforce access control?

No. Prompts are not a security boundary.

Related: RAG development · Agent guardrails · Vector databases

Want a straight answer for your project?

Book a 30-minute call. I will tell you what I would do, and a fixed price if it makes sense.