Designing AI Agents

Migrating From a Shared Agent Backend to One Isolated Agent per Tenant Without Downtime

An ordered cutover plan for moving tenants to isolated agents safely.

· 8 min read
Cover illustration for “Migrating From a Shared Agent Backend to One Isolated Agent per Tenant Without Downtime”
Per-User Agent Patterns · December 4, 2026 · 8 min read · 1,839 words

Migrating from a shared agent backend to one isolated agent per tenant without downtime requires an ordered cutover. For per-user persistent AI agent deployment at scale, audit the shared system’s exposure, provision and populate tenant machines in parallel, then move traffic through a tenant-aware router. Keep the shared backend available for rollback, and let live sessions reach a checkpoint or finish before switching them.

Why shared agent backends fail under multi-tenant load

An agent keeps conversational history, planning state, and tool-execution context for as long as a session runs. A misconfigured execution graph can therefore propagate corrupted state through later calls, and persistence can spread that corruption across sessions. A tenant_id filter addresses query scope, but it does not contain every place the agent keeps or acts on context.

Shared capacity introduces a separate failure mode. Token use follows a heavy-tailed distribution because a complex task, deep tool calls, and retry loops can make a single session use far more tokens. Fixed-capacity allocation therefore under-provisions busy sessions or over-provisions the fleet. Tenants that share that capacity still face noisy neighbors even when their database queries have the right scope.

