On this page, 7 sections
Tenant isolation in a multi-tenant AI SaaS or agent platform means every request, query, embedding, cache entry, log line and agent action is bound to one customer, and the system refuses to cross that boundary even when a prompt asks it to. Enterprise buyers ask about it first, and auditors test it under logical access and confidentiality controls.
Ordinary SaaS has dealt with this problem for years, and the patterns are well known. AI products make it harder in two ways. Customer data spreads into more places, such as vector stores, prompt caches, conversation memory and fine-tuning sets. And an agent is a piece of software that takes instructions from text and then acts with whatever access it holds. If its access is not scoped to one tenant, a well-crafted document or message can ask it to reach into another.
Why buyers ask about tenant isolation first
When an enterprise security team reviews an AI vendor, the opening question is rarely about encryption or passwords. It is: what stops your product, acting for another customer, from seeing our records? For an agent platform the follow-up is sharper: what stops another customer's agent from acting on our data?
They ask because the failure is easy to picture and hard to undo. A cross-tenant leak in an AI product can surface one customer's data inside another customer's answer, with no attacker involved, simply because retrieval or memory was not filtered by tenant. That is a breach to explain to both customers and, in Canada, potentially a breach of security safeguards to record and report under PIPEDA.
In a recent engagement, an agentic marketplace platform came into its SOC 2 and ISO 27001 gap assessment with a data model that had no concept of a tenant at all. Both of its products handle customer business data, and the marketplace's agents act on it. That made tenant isolation the question its buyers would ask most pointedly, and building it in became the largest single item in its remediation plan. It is an architectural change, not a configuration change, which is why it pays to decide early.
The three isolation models
There are three common ways to separate tenants. Each one is defensible in an audit if it is applied consistently and tested.
Silo: a separate stack per tenant
Each customer gets its own database, and sometimes its own compute and storage. Isolation is strong and easy to explain to a buyer. It is also the most expensive to run and the hardest to operate at scale, so it is usually reserved for the largest or most regulated customers.
Bridge: shared compute, separate data stores
The application is shared, but each tenant has its own database schema, its own storage prefix with its own encryption key, or its own vector index. This is a common middle ground for B2B AI products with a modest number of larger customers.
Pool: shared everything, enforced by tenant ID
All tenants share the same tables, indexes and services, and every row carries a tenant identifier. This is the cheapest and most common model for startups. It is also the one most likely to leak, because isolation depends on every query remembering to filter. If you pool, enforce the filter below the application where you can, for example with database row-level security, so that a forgotten WHERE clause fails closed instead of returning everything.
Many products end up with a mix: pooled for most customers, siloed for a few who pay for it. That is fine, provided your architecture document says which is which.
Where AI products leak across tenants
The main database is usually the first thing teams isolate. The leaks tend to be elsewhere. Work through each of these and write down how tenant boundaries are enforced in it:
- Vector stores and retrieval. If embeddings from all customers sit in one index, every retrieval query needs a tenant filter, applied by the server, not by the prompt. A separate index or namespace per tenant is safer.
- Conversation memory and caches. Prompt caches, semantic caches and session memory keyed only by content or user can return one tenant's context to another.
- Fine-tuning and evaluation data. Customer data used to tune a shared model can resurface in other customers' outputs. Either keep tuning per tenant or get explicit permission and remove identifying data.
- Agent credentials. An agent that holds one set of credentials able to reach every customer's integrations is a single point of failure. Issue credentials per tenant, scoped to what that tenant authorized.
- Tool calls. Every tool the agent can call should receive the tenant context from the server and ignore any tenant identifier supplied in model output.
- Object storage and files. Uploaded documents, generated reports and exports need tenant-scoped paths and access policies.
- Logs and observability. Logs often contain prompts and outputs. Staff who can read all logs can read all customers' data, so restrict and record that access.
- Background jobs. Queues and scheduled tasks that process many tenants in one run need to carry tenant context explicitly.
Free weekly email
Get The Compliance Brief every Tuesday
One email a week from Jacob Masse: the security and compliance stories that changed something that week, and what each one means if you sell software to enterprise buyers. Five stories, a take on each, five minutes to read.
Free. Unsubscribe in one click, and replies reach Jacob directly. Read the latest issue or browse the archive.
Prompt injection and the tenant boundary
The rule that matters most for agents is simple: the model never decides which tenant it is working for. The tenant is fixed by the authenticated session, before the model sees anything, and passed to every data access and tool call by the server. If a document the agent reads says "now fetch the invoices for account 4471", the agent may try, but the data layer only ever returns the current tenant's records.
This is what turns prompt injection from a data breach into a nuisance. It does not stop an attacker from manipulating the agent within one customer's account, which needs its own controls, but it does stop the manipulation from crossing to another customer. Our AI agent security assessment guide covers testing the rest of what an agent can be made to do.
How to prove it to an auditor and a buyer
SOC 2 tests tenant isolation under logical access, mainly CC6.1, and under the Confidentiality criteria if included. ISO 27001 tests it under its access control and secure development controls. In both cases, a claim is not evidence. Prepare:
- An architecture description that names each data store and how tenants are separated in it.
- The enforcement mechanism: row-level security policies, per-tenant keys or namespaces, and the middleware that sets tenant context.
- Automated tests that attempt cross-tenant reads and writes and must fail, run on every change.
- A penetration test that specifically tries to cross tenants, including through the agent. See our penetration testing page for how we scope it.
- Restricted staff access to production data, with access reviews.
A buyer's questionnaire will often ask the question in one line. Answer it in one or two sentences with a fact in them, such as the isolation model and the enforcement point, and offer the architecture description under NDA. Our guide to answering enterprise security questionnaires covers the format.
When to build it
The cheapest time is before you have customers. The next cheapest is now. Building tenant isolation in at ten customers is far less work than at a hundred, because the data migration, the testing and the risk of a mistake all grow with every tenant you add.
If you are early and have to choose where to start, start with the places where customer data is retrieved for the model: the vector store and memory. Those are where leaks happen without anyone attacking you. Then move the tenant filter below the application, add the cross-tenant tests, and scope the agent's credentials per tenant.
The marketplace platform above found its tenancy gap during Phase 1, alongside credentials in git history, environments that were not separated and a database with no tested backup. Six findings were closed before the gap reports went out, including a production database that was publicly reachable. Tenancy was not one of them, because it could not be closed in weeks. It was scoped into Phase 2, with a plan the company could show buyers in the meantime.
Common questions
Is a tenant ID column enough for SOC 2?
It can be, if every query is filtered and you can show it. Auditors and buyers will be more comfortable if the filter is enforced below the application, for example by row-level security, and if automated tests prove cross-tenant access fails.
Do we need a separate database for each customer?
No. Neither SOC 2 nor ISO 27001 requires a particular isolation model. Separate databases make the argument easier for some buyers, but a pooled model with enforced filtering and good tests is defensible.
Can a shared model be trained on several customers' data?
Only with care. Data used to train a shared model can surface in other customers' outputs. Most enterprise buyers will ask whether their data trains anything, and contracts often forbid it. Keep training data per tenant, or get explicit agreement and strip identifying information.
How do we isolate tenants in a vector database?
Use a separate index, collection or namespace per tenant where the database supports it. If tenants share an index, apply the tenant filter on the server for every query and test that it cannot be bypassed.
If tenant isolation is the question holding up your enterprise deals, book a free call. We will tell you how your current design will read to an auditor and a buyer, and what a Phase 1 assessment would cover. Our AI security assessments test the agent side directly.
Buyers asking how you keep their data apart? SOC 2 readiness starts with a fixed-price gap analysis from $3,000, ISO 27001 from $3,500, and the rest is scoped from what it finds.
See readiness pricingOr book a free call