A reused agent session retains prior tenant context
Detect: Isolation tests find another tenant's artifact references in memory.
Recover: Destroy the session and enforce tenant-bound reuse rules.
Prevent one tenant’s identity, data, state, tools, or resource consumption from crossing into another tenant’s execution boundary.
Tenant isolation spans the entire agent system: authentication, retrieval, caches, memory, queues, checkpoints, tools, logs, and model-serving resources. Adding a tenant column is useful only if every relevant operation enforces it. Derive tenant context from trusted identity and carry it through all asynchronous and delegated work.
Choose isolation strength from risk and operating requirements. Shared infrastructure with enforced partitions can be efficient; separate databases, keys, workers, or accounts provide stronger boundaries at greater cost. Data isolation and performance isolation are distinct: preventing cross-tenant reads does not prevent one tenant from exhausting shared capacity.
A prototype with one tenant hides many isolation assumptions. Add two synthetic tenants with overlapping document and user identifiers before expanding access.
Production uses mandatory tenant predicates, tenant-aware cache keys, scoped credentials, and isolated session state. Background jobs must reconstruct trusted tenant context rather than use a global default.
At scale, test migration, backup restoration, support tooling, and noisy-neighbor behavior. Isolation controls need to remain intact during administrative operations as well as ordinary requests.
Establishes trusted tenant context from authenticated sessions or service credentials.
Enforces tenant boundaries in retrieval, records, object storage, and checkpoint access.
Carries tenant identity through queues, workers, delegation, and tool credentials.
Prevents shared keys, reused sessions, or summaries from mixing tenant content.
Applies tenant quotas and monitors performance interference separately from data access.
flowchart LR
I["Trusted tenant identity"] --> G["Request scope"]
G --> Q["Tenant-scoped job"]
Q --> W["Scoped worker"]
W --> D["Partitioned document store"]
W --> C["Tenant-keyed cache"]
W --> S["Tenant checkpoint state"]
W --> T["Scoped tool credentials"]
W --> R["Resource quota"]sequenceDiagram
participant A as Authenticated API
participant Q as Durable queue
participant W as Worker
participant S as Scoped data service
A->>A: Resolve trusted tenant identity
A->>Q: Persist job with verified tenant context
Q->>W: Deliver job and context
W->>W: Validate scope and claim ownership
W->>S: Read using tenant-scoped credentials
S-->>W: Authorized tenant records
W->>S: Store artifact with tenant ownershipBind a request to authenticated tenant context and reject conflicting user-supplied identifiers.
Select permitted partitions, keys, credentials, and execution pools.
Attach trusted tenant metadata to durable jobs and child tasks.
Apply mandatory boundaries at every data and tool service, including cache lookup.
Validate that artifacts and citations belong to the requesting tenant.
Test cross-tenant requests, administrative paths, and resource contention continuously.
Property management software · Illustrative enterprise scenario, not a reported customer outcome.
A SaaS platform offers maintenance assistants to property owners with separate tenants and overlapping contractor names.
A cache keyed only by a natural-language question can return another owner's maintenance history.
The assistant must isolate portfolio records, conversations, work orders, and generated reports while sharing infrastructure efficiently.
Trusted tenant context scopes database rows, vector partitions, cache keys, worker jobs, and contractor-tool credentials.
If a background job lacks tenant context, it fails before retrieving data instead of falling back to an application-wide credential.
Measure cross-tenant test failures, missing-scope rejections, cache isolation, and noisy-neighbor latency under concurrent load.
| Decision | Benefit | Cost |
|---|---|---|
| Shared infrastructure | Capacity and operating costs are easier to pool. | Every shared layer needs reliable enforcement. |
| Dedicated tenant resources | Boundaries and capacity guarantees become stronger. | Provisioning, upgrades, and utilization become more expensive. |
| Tenant-specific keys | Cryptographic separation supports stronger data control. | Key lifecycle and recovery require additional operations. |
Detect: Isolation tests find another tenant's artifact references in memory.
Recover: Destroy the session and enforce tenant-bound reuse rules.
Detect: Administrative audit reveals unrestricted access paths.
Recover: Add explicit scoped access and auditable exceptional procedures.
Resolve identity from authenticated context.
Include tenant and authorization scope across all derived stores.
Test isolation through administrative data movement.