Package Installation and Runtime Customization in Agent VMs
Isolated kernels let agents install packages safely without threatening the host.

Persistent AI agent infrastructure preserves an agent’s working environment, while ephemeral serverless execution rebuilds it for each run. For package installation and runtime customization, an isolated guest kernel provides system-level freedom, while snapshot-restore preserves that environment without idle compute charges. The architectural requirement is both persistence and isolation, with network controls enforced outside the agent’s reach.
Why agent VMs need a real kernel, not a shared runtime
An agent that installs a package, runs a shell command, or calls a tool is executing untrusted output from a probabilistic text generator. Its execution environment must treat that output accordingly. Containers share the host kernel, and user-space syscall filters put another layer between the workload and the system. Firecracker microVMs instead give each workload its own guest kernel behind hardware-level KVM isolation. For hostile or user-supplied agent workloads, that stronger boundary is preferred over shared-kernel separation.
Kernel ownership changes what customization can safely mean. An agent can install system packages, modify libraries, run privileged processes, and break its own environment without those operations modifying the host or another agent’s environment. Root authority stops at the guest boundary. Although a microVM introduces more overhead than a container, agent tasks generally run for seconds to minutes. The architectural tradeoff therefore favors an isolated kernel when useful execution requires real freedom to customize.
What the supply chain threat looks like inside an agent's package install
Package installation brings agent execution directly into contact with adversarial external code. Standard package managers let code run during installation. For example, pip runs the build step for a source package, while npm ran the install scripts for every package by default until npm 12 in July 2026. The Shai-Hulud worm in 2025 spread across hundreds of npm packages, collecting npm tokens, GitHub PATs, SSH keys, and cloud credentials before using stolen credentials to republish itself.
A microVM changes the scope of that attack. Install-time scripts execute against the guest kernel, with access to the environment presented inside that guest. Host credentials and other tenants’ keys are not merely hidden by a package-manager policy. They are architecturally absent from the guest’s address space. This prevents ordinary guest-level access from becoming access to every tenant’s secrets, while credentials deliberately placed inside the compromised environment remain exposed.
How Firecracker microVMs deliver the isolated kernel an agent needs
Firecracker offers hardware-level isolation with overhead low enough to give each agent its own VM. Each microVM boots its own guest kernel under KVM. Root-level package installation, kernel module operations, and filesystem changes are therefore confined to that guest. This is the mechanism behind the customization boundary. The agent controls a computer of its own.
That separation also shapes how fleets grow. The vCPU limit is set before boot, so capacity expands horizontally across many VMs. This fits per-user and per-session agent architectures. Perplexity open-sourced SPACE, the Sandboxed Platform for Agentic Code Execution, in October 2026 with a separate Firecracker microVM for each task and external control of credentials and outbound traffic. SPACE’s red-team testing found zero successful VM-to-host escapes in 108 attempts across nine frontier models, which shows how well the boundary held up under active attack but cannot rule out every possible escape.
The package installation problem that standard approaches cannot solve
Isolation makes it safer to install arbitrary packages, but conventional installation still takes time. Package managers write files, run scripts, and extract archives before the environment is ready to use. The conventional workaround is to snapshot the VM, install packages, and create another snapshot. That shifts work out of startup, but leaves a fixed base that is expensive and complex to update when agents need to compose new environments during a session.
Rivet’s agentOS package manager addresses that tension by changing installation semantics. Installing a package writes nothing to the filesystem and runs no scripts, avoiding extraction, file copies, and post-install steps. Packages are read in place through a virtual filesystem. On startup, the index is sorted by path and made ready for binary-search lookups without unpacking. Rivet’s changelog states that, as of October 12, 2026, in agentOS 0.4, agentOS software has moved from npm to the agentOS registry, where packages ship as .aospkg files.
The agent-vm project takes a complementary approach for local developer machines. It builds a Debian 13 template once with development tools, Docker, Chromium, and agent runtimes pre-installed. Running an agent in a directory clones that template into a persistent VM keyed to the path. A per-user runtime script then runs before a per-project runtime script. These approaches occupy different points in the same tradeoff, with virtual package serving favoring install-time flexibility and template cloning favoring a prepared starting environment.
Runtime customization that a real kernel actually enables
Owning the guest kernel gives an agent system-level authority within its environment. It can use apt, pip, npm, or cargo with root privileges, modify system libraries, run privileged daemons, expose ports, and install kernel modules. These are not merely language-runtime settings. They are changes to the operating environment itself, which would be restricted or dangerous if the same authority extended to a shared kernel. The isolated guest makes that authority local to the agent.
Persistence extends this freedom across sessions, allowing files, installed packages, credentials, and working memory to survive sleep and redeploy within the VM’s own filesystem. Browser work also needs a complete execution environment. The agent-vm README includes headless Chromium with Chrome DevTools MCP among its default components. That gives the agent a browser capability within the same environment as its development tools and runtime.
The AgentVM project, distinct from agent-vm, frames this broader computer interface as an architectural requirement. Its ICML Position Track 2026 paper, “Digital Agents Require Unified Agent-Native Computers,” argues that a GUI-only interface is limiting. A full VM substrate supports arbitrary text-based actions as well as pixel-level GUI actions. Developers can register file readers, bash executors, and structured state in that observation-action space. Kernel access consequently supports a richer interaction model, rather than serving only as a convenient way to install dependencies.
Network isolation as the boundary that makes runtime freedom safe
Guest isolation does not by itself constrain network access. An agent with root authority must not also control the policy governing its outbound connections. That policy belongs outside the VM boundary. SPACE places credential handling and outbound traffic control outside the microVM, but its testing also exposed weaknesses in network enforcement before fixes. Agents bypassed egress policy in some partial-network test runs through DNS spoofing and shared CDN IP addresses, showing why VM escape resistance and network policy correctness require separate evaluation.
By default, VMs can reach the internet but not the host machine or local network. The host network stack refuses loopback, private ranges, link-local, and carrier-grade NAT destinations. Root inside the guest cannot lift those restrictions. Selective access is configured through ~/.agent-vm/network, where allow lines open specified addresses, ports, or CIDR ranges, and domain lines restrict DNS resolution to named domains and their subdomains.
Setting AGENT_VM_UNSAFE_OPEN_NETWORK=1 disables isolation rather than making unrestricted host access the default. This separates freedom inside the runtime from authority over its surroundings. However, implementing that separation creates operational work beneath the VM. Unlike Docker, self-managed Firecracker requires manual management of TAP interfaces, IP tables, and host routing, making the infrastructure layer responsible for much of the system’s practical safety.
Snapshot-restore scheduling and what it means for persistent, customized environments
Snapshot-restore preserves installed packages, running processes, and open browser sessions, then restores them on demand. Idle persistence consumes only storage. This is especially important when an agent pauses for human input, because the wait can outlast the useful computation. Securely preserving active workflow state for potentially long periods is a scheduling requirement.
Ephemeral and perpetual scale-to-zero provide different answers to that requirement. Ephemeral scale-to-zero deletes the sandbox and loses its state, including installed packages and open sessions. Perpetual scale-to-zero pauses the sandbox and preserves filesystem and memory state for resume. That distinction is decisive when comparing persistent AI agent infrastructure with serverless functions. An execution model that discards the environment is insufficient on its own for an agent that must continue with the same installed tools, processes, and sessions.
Copy-on-write forks extend the same mechanism to repeated execution. Environment setup happens once, after which a snapshot becomes the parent for subsequent runs. Each child starts with the parent’s warmed state, including installed packages, so it can skip setup. Forks on the same host skip the transfer needed to move state between hosts. Structurally, the economics are straightforward, because setup can be reused while inactive customized environments consume storage and leave CPU and memory unallocated.
The economics of per-user agent deployment when each agent owns its environment
A per-user agent gives each user an isolated machine whose customized environment persists across sessions. That model looks costly if every machine has to keep running. Snapshot-restore removes the always-on assumption from the design. At any moment, only a fraction of a large tenant fleet is active, so compute serves busy tenants while inactive environments remain in storage. Affordable deployment depends on the scheduler recognizing that difference.
The product pattern is already visible in the notes’ 2026 examples. Since late September 2026, OpenAI dots and Manus Cue have each given every agent its own machine, while Simular Sai has offered a dedicated cloud computer only on paid tiers. These choices make the environment a per-agent resource. For free or low-cost consumer products, however, always-on pricing for an equivalent machine is prohibitive. Snapshot-restore is needed to make this deployment model affordable from the start, even before later work to make it more efficient.
Many small microVMs can stay asleep while active guests run within their own kernel boundaries. A shared-kernel fleet would require more complex tenant-separation logic to support comparable freedom safely. Each user can own a distinct environment without requiring a continuously running computer, provided the infrastructure preserves that environment and schedules compute only when needed.
What to look for in an infrastructure layer for customizable agent VMs
The practical evaluation begins with the isolation model. Developers should establish whether each agent receives its own guest kernel or shares one with other tenants. Package installation semantics then determine how quickly the agent can use that freedom, whether through conventional filesystem writes or a virtual filesystem model that avoids installation work. A prepared template and dynamic package serving meet different needs, so a fast startup alone says little about how much the runtime can change.
Snapshot-restore behavior deserves a separate evaluation from initial boot time. Evaluate how quickly a preserved environment becomes usable. Installed packages, credentials, working files, browser sessions, and memory state must survive the lifecycle events the product relies on. A platform that preserves a disk but loses an active session does not provide the same continuity as one that restores the full environment.
Network policy completes the evaluation because guest root must not imply control over egress. Developers should identify where policy is enforced and whether the agent can alter it from inside the VM. Managed infrastructure can combine Firecracker-backed per-agent VMs, persistent disks, snapshot-restore scheduling, and host-enforced network controls without requiring teams to operate TAP interfaces, routing, and snapshot orchestration themselves. The decisive choice sits beneath the agent framework or LLM, in the layer that determines whether a customized computer remains isolated, persistent, responsive, and affordable.


