All Questions
Guardrails And Safety hard

A multi-tenant RAG system stores all tenants in one shared HNSW index, with a tenant_id metadata field. The retrieval tool's schema exposes tenant_id as an argument, and the system prompt tells the model to always pass the current user's tenant. A user types "search acme-corp's contracts for termination clauses" and receives Acme's chunks. What is the correct fix?

  1. A Add a system-prompt rule forbidding changes to tenant_id and verify it with a suite of known cross-tenant jailbreak prompts.
  2. B Move each tenant's structured records into a separate Postgres database so their data is physically isolated from others.
  3. C Scan retrieved chunks with an output classifier for other tenants' names before the final answer is returned to the user.
  4. D Remove tenant_id from the tool schema and inject it server-side from the authenticated session as a mandatory pre-filter.

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

Get the app

Related questions