SubscribeSign In
Agent to Product

Per-User Memory and Tool Isolation Without Deployment-per-User Complexity

Shared infrastructure can isolate per-user memory and execution without separate deployments.

· 9 min read
Cover illustration for “Per-User Memory and Tool Isolation Without Deployment-per-User Complexity”
API-First Provisioning · November 3, 2026 · 9 min read · 1,936 words

Per-user memory and tool isolation does not require a separate deployment for every customer. The practical architecture is a shared runtime with scoped memory stores, execution sandboxes, and user-bound tool credentials. A single provisioning API call is useful only if it establishes those boundaries behind the scenes.

Why per-user agent isolation is harder than it looks in production

Inference is stateless, but users expect continuity. They expect an agent to remember preferences, earlier decisions, and unfinished work when a new conversation begins. Without persistent per-user memory, the application has to reconstruct that context or start again. The framework cannot remove this mismatch by itself. The operator has to decide where durable state lives and how each user’s agent can access it.

The failure is not always obvious forgetting. Context compaction can keep a summary that reads well while losing the links that made earlier decisions make sense. Silent memory failure is worse because the agent keeps answering while its access to useful history degrades. These are infrastructure failures with conversational symptoms. An architecture that treats memory as optional leaves the user’s experience dependent on state that may disappear without an alert.

Why deployment-per-user fails before it scales

A separate stack gives each customer an obvious boundary, but it also makes every new customer an infrastructure event. Each instance needs provisioning, security controls, monitoring, updates, and recovery. The work multiplies before scale arrives. Costs grow too, but the greater risk comes from having more to secure and more compliance checks to run across separate deployments.

Operators still have to do that work when they use agent frameworks. OpenClaw describes its multi-tenancy stance as “a gateway is one trust domain,” so operators must add sandboxing and memory scoping. Hermes scopes memory per profile, with one agent per Hermes home. Neither setup has deployment-per-user isolation built in. A profile or gateway boundary is not a substitute for the isolation architecture around it.

A user gets private persistent state and isolated execution without needing a separate application stack of their own for good. Scoped memory governs what the agent can retrieve, while sandboxing governs where it can execute.

How scoped memory stores enforce per-user isolation at the data layer

Every stored fact needs an explicit scope. A user_id identifies memories belonging to one user across sessions, while an agent_id identifies memories belonging to an agent instance. A run_id or session_id limits state to one conversation. An app_id or org_id identifies shared organizational context. These identifiers distinguish personal history from session state and shared knowledge rather than treating everything as one growing transcript.

Where that scope is enforced determines how strong the boundary is. A shared index with a tenant filter provides logical separation, but one missing query predicate can expose another tenant’s vectors. Storage-level separation uses a tenant’s database, schema, or vector namespace to restrict what retrieval can see. When the storage context has the right boundary, callers do not each have to remember the same filter.

Production systems can mix these approaches. Smaller customers may use logical scoping, mid-market accounts may get their own dedicated databases, and the largest regulated accounts may need separate deployments. That exception makes the storage boundary a deliberate choice independent of how the application was packaged.

Scope also applies to different kinds of memory. Episodic memory keeps a record of earlier conversations, semantic memory stores facts, and procedural memory stores ways to do tasks. User context includes identity, preferences, long-term facts, and short-lived information, so a running log alone cannot support selective recall. Graph-native memory adds relationships between facts. Flat vector retrieval finds similar chunks, while graph-vector retrieval can follow the connection between a signed contract and what the client later said about the budget.

Where cross-tenant memory leakage actually originates

The primary record store is not the only boundary. A shared embeddings index can leak data when a similarity query omits the tenant filter. A shared knowledge graph can merge unrelated people because both tenants have an employee called “Alex Chen.” In that case, the mistake happens during entity resolution, before the recall endpoint that serves the user runs. Testing only that endpoint misses how the wrong data got into its results.

Background work creates another route across tenants. Summarization, reindexing, and graph enrichment may run with elevated credentials over records from many customers. If the job writes results without putting the tenant scope back in place, it can weaken retrieval controls that otherwise work as intended. Logs and traces create a separate exposure when raw prompts or recalled memories become broadly available for debugging. Isolation has to follow the data beyond the conversation.

Erasure makes this an operational requirement as well. GDPR requires per-user deletion, including the derived memory structures associated with that user. Modeling an end user as a nested dataset, such as tenant_acme__user_42, allows a deletion call to target that user’s memories, graph nodes, and embeddings without deleting the tenant’s remaining data. A breach between users is not a configuration quirk, and deletion cannot depend on reconstructing ownership afterward.

How execution sandboxing closes the gap that memory scoping alone cannot

Memory scoping restricts data access through the memory system. It does not, by itself, restrict what executing code can reach through the host. An agent workload that escapes its execution boundary can bypass carefully scoped retrieval. The two controls protect different surfaces. Private storage does not compensate for an execution environment that exposes neighboring tenants.

Docker containers share the host kernel, which limits their strength as a boundary for untrusted multi-tenant workloads. Firecracker microVMs provide stronger isolation for workloads involving regulated data. V8 Isolates target latency-critical, lightweight tasks but support only one programming language. The choice therefore depends on both the required boundary and the workload.

