All Questions
Guardrails And Safety easy

Your RAG app stores every tenant's document chunks in one shared vector index, with a tenant_id field on each chunk. How should retrieval prevent cross-tenant leaks?

  1. A Tell the model in the prompt to ignore any retrieved chunk that belongs to a different tenant.
  2. B Rely on the per-tenant databases, since the vector index only stores embeddings, not raw text.
  3. C Run an output classifier that detects other tenants' names in the response and blocks it.
  4. D Enforce a tenant_id filter server-side, taken from the auth session, on every query.

One system design question a day, with spaced repetition so the ones you miss come back.

Get the app

Related questions