Part 7 of 12 · 1 min read
How to build it so it holds up
- Authenticate first and build an immutable request context (tenant, user, roles) that the platform, not the model, passes to tools.
- Scope data access through one layer that injects the tenant; forbid unscoped queries; add row-level security as backup.
- Use namespaces or collections per tenant for vector stores and memory; test recall by tenant size.
- Key caches by tenant (and user for personalised content); no cross-tenant semantic cache.
- Fetch per-tenant credentials at call time from a secrets manager; avoid shared broad service accounts.
- Give each tenant quotas for tokens, concurrency and queue share; schedule fairly (module 2).
- Isolate execution: separate sandboxes, filesystems and network egress rules per tenant.
- Tag all logs and traces with the tenant, restrict viewer access, set retention.
- Keep an erasure registry of all stores; test offboarding end to end.
- Write cross-tenant tests: two tenants, attempt every read path, with injected instructions; run them in CI.
- Offer stronger isolation tiers for sensitive customers.