All Questions
Guardrails And Safety medium

Your RAG system stores all tenants' chunks in one vector index. It runs an ANN top-k search and then drops results whose tenant_id metadata does not match the tenant_id field in the API request. A security review rates this high severity. What change best addresses the risk?

  1. A Encrypt embeddings at rest so that a leaked vector cannot be inverted back into the source text of another tenant's document.
  2. B Increase top-k from 10 to 100 so that post-filtering by tenant_id still leaves enough relevant chunks for every query.
  3. C Add a system prompt instruction telling the model to ignore any retrieved chunk whose metadata names a different tenant.
  4. D Scope the search itself by tenant (pre-filter or per-tenant namespace), taking tenant_id from the session, not the request.

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

Get the app

Related questions