Running Parallel Agent Sessions on a Single Self-Hosted Host
Isolate each agent session in its own micro-VM to run them safely in parallel.

To run parallel agent sessions on one self-hosted host, isolation has to come before scheduling. Persistent AI agent infrastructure preserves each session’s files, credentials, and memory between turns, while stateless serverless functions require that continuity to be supplied elsewhere. Per-session boundaries prevent conflicts, and snapshot-restore scheduling preserves state without keeping every idle session running.
Why parallelism on a single host is an isolation problem first
Two agents in separate tmux sessions still edit the same files when they use one checkout. Their terminals are separate, but their working state is not, so one task can trample another before the host runs short of compute. Those in-memory sessions also die on reboot, and sharing access means sharing SSH access. The first constraint is therefore whether tasks can coexist.
A coding-agent setup has three distinct layers, namely the model, the harness and orchestration, and the execution environment. The model may use a hosted API or local inference, while the harness manages sessions and tools. Self-hosting means owning the execution environment, where the filesystem, shell, and credentials live, even when inference remains a hosted service. That distinction matters because execution is where file collisions and credential exposure occur. Giving each agent its own git worktree and branch addresses the first problem, but it leaves the process and kernel boundaries unresolved.
What breaks when sessions share a kernel and a filesystem
Worktree isolation separates repository files. Agents running as sibling processes can observe each other’s process trees, signal other processes, and contend for file locks outside their worktrees when the host’s permissions allow it. A useful agent also holds real secrets, including GitHub tokens, database URLs, and cloud credentials. If other sessions in the shared execution environment can reach those secrets, a compromised or runaway session can read another session’s credentials. A separate checkout does not contain that credential surface.
The kernel creates another shared failure domain. A kernel exploit or host-level OOM event can affect sessions that never touch the same repository, because worktrees put no hardware boundary between them. Agents make this distinction consequential by installing packages, running arbitrary commands, and opening network connections. Filesystem isolation separates working files, process isolation uses namespaces to separate process visibility, and kernel isolation gives sessions separate kernels. Maritime addresses the deeper boundary by placing each agent inside its own Firecracker micro-VM, rather than treating a worktree as protection against faults in a shared guest kernel.

How the tooling ecosystem handles session isolation today
The practical tooling layer has converged on worktree-per-session execution and multiplexed supervision. These patterns make it easier to check on parallel tasks while keeping their repository changes apart. Tools such as agent-of-empires and Prowl add phone or web access to shared-host sessions, extending visibility without moving the isolation boundary. Rove provides sessions that outlive the terminal and a local Kanban view. These are useful session-management capabilities, but they do not by themselves establish separate kernels.
The structural distinction is between supervising work and containing it. A tool can show which agent is active, preserve access after an SSH connection drops, or allocate a dedicated worktree while still inheriting the host’s process and credential model. Per-session micro-VM isolation, including Maritime’s snapshot-restore model, takes that security work out of the supervision layer. Orchestration can then focus on monitoring and scheduling rather than also trying to contain arbitrary execution. Without that separation, the practical ceiling is the number of sessions a person can supervise and a shared kernel can safely contain.
Why micro-VM isolation changes the ceiling for parallel sessions
Firecracker uses Linux KVM to run in user space and gives each guest its own kernel. A fault or exploit confined to that guest kernel is separated from the host and peer guests by a hardware boundary. This closes the gap that filesystem worktrees leave open, because the session no longer shares its execution kernel with other agents. The isolation primitive changes from a directory boundary to a machine boundary. That makes package installation and arbitrary shell execution tractable without placing every session inside the same guest failure domain.
The economics differ from the assumption that every session needs a conventional, heavyweight VM. Firecracker can fit micro-VMs at the same order-of-magnitude density as Docker containers, with slightly fewer instances for minimal workloads and a gap that grows at larger workload sizes. With much the same cost per instance, kernel isolation is within reach without the cost of a conventional full-VM. Active guest memory and workload size still matter.
Local inference adds a device-access constraint. gVisor’s user-space kernel intercepts GPU calls at a point that blocks direct PCIe passthrough, while Firecracker omits a PCI bus and does not support VFIO device passthrough. GPU or other PCIe access therefore requires a different VMM, such as Cloud Hypervisor or QEMU/KVM. The appropriate primitive depends on whether the session itself needs that device access. Within its micro-VM boundary, the agent gains its own filesystem, kernel, package installation privileges, browser sessions, and credential store.
Snapshot-restore scheduling as the mechanism that controls idle cost
Per-session VM cost becomes prohibitive only if every session must remain live between bursts of work. Most agent sessions spend much of their time idle, so reserving compute throughout those gaps ties capacity to waiting. Snapshot-restore scheduling changes that relationship by parking the session’s state on storage. The snapshot preserves its filesystem, credentials, in-progress work, and memory state. Persistence therefore does not require continuous execution.
In Maritime’s scheduling model, idle agents sleep to snapshots and wake in about a second, shifting the underlying idle cost from compute to storage. That permits hundreds of retained sessions on a host without implying that all of them can execute simultaneously. The distinction between retained sessions and running sessions is central to capacity planning. A fleet can be large because most sessions are asleep, while its active working set remains bounded by available resources.
This is the decisive comparison with stateless serverless functions for long-running agents. A function that handles one turn does not itself keep a persistent session filesystem, credentials from an earlier run, or memory of unfinished work. Low idle cost comes from releasing the execution state, so continuity must be managed outside the function. Snapshot-scheduled infrastructure keeps the whole session between turns. Bursty interactive workloads fit that model, while steady high-volume workloads with stable request rates fit always-on provisioned compute.

