/storage_letter.

Copy-on-Write Disk Snapshots as the Missing Persistence Layer in Sandboxed Coding Agents

Disk snapshots let agent sandboxes keep their work, but not their processes.

Sponsored by Archil

Storage Letter Editors
· 8 min read
Cover illustration for “Copy-on-Write Disk Snapshots as the Missing Persistence Layer in Sandboxed Coding Agents”
Object Storage · November 26, 2026 · 8 min read · 1,873 words

Copy-on-write disk snapshots provide persistent storage for AI agent sandboxes that survives restarts without copying the whole workspace. They use durable object storage to keep installed packages, repositories, and working files even when compute stops. The missing layer is persistence, though disk snapshots alone do not preserve an agent’s running processes or in-memory state.

Why coding agents keep losing their work

An agent clones a repository, installs packages, starts a build, and produces intermediate files. Then its environment restarts and throws that work away. The next run has to clone and install again, using time and compute to rebuild an environment that was already there. The agent has become its own onboarding department.

That loop is a persistence failure. Each tool invocation depends on earlier work, yet an ephemeral environment treats the end of a session as permission to forget it. Once the workload includes a compiler, language server, browser, and build daemon, rebuilding the environment can outweigh the attraction of a minimal sandbox. What must survive is more than a source folder. It includes installed packages, working files, and enough saved task state to continue without rebuilding.

Ephemeral mounts still suit disposable, one-shot work. Long-running agent tasks do not always have a clean definition of “done,” and a hard timeout cannot supply one. A workspace that must resume needs a lifetime independent of the process using it.

What copy-on-write at the disk layer actually does

Copy-on-write, or CoW, separates a snapshot’s logical contents from the physical data it needs to duplicate. An overlay-based design, such as QCOW2, freezes the current layer and records later writes in a new overlay. Unchanged data stays shared between the layers. The snapshot is not a photocopy of the disk.

A 128 GiB guest disk can be represented by offsets and hashes, so creating a snapshot copies only metadata for those 128 GiB of data. Other sandboxes retain their unmodified view. A session that dirties only a few chunks therefore adds only a small fraction of the capacity the guest sees.

Durability requires somewhere for those changes to outlive the host. With local disk alone, the workspace is tied to one machine, but object storage can keep changes after the host is gone while local disk acts as cache. That separation lets idle sandboxes release CPU and memory without discarding their files. Memory can use a related sharing principle through private mappings and page-level CoW, but disk persistence and memory preservation remain separate capabilities.

What becomes possible once a disk can be snapshotted in milliseconds

Fast snapshots turn recovery mechanisms into ordinary workflow operations. Aegis OS measured CoW workspace provisioning at 0.71–6.28 ms on APFS CoW. That result applies specifically to the research system on which it was measured. It nevertheless shows why cloning a workspace need not mean waiting for a full copy.

The first capability is restart without rebuilding. A resumed sandbox finds its installed packages, cloned repositories, and intermediate files intact, allowing the agent to reload its working environment. Keeping a compiler running or saving an in-memory plan needs support for that state too.

Forking changes how attempts can be organized. Multiple instances can start from the same snapshot and explore different paths, sharing bases and paying storage costs for divergent writes. A failed branch can be abandoned, and rollback can return the workspace to its pre-branch state without reconstructing it. LangSmith’s Blueprints apply the same principle to pre-warmed environments, doing expensive setup once before new sandboxes fork from the prepared image.

The write-amplification and rename-semantics problems CoW does not eliminate

Write-heavy workloads, including large builds and frequent package installs, can cause write amplification and fragmentation in btrfs over time. Golden images can absorb much of the setup work, and short-lived sandboxes limit the time fragmentation has to accumulate. A workspace that runs for weeks has a different maintenance problem. “Instant clone” is not a lifetime exemption from housekeeping.

File operations can also expose expensive semantics. OverlayFS directory renames can trigger full subtree copies, which is awkward for agents reorganizing a codebase. Turso’s AgentFS has a database-backed delta layer that uses file-level CoW for ordinary writes, but directory renames still cause full subtree copy-up into that layer. The operation that looks simple in a shell may move much more data underneath.

Each sandbox still has the same memory overhead even when it uses less storage. With thousands of idle sandboxes, that overhead can be the biggest cost of the fleet even when they share disk bases. Pausing compute addresses a different cost term from deduplicating storage. These limits make the execution boundary and filesystem implementation part of the persistence decision.

How the isolation layer determines what CoW semantics are available