Retrieval can fail without raising an error. Semantic search returns relevant fragments, and an agent can weave another tenant’s fragments into an answer as if they belonged there. Arceo & Narsing (ACM CAIS '26) formalize this relevance-authorization gap and document cross-tenant leakage in 98 to 100 percent of ungated retrieval probes. Relevance is not permission, and a plausible answer is not evidence of authorized retrieval.

If an agent debugging a deploy shares a kernel or network namespace with a production container, a hallucinated command or an exploited tooling vulnerability can reach the workload it was operating. Microsoft disclosed CVEs in May 2026, CVE-2026-25592 and CVE-2026-26030, showing prompt injection against Semantic Kernel achieving host-level remote code execution. These failures cross boundaries that a tenancy filter never controlled.

Auditing blast-radius exposure before touching any infrastructure

The first engineering task is a blast-radius audit. Run it against the existing system before provisioning anything, covering data, the shared model endpoint, tool credentials, and observability and cost together. Its output should be a tenant-by-service risk map. Fixing one layer while leaving another ungated merely relocates the exposure.

Start with every place agent state persists. Include conversations, sessions, memory, vector stores, and workflow state, and record whether each is physically separated or only logically scoped. A shared store with a tenant_id column remains a misconfigured query away from leakage. Follow the retrieval paths into those stores too, because where data is stored does not by itself set what a search may return.

Record the keys, token budgets, and rate limits for each tenant at the shared endpoint, then trace which credentials reach MCP servers and third-party APIs. The MCP Authorization spec, revision 2025-06-18, makes credential isolation a requirement. A confused credential is a cross-tenant breach. Check that traces, token usage, and spend are tenant-attributable as well, or billing and debugging will both lose their footing.

Runtime trust needs its own audit entry. Find the tenants whose agents run custom tool code or LLM-generated commands as well as known application code. Commands generated in response to whatever a session encounters are especially dynamic and untrusted. Then classify tenants by regulatory exposure, including HIPAA, SOC 2, and FedRAMP, and by noisy-neighbor sensitivity. Those pressures favor silo isolation, while cost and the number of tenants favor pooling, so classify each service on its own.

Choosing the right isolation pattern for each tenant tier before provisioning begins

Diagram: Execution Sandbox Options: Isolation vs. Overhead. Visualizes: Show three container/sandbox runtimes ranked by isolation strength alongside their key trade-offs and use cases.

Use the risk map to assign tenants to tiers. The AWS SaaS Lens defines three patterns, namely silo, pool, and bridge. Silo gives each tenant an independent infrastructure stack, or at minimum a separate database, while sharing identity, onboarding, and operations. It provides the strongest physical separation at the highest fleet cost and fits regulated tenants. Pool shares scalable infrastructure with query-layer tenant_id filtering, trading lower cost for greater noisy-neighbor risk in PII-free or low-risk workloads.

Bridge assigns pool to low-risk tenants and silo to high-risk tenants. Write down the pattern for each audited service and tenant tier before provisioning starts. Designing for bridge even when launching with pool avoids a costly later retrofit of scoping logic into retrieval paths. A tenant with its own agent runtime can still share the services that support it. The assignment must distinguish execution isolation from data, inference, and tool-access isolation.

Full replication has its own operational cost. Arceo & Narsing describe naïve full-silo replication of vector stores, inference endpoints, and tool configurations as creating operational fragmentation that amplifies common ML systems maintenance risks. Infrastructure then grows as more tenants join, even if usage stays the same. The same study shows that attribute-based access control, or ABAC, at retrieval eliminates cross-tenant leakage while adding approximately 19 milliseconds to the search path, with throughput scaling linearly and no gating bottleneck.

Choose the execution sandbox from the same risk classification. A standard runc container shares the host kernel and has near-zero overhead, but is insufficient for untrusted agent shells. gVisor uses userspace syscall interception with container-speed cold starts and moderate overhead, fitting trusted first-party code where accidental leakage is the concern. Kata Containers / Firecracker provide real, hypervisor-backed virtual machines with separate kernels, with Firecracker cold start under 150ms. Use that boundary when tenants supply custom tool code or a kernel-exploit escape must not reach a neighboring tenant workload.

Provisioning per-tenant machines and populating them before cutover

Parallel provisioning is what removes the maintenance window, so the shared system must keep serving traffic throughout this phase. Before provisioning, separate the agent lifecycle into ingress, orchestration, scheduling, state, and isolation services that can scale and deploy independently. A monolith bundling all five cannot be migrated tenant by tenant without a full rewrite.

Make provisioning reproducible and parameterized by tenant. Pulumi defines a stack as an isolated, independently configurable instance of a program. Using the same definition for each tenant and environment gives each deployment its own configuration and state, with changes shown as diffs that can be reviewed. This supplies both repeatable infrastructure and a change history that a security team can inspect.

Use a dedicated MachineDeployment for agent-sandbox nodes, tainted so only pods with an explicit toleration can schedule there. A mutating admission webhook should inject that toleration only into agent-sandbox pods. This makes placement a scheduling guarantee rather than a convention, leaving no neighboring tenant workload on those nodes for a kernel-level escape to reach.

Network boundaries must reinforce that physical separation. Apply default-deny policy between agent-sandbox and tenant workload namespaces, allowing only egress to the platform’s control-plane API. The agent talks to the control plane, which talks to the workload, rather than receiving a direct network path to the tenant’s container. Pair this with RBAC scoped to the agent’s service account. NetworkPolicy operates at L3/L4 and does not restrict access to cluster DNS or the Kubernetes API server.

Persistence also needs an explicit restore design. Firecracker snapshot-restore captures guest RAM, including kernel and process state, plus device/vCPU state, but excludes disk files, which must be managed separately. Restore latency for the API call alone is at or below ~10ms, while full end-to-end restore is typically around 25–50ms. That supports machines which sleep when idle and resume in under a second without a cold restart. However, repeated resumes can duplicate identifiers, random seeds, entropy state, and cryptographic tokens, so a post-restore guest-agent hook must reseed language runtimes and regenerate instance IDs.

Prepare activation before admitting the first request. Boot sandbox instances ahead of time and use the Warm → Active → Draining → Dead lifecycle so a machine is ready when it is activated. Load each tenant’s credentials, configure its tools, migrate its state, and smoke-test the result. No machine is eligible for traffic before those checks pass.

Shifting traffic tenant by tenant through a routing layer that supports rollback

Diagram: Per-Tenant Cutover Sequence. Visualizes: Illustrate the ordered steps for migrating a single tenant from shared backend to isolated machine without downtime.

The router becomes the migration’s control plane. It must resolve tenant identity before any agent logic runs and map the tenant to either the shared backend or its dedicated machine. Per-tenant feature flags or routing configuration entries make this switch a configuration-only change. That distinction lets the team reverse a cutover without waiting for a release cycle.

Start with pool tenants that have no active long-running sessions, leaving regulated or high-value tenants until the procedure has been exercised. For a tenant with an active session, wait until it reaches a natural checkpoint or completes. Switching mid-session creates a state-reconstruction problem that this migration is designed to avoid.

Set out the rollback steps before moving any tenant. If post-cutover checks fail, flip the tenant’s routing entry back to the shared backend and put its dedicated machine into Draining. Reverting the destination must not restart a live session. A reversible flag is useful only if session handling is reversible without interruption too.

Verify token attribution, trace completeness, tool-credential scoping, and retrieval isolation for the tenant just moved. Incorrect attribution, missing traces, wrongly scoped credentials, or cross-tenant retrieval should stop the sequence and trigger rollback rather than become work deferred until after migration. Move the next tenant only after those checks pass for the current one. Traffic reaching the new machine is not enough to establish a successful cutover.

Keep fallback capacity available throughout the rollback period. The shared backend can be progressively right-sized as tenants leave, but it must remain live and routable until every tenant has been verified on its isolated machine and each rollback window has closed. Only then is its fallback role finished. Cutting that role short turns a reversible routing change into a recovery problem.

Maintaining isolation correctness after every tenant is on their own machine

Isolation remains an operating responsibility after the final cutover. Every new tool, retrieval path, or agent capability expands the surface that must respect tenant boundaries. Keep traces, token usage, and spend scoped per tenant from day one of the new architecture. If a trace spans tenant boundaries, treat it as a defect.

Keep enforcement on the server side as capabilities grow. Arceo & Narsing’s layered architecture centralizes tool-execution authorization, state isolation, and policy enforcement at points that client-side frameworks cannot bypass. New tools must go through those same controls, with no client-side path around them. Apply retrieval gating at ingestion and query time to every new vector store and memory path. A dedicated machine does not prevent an ungated sub-agent from retrieving another customer’s data.

Restore hygiene needs continuing tests as well. Test the reseeding hook and instance-ID regeneration against every new language runtime or tool added to the environment. A dependency that initializes entropy at load time can silently cause identifiers to repeat after a restore. For regulated tenants with HIPAA or DPA requirements, keep machine configuration, network policy, and credential-scope changes auditable through reviewable diffs. The stack-per-tenant model supplies that history only when changes go through the IaC layer.

Treat per-second metered compute as the cost primitive, using machines that sleep when idle and wake in under a second instead of permanently provisioned containers waiting for human replies.

Sources

  1. Securing the Agent: Vendor-Neutral, Multitenant Enterprise Retrieval and Tool Use
  2. Securing the Agent: Vendor-Neutral, Multitenant Enterprise Retrieval and Tool Use

More in Per-User Agent Patterns