Persistent Disk Access in Firecracker vs Docker for Agent Filesystems

Persistent disk access in Firecracker versus Docker is a question of both isolation and continuity. Docker volumes preserve files, but they do not provide a separate kernel or restore a stopped agent’s execution context. For long-lived agents that run attacker-influenceable code, persistent AI agent infrastructure needs a hardware isolation boundary and snapshot-based continuity beyond what a serverless function with storage attached can provide.
Why Docker's shared-kernel model is structurally insufficient for agent filesystems
Docker containers are processes sharing the host’s Linux kernel. Namespaces give those processes separate views of system resources, cgroups control resource use, and union filesystems such as OverlayFS provide filesystem layers. These mechanisms separate workloads through software policies enforced by the same kernel that every container calls. A volume changes where files live, but it does not change that boundary.
The distinction matters when tenants run code that cannot be trusted. A vulnerability in the shared kernel can compromise the boundary for every tenant on the machine. Containers still work well for many workloads. It is a specific objection to treating shared-kernel isolation as sufficient protection for autonomous code execution.
Agents aggravate that problem because their code is stochastic. The same prompt can produce different code on different runs, so reviewing one result provides no guarantee about the next execution. An agent may also have ambient access to environment variables and credentials it does not need. When attacker-influenceable instructions meet those permissions, the filesystem becomes more than a workspace. It becomes a security surface that needs more protection than the kernel shared with other tenants can provide on its own.
What Firecracker actually is and how virtio-block works as a disk
Firecracker is a virtual machine monitor, or VMM, implemented as a user-space process that drives KVM. It removes legacy hardware emulation, retaining a KVM interface, a serial console, and a small set of virtio devices. Each Firecracker process runs exactly one microVM, so multiple tenants do not share that process. Within that process, an API thread receives requests through a Unix socket, a VMM thread handles device emulation, and one vCPU thread per guest CPU runs a KVM loop. The guest has its own kernel.
The disk interface is virtio-block. The guest writes sector requests into a virtqueue, which is a ring buffer in shared memory. The VMM translates those requests into plain pread/pwrite operations against a host file. There is no IDE controller, BIOS, or legacy disk-emulation stack in that path. Firecracker’s API can attach one or more read-write or read-only disks, each backed by a separate file.
That host file is a block device from the guest’s perspective. The distinction is the route by which the agent reaches storage. A separate virtio-vsock channel lets logs, health pings, and snapshot metadata pass between guest and host using a context-id and port. The CPU’s hardware virtualization boundary keeps guest execution apart from the host, so one kernel does not have to police both sides.
How the hardware isolation boundary changes what an agent filesystem can do
A dedicated guest kernel changes the consequence of a kernel-level exploit. In Docker, the kernel reached by container code is already the host kernel. In Firecracker, compromising the guest kernel does not by itself compromise the host kernel, because they are separate kernels with the VMM between them. Restrictions around the VMM further limit host filesystem access, networking beyond the configured TAP device, and privileged host syscalls. Hardware isolation removes the direct shared-kernel route.
For an agent, that separation creates a bounded place to install packages, run build tools, write credentials, and accumulate intermediate outputs. The agent can break its own environment without sharing that guest kernel with neighboring tenants. This is why platforms such as Maritime deploy agents inside separate Firecracker micro-VMs. Their filesystem isolation rests on a hardware boundary.
The guarantee still needs a precise scope. A host-backed disk is not storage made unreadable to the host itself, and hardware isolation is not a claim that credentials cannot leave through permitted communication channels. It separates the agent’s execution environment and filesystem access from other tenants and from direct access to the host kernel. The disk’s capacity is also the size of its backing image rather than the guest’s RAM, allowing substantially more space than an in-memory filesystem. gVisor offers a different boundary through user-space kernel interception, but Firecracker’s dedicated kernel also supports the whole-machine continuity that persistent agents need.
Why persistent state across agent turns requires the snapshot-restore model
A multi-turn agent session is not a sequence of independent requests. An agent working on a Python project installs packages, writes files, and accumulates intermediate outputs that later turns depend on. Files are only part of that environment, because running processes and their memory also carry context. A persistent volume can keep the project but leave that execution context behind. This is the central limitation of treating a stateful agent as a stateless function with an attached disk.
Firecracker’s snapshot-restore model preserves a paused machine’s memory and execution state, with its disk state retained as part of the persistent environment. On resume, the guest continues from the point where it stopped. Memory restoration uses copy-on-write semantics, mapping the memory file with MAP_PRIVATE. The restoration cost therefore follows the working set touched after resume. This applies the mechanism that makes Unix fork() cheap to an entire VM’s RAM.
The economic consequence matters as much as continuity. A paused snapshot is not a running VM, so compute billing can stop while the snapshot artifact remains on disk. Storage still costs something, but idle agents do not have to use running compute between turns. Ordinary Docker stop-and-restart with persistent volumes keeps files but does not restore kernel state, process state, or mid-execution context.
AWS Lambda MicroVMs launched in general availability on June 22, 2026 with a “pause to low idle cost” feature built on Firecracker snapshots. Each MicroVM retains memory and disk state for the session and pauses when the user steps away.
How production deployments implement per-session agent filesystem isolation
Production architectures increasingly make the session or tenant the unit of isolation. AWS published a multi-tenant reference architecture on Lambda MicroVMs with one Firecracker VM per tenant, snapshot resume, automatic lifecycle management, and near-zero idle compute cost. Its persistent state uses per-tenant subdirectories on an encrypted EFS filesystem. This shows that a VM execution boundary and a storage-retention design are separate choices. Dedicated execution does not require every deployment to use only a local disk image.
AWS Bedrock AgentCore applies a stricter session boundary. Each Code Interpreter or Browser session receives a dedicated Firecracker microVM, with no execution state, filesystem artifacts, or memory contents persisting between sessions. That clean-room policy is intentional. It demonstrates the distinction between preserving a session while it is active and retaining its environment for future sessions. A persistent personal agent and a disposable code-execution session require different lifecycle rules even when they use the same isolation primitive.
The kubernetes-sigs/agent-sandbox controller, a Kubernetes SIG Apps subproject, decouples workload lifecycle management from isolation and supports gVisor or Kata Containers without designating a preferred runtime. The firecracker-agentfs project instead explores filesystem change tracking through a database-backed overlay served over NFSv3 as the guest rootfs. Its host keeps a read-only base image while the agent’s changes go into the overlay, so those file changes can be audited for debugging and compliance. The convergence is around explicitly scoped execution, storage, and lifecycle boundaries.
Where Maritime fits in the per-user agent VM model
Maritime implements the per-user-agent model with a separate Firecracker micro-VM on bare metal, a dedicated kernel, and a persistent disk. An agent can install packages, run browsers, and keep its working environment across sessions. Credentials, intermediate outputs, and installed packages belong to that agent’s isolated environment. The relevant guarantee is separation between tenants and between guest execution and the host kernel. As with other host-backed VM disks, that does not mean the underlying storage is inaccessible to its host operator.
The snapshot-and-restore scheduler that Maritime publishes research on addresses the gap between persistent ownership and intermittent activity. Most agents are idle most of the time, so keeping every agent continuously running would charge for compute that its user is not using. Pausing changes that cost structure by retaining storage without retaining active compute. Its flat per-agent pricing model reflects that choice. The aim is to bring costs close to those of stored state, below the cost of a VM that runs all the time.
For developers, the platform boundary also changes where operational work lives. Maritime turns code into a live API endpoint with a single push, while the platform takes care of provisioning, snapshotting, and scheduling. The platform manages the relationship between each agent, its retained environment, and the scheduler that suspends and restores it.
The honest tradeoffs: where Firecracker's disk model costs something and when that matters
Firecracker’s isolation and continuity come with overhead. A separate guest kernel and a block-device boundary are not equivalent in cost to processes sharing a host kernel. gVisor’s density advantage is therefore a real consideration for workloads that do not need a complete persistent machine. The case for Firecracker should not depend on pretending that stronger isolation has no resource cost. It depends on whether that cost buys a boundary and a lifecycle the application actually needs.
Latency is another constraint. Firecracker reaches guest userspace running init in roughly 125ms from VMM launch, and cold starts before a snapshot exists remain in the 100ms range. For synchronous tool calls where the user expects sub-two-second responses, that time is noticeable. Snapshot restore changes the path for an existing environment, but it does not remove the initial cold-start case.
For long-lived, stateful, multi-turn sessions executing attacker-influenceable code, the dedicated kernel and snapshot model are the right tradeoff. The agent needs both a bounded place to operate and continuity when the user returns. For partially trusted, short-lived compute inside an existing session, gVisor or containers remain defensible choices. Persisting files alone does not automatically require a microVM, just as choosing a microVM does not by itself define a retention policy.
If later turns need only saved files, durable storage may keep all they need without whole-machine restoration. If they need running processes, memory, and an intact environment across idle periods, snapshot-based persistent infrastructure addresses a different requirement from stateless function execution. If the code is also attacker-influenceable and runs beside other tenants, the hardware boundary becomes decisive. Choose the isolation and lifecycle together, based on what the agent may execute and exactly what must survive its next pause.