Diagram: Four Isolation Layers and Their CoW Semantics. Visualizes: Show a ranked/stepped comparison of four sandbox isolation models — Containers (OverlayFS, lowest overhead, host kernel shared), gVisor (user-space Sentry kernel, syscall-overhead…

Containers send system calls through the host kernel and can use CoW through OverlayFS, with its limits on renames. Hardened containers are a fit for code the operator controls. They offer low overhead, but storage layering does not create a separate guest kernel. A cheap snapshot is not a stronger security boundary.

gVisor inserts its user-space kernel, Sentry, between the workload and host system calls. That interception adds overhead for syscall-heavy workloads and can introduce compatibility limits. It fits compute-heavy untrusted code where KVM is unavailable. Firecracker microVMs instead give each workload a separate guest kernel behind a hardware-virtualization boundary, at higher per-sandbox memory cost. Their vsock device lets the host expose only the communication channels it chooses, making microVMs a fit for mutually distrustful tenants.

Even that stronger boundary needs upkeep and other controls alongside it. AWS’s security bulletin describes CVE-2026-5747 as an out-of-bounds write in Firecracker’s virtio PCI transport that might allow a privileged guest user to execute code on the host. The bulletin distinguishes CVE-2026-1386 as a host-local symlink overwrite in the jailer. These failures work in different ways and give no reason to treat every isolation model as the same. An isolation boundary or a disk snapshot alone cannot set which credentials an agent may use or where it may send data.

Default-deny egress and credential brokering as the third enforcement layer

Network and credential controls address permissions that isolation does not remove. If another tenant’s credentials are inside an execution environment, agent-generated code may read them even with the environment’s outer boundary in place. Keeping a secret inside a locked room does little good when the code is already in the room.

Tracekit Box’s architecture keeps only a placeholder inside the VM. A host proxy inserts the real credential into one header for exact allowlisted hosts, blocks the placeholder or value elsewhere in traffic it reads, and redacts the value from responses. Anthropic’s sandbox-runtime similarly filters outbound traffic through a domain-based proxy, with access denied until explicitly allowed. Credential brokering and default-deny egress constrain different parts of the same journey.

The “Week of Sandbox Escapes” disclosures illustrate another gap. All seven disclosed escapes stayed inside the sandbox while writing hooks or configuration that an unsandboxed tool consumed after the agent’s turn ended. The recommended posture is therefore explicit credentials with governance attached, granted independently of developer entitlements. AWS documents this approach through Lambda MicroVMs, the Agent Toolkit for AWS, and Policy in Amazon Bedrock AgentCore, combining execution with granular governance.

Giving agents file access to large datasets without copying them

Persistent workspaces solve the problem of keeping what agents write. Large external datasets need to be available without copying them into every workspace. Object storage already keeps data durable and is built for throughput. Copying terabytes before each run, however, gives back much of what CoW saved.

Amazon S3 Files, announced in April 2026, exposes bucket data through a filesystem without requiring a separate storage layer. On access, file metadata and small-file content below a configurable threshold, typically 128 KB, enter a high-performance cache built on EFS. Larger files stream directly from S3 instead. Bedrock AgentCore’s direct S3 FUSE mounts likewise give sessions access to external datasets without bulk copying or static credentials in the runtime filesystem.

Object storage is optimized for throughput and durability rather than low latency on every operation, so repeated small reads and writes can be inefficient even with S3 Express One Zone. Mountpoint for Amazon S3 has an S3-only, FUSE-based route, while managed POSIX layers can bring the same approach to other providers. For shared inputs, many sandboxes can use one read-only disk while each keeps its own writable disk.

Per-tenant storage isolation at thousands of sandboxes

Tenant isolation starts with correctness. The default pattern is one disk per user or workspace, provisioned programmatically with no shared tenant state. Recovery then has a clear boundary, because one broken workspace has no path into another tenant’s data. Separate directory names do not provide that guarantee. If agents can reach each other’s mounted paths, the application’s partitioning has failed at the storage boundary.

Disk tokens or IAM conditions scoped to a disk or matching tenant account identifier enforce access below the application. Sandboxes can still get common inputs from a shared read-only disk while each mounts its tenant’s writable disk. CoW keeps what tenants write from changing the shared base. Shared data saves capacity only when sharing does not grant unintended access.

An S3-based alternative gives each tenant a prefix and short-lived credentials scoped to it. That is a valid isolation approach, but it requires ETL when the agent needs POSIX semantics. The choice is therefore not simply between “persistent” and “ephemeral.” It also selects the interface the agent can use and the work needed to make stored data usable.

Choosing a sandbox platform: what the architecture decisions actually select for

Diagram: Platform Architecture Decisions at a Glance. Visualizes: Show four named platforms mapped against four concrete architecture dimensions: Isolation model, Preserved state, Network authority, and Storage placement.

A platform comparison begins with four decisions, including isolation, preserved state, network authority, and storage placement. Filesystem persistence suits an agent that can reload its environment, while resuming running processes needs memory and process preservation too. Forkable snapshots serve a different purpose again, making parallel attempts inexpensive. Default-deny egress and credential brokering remain baseline controls regardless of that choice. Local-only volumes tie compute to the data’s host, while object-storage-backed POSIX storage and customer-owned buckets let compute move independently of data.

Archil is a durable, object-storage-backed disk for agents that uses chunk metadata rather than full copies, charges a fork only for divergent writes, and provides a persistent, shared, bash-accessible workspace mountable from many machines. It fits long-running agents, multi-tenant products, speculative parallel runs, and teams connecting existing S3, GCS, R2, Azure Blob, or S3-compatible buckets without migration, with writes durable once fsync returns and copied to the bucket in the background.

LangSmith Sandboxes combine hardware-virtualized microVMs with snapshots, CoW forks, Blueprints, an Auth Proxy, Service URLs, and a CLI. The scope extends beyond storage into agent execution. Its best fit is teams already in the LangChain ecosystem that want those execution features together.

Vercel Sandbox saves filesystem state when a persistent sandbox stops and restores it on resume. The preservation claim is limited to filesystem continuity. Its best fit is teams already using Vercel’s frontend and serverless platform.

Baseten Sandboxes preserve files, memory, and running processes between tasks in isolated microVM environments. Its planned Agent Drive would add a distributed remote filesystem shared across sandboxes, optimized for high write volumes and small files such as code and Markdown. Its best fit is teams building on Baseten’s model-serving infrastructure that need the broader preserved execution state.

This article is sponsored by Archil.

Sources

  1. Fork, Explore, Commit: OS Primitives for Agentic Exploration
  2. AI Code Sandboxes: A Comparative Security Study. Part 1 of 2 -- Engine-Level Properties (Attack Surface, Leakage, Stackability, CVE History, Patch Cadence, Fuzzing)
Filed underObject Storage

More in Object Storage