Where KV cache and VRAM budget become the real scaling limits
In multi-session deployments on bare-metal GPUs, KV cache capacity can limit parallel sessions before CPU saturation or raw GPU utilization does. This constraint applies to locally served models. Session count therefore cannot be inferred from GPU throughput alone. The context retained for each active conversation is part of the capacity calculation.
Agents put extra pressure on that budget because turn after turn repeats system instructions, tool schemas, and policy text. Prompt caching lets a previously processed prefix be reused. Without that reuse, the same context puts more pressure on the cache across turns and sessions. Keeping system prompts and tool schemas stable for cache hits is therefore a key way to make room for sessions as well as to improve latency. Context length and cache hit rate help set how much room each new session needs.
Spheron’s 2026 GPU sizing guide describes a production agent stack with five layers, only two of which need a GPU, namely the LLM inference backend and the embedding model. Workflow orchestrators such as LangGraph and CrewAI run on CPU. Planning therefore starts with per-session KV cache and then accounts for model weights and embeddings in VRAM. Host memory must separately cover the guests and their micro-VM overhead. These budgets constrain the same deployment, but treating them as one pool obscures which resource actually limits parallel execution.
Orchestration patterns that enforce tenant boundaries across parallel sessions
Separate kernels do not prevent a shared database from returning another tenant’s records. Compute isolation must therefore go hand in hand with boundaries around durable memory, credentials, and stored state. The three common tenant architectures make that trade-off explicit. A siloed deployment gives each tenant its own VM, vector database, and storage, providing the strongest separation at the highest per-session cost. A logical/shared deployment uses tenant_id filtering across shared resources, reducing cost while widening the blast radius of a filtering failure.
The hybrid/namespace-isolated pattern shares infrastructure but separates data through boundaries such as vector-store namespaces and filesystem workspaces. It is the common production middle ground when dedicated infrastructure for every tenant is unnecessary but undifferentiated sharing is unacceptable. AWS Bedrock AgentCore illustrates this pattern with session-isolated micro-VM compute and a separate filesystem for intermediate computation artifacts. Its optional persistent session storage must be explicitly configured.
Persistence also has to match the execution model. A persistent-session, worktree-isolated setup gives each task a long-lived process, while LangGraph supports cyclic execution and state checkpoints in PostgreSQL for multi-turn resume and time-travel debugging. Snapshot-scheduled sessions instead checkpoint execution to disk and restore it on demand. Durable memory rows should have a tenant_id protected by row-level security, and regulated workloads should have separate vector indexes for each tenant.
The Model Context Protocol’s July 28, 2026 spec revision removed protocol-level sessions and the initialize handshake. Each request has everything it needs, so it can go to any server instance behind a plain round-robin load balancer without sticky sessions. Stateless tool transport therefore does not require stateless agent execution. The set of tools still needs to be kept in check because tool definitions take up context in every parallel session. A single MCP server should offer 3–10 tools, and larger sets should be split across servers and use progressive discovery to limit how much context the tools take up in each session.
What the isolation architecture implies for how many sessions you can run and at what cost
Firecracker’s per-instance overhead is under 5 MiB, but that figure is not the total memory required by an active agent. For local inference, the useful sizing starting point is KV cache per active session, determined by context length and prompt-cache reuse. Model weights, embeddings, and host memory requirements then complete the resource picture. Retained sleeping sessions belong in a separate storage calculation from concurrently running sessions.
The financial calculation also separates execution ownership from inference ownership. At low session volume, fixed GPU costs can make local inference more expensive than pay-per-token APIs, while high steady-state volume can favor self-hosting on unit economics. Snapshot scheduling cuts the cost of idle execution and changes the break-even point for bursty sessions. It does not erase the fixed cost of a GPU or make sleeping capacity equivalent to active capacity. Maritime combines flat-rate per-agent pricing, Firecracker isolation, persistent disks, and snapshot-and-restore scheduling as one deployable expression of this architecture.
The choice starts with how wide a fault’s blast radius can safely be. Worktrees address filesystem separation, while micro-VMs address the need for separate kernels. Scheduling then follows demand, with always-on compute for steady request rates and snapshot scheduling for bursty sessions. Local-inference capacity is planned from KV cache outward.


