Part 8 of 12 · 2 min read
Answering isolation questions in an interview
Design a customer-support agent platform for many companies. How do you isolate tenants?
"The tenant is derived from authentication and carried in an immutable context; tools never accept it from the model. Data goes through a scoped repository with row-level security behind it, and retrieval uses a namespace per tenant. Caches are keyed by tenant, credentials are per tenant, and each tenant has token and concurrency quotas with fair scheduling. Traces are tagged by tenant, and an erasure registry covers every store." Follow-up: "What is the biggest agent-specific risk?" A model-controlled argument selecting the tenant. In the example's simulation it leaked 306 of 1,000 injected attempts; binding the tenant to the session leaked none.
How do you stop a retrieval leak across tenants?
"Filter before search or partition by tenant, and test it. Filtering after a global top-k both exposes other tenants' documents to the process and wrecks recall for small tenants. In the example's toy index small tenants got almost none of their own results." Follow-up: "Is a metadata filter enough?" Only if applied by the platform on every query path, and covered by cross-tenant tests. Namespaces make the mistake harder.
What is a noisy neighbour and how do you handle it?
"A tenant that consumes shared capacity: tokens, workers or rate limits. I apply per-tenant quotas, concurrency caps, fair scheduling and bulkheads. In the example's simulation a flooding tenant left another with 24 percent of its demand under a shared budget. Per-tenant quotas raised that to 100 percent." Follow-up: "How do you price for it?" Plans with quotas and overage, so heavy use is paid for.
A tenant asks you to delete all their data. How?
"Use the erasure registry: primary store, vector index, caches, traces, files and backups, with a defined backup expiry. Verify with a post-deletion scan and record it in the audit log." Follow-up: "What do you do about backups?" Document the retention window or use per-tenant keys so deleting the key renders the data unreadable.