All jobs / AI engineer / AI Data & Privacy
AI engineer interview question · 3–5 years
Your RAG product serves many companies from one vector index. How do you guarantee one tenant never sees another tenant’s content?
The strongest answer
The server applies the tenant filter from the authenticated session on every query — or tenants get separate namespaces — never from the prompt or a model-supplied argument. Memory and caches follow the same rule, with cross-tenant tests in CI
Why it works
Exactly — isolation is an authorisation decision, so code makes it from the session, below the model. A test that tries to cross the line keeps it true after the next refactor.
What a good answer covers
- Tenant isolation is authorisation, not relevance.
- Filter from the session, server-side.
- Cover memory, caches and logs too.
- Test cross-tenant access in CI.
Answers that fall short
- Close, but not the strongest: Store the tenant id as metadata on each chunk and let the agent pass the right tenant id as a filter argument when it calls the search tool
Metadata is the right mechanism, but a filter value the model chooses is a filter an injected document can change. Bind it server-side. - Weak: Embeddings of different companies’ documents end up far apart in vector space, so similarity search naturally returns the right tenant’s chunks
Similarity is about meaning, not ownership; two companies’ HR policies sit right next to each other in vector space. - Red flag: Retrieve across all tenants for the best recall and tell the model in the system prompt to use only passages that belong to the current customer
Once another tenant’s text is in the context it has already leaked to the model and may reach the answer. A prompt cannot un-retrieve it.
Who gets asked this
More AI Data & Privacy questions
- You are choosing a hosted model provider for a feature that handles customer data. What do you check in their…
- An enterprise customer in the EU will sign only if their data “stays in the EU”. Your product calls a hosted…
- What do you expect to have ready, and what do you refuse to gloss over?
- Before your code sends a user’s text to a hosted model API, what questions do you ask about that data?
- You need an LLM to summarise support tickets that contain names, phone numbers and the odd card number. How…
- For debugging, your service logs every prompt and completion in full. What is the privacy problem, and what…