Stanley et al.’s GAAP research shows another way to protect the execution layer alongside these boundaries. Developed by researchers at UCLA and Google, it tracks information flow deterministically and blocks tool calls that would disclose private data to untrusted parties without prior user authorization. It blocked all documented data-disclosure attacks with only a small impact on agent utility. This is research evidence. Its structured MCP tool analysis also shows why container boundaries are insufficient for disclosure control, since writing to cloud storage exposes data to the provider, while email exposes it to both provider and recipient.

The warm-pool pattern: achieving per-user session affinity without per-user infrastructure

Shared execution does not require a cold start for every request. A warm pool keeps pre-booted idle sandbox pods available, acquires one when a session begins, and dispatches the session to it. The pod is released when the session ends. This avoids making the user wait for a fresh environment to boot on every turn. The pool shares infrastructure capacity without making private session state a shared resource.

Session affinity supplies continuity within the conversation. Later messages go to the same pod, which keeps intermediate files, execution state, and large responses across turns. Kubernetes labels can track pod state and session affinity without each user needing a deployment that stays in place for good. Persistent memory keeps the context that needs to last beyond that conversation.

Per-user tool isolation: why OAuth and connected accounts are an isolation problem, not just an auth problem

An agent can retrieve the right memory and still act as the wrong person. Sending email, pushing to GitHub, or posting to Slack through another user’s account crosses the same privacy boundary as recalling another user’s data. Authentication alone does not settle the question. The tool call must be bound to the identity whose task the agent is performing, rather than merely using any credential that happens to work.

That binding becomes harder as integrations accumulate. OAuth flows, token refresh, rate limits, retries, error handling, and API changes must be managed separately for each user. Static tool definitions take up context before the task even starts. Loading hundreds of definitions competes with the information the agent needs to perform the work. With relevant tool discovery, every available integration no longer needs to stay in the prompt.

Composio provides a concrete mechanism through managed authentication and per-user “connected accounts.” It stores OAuth credentials so agents can act for the correct user without operators handling individual tokens. Sessions bind tasks to users, connected accounts, authentication, and execution state, while agents discover relevant tools at runtime. Its integrations include Gmail, GitHub, Slack, and Salesforce, and its managed cloud service holds SOC 2 and ISO 27001:2022 certifications. Managed credential scoping complements memory and execution isolation.

What memory reliability engineering looks like when agents run for months, not minutes

Helwig’s SIx Harness study examines reliability engineering for the memory subsystem. Its August 2026 record describes ongoing development under Claude Code since January 2026 on a 633,000-line codebase, with memory instrumented throughout the period since July 2026. The authors describe it, to their knowledge, as the first months-scale instrumented operational record of a persistent agent-memory subsystem in production development use at this scale. Answers that help today do not prove that memory will still work well months from now.

The study’s seven design principles deal with four failure modes. These are knowledge loss from compaction, repeated work from insufficient anti-recurrence stores, context degradation from excessive injection, and silent memory death. More recall is not automatically better recall. Irrelevant injected blocks measurably degraded model output, so the subsystem needed to control both missing context and unwanted context. Silent failure could hide either problem while the agent kept working.

The harness combines fully local hybrid BM25 (FTS5) and vector retrieval over SQLite (sqlite-vec), allowing either retrieval path to serve a query. Precision-gated injection controls what goes into context, while anti-recurrence stores keep a record of decisions and dead ends. A session-start health gate distinguishes failure modes, and heartbeat telemetry is designed to leave no enumerated failure unrecorded. Alert-fatigue budgeting keeps the noise from making monitoring hard to use. Across tens of thousands of hook invocations, none of the handful of recorded failures was silent, and nearly all occurred in the first three weeks.

For multi-tenant operators, the lesson is to treat memory health as shared infrastructure health. A degraded subsystem can affect every user whose sessions depend on it, even when their records remain properly isolated. Health gates, telemetry, and alert budgeting address that operational risk.

How do you give every customer an isolated agent without complex infrastructure setup?

The deployable unit is an isolated, persistent agent context provisioned automatically at onboarding. From first login, the customer receives private memory scoped at the storage layer, sandboxed execution, and tool access bound to their connected accounts. Memory health controls support that context over time. This is what the provisioning interface must establish. Calling it a “single API call” describes the interface.

For an operator choosing that interface, the criteria follow directly from the architecture. Provisioning must set up customer scope without anyone doing it by hand, storage must enforce the boundary, and execution must stay separate from neighboring workloads. Tool calls must use the customer’s connected accounts. Warm execution capacity cuts the wait for a response, while health-gated memory helps keep context working over time. These criteria distinguish a private agent environment from an account record attached to an otherwise shared agent.

The same model supports white-label delivery. An operator can activate a private, persistent, branded agent at onboarding without making each customer a custom infrastructure project. A payment processor works much the same way, letting software companies accept payments without becoming payments companies. Agent delivery needs a similar separation of responsibilities. The operator builds and sells the agent, with provisioning, monitoring, and recovery of a separate instance for every signup handled separately.

Sources

  1. Memory as Infrastructure: Reliability Engineering for Persistent Agent Memory in Months-Long LLM-Assisted Development
  2. An AI Agent Execution Environment to Safeguard User Data
  3. Always-OnAgents:A Survey of Persistent Memory, State, and Governance in LLMAgents

More in API-First Provisioning