Architecture Design and Implementation Built for the Cloud

A shared RAG knowledge base contains documents for multiple tenants, with tenant metadata attached to every chunk. How should the application prevent another tenant's passages from entering the generation context?

Show the answer

Correct answerA. Apply a retrieval metadata filter derived from the authenticated tenant identity.

AWhy this is right: A trusted tenant filter restricts retrieved chunks before they are supplied to the generation model.

BWhy not this: Output filtering occurs after the model has already received potentially unauthorized context.

CWhy not this: Similarity ranking is not an authorization boundary and can still return another tenant's passages.

DWhy not this: Prompt instructions do not prevent unauthorized passages from entering the model context.

A server-enforced metadata filter based on authenticated identity restricts retrieval before passages enter the model context. Prompt instructions and output filtering act after retrieval and do not prevent cross-tenant context exposure.