- Egress you control: on Developer, Team, and Enterprise, write your own firewall
with domain and CIDR rules, starting from
default: "deny"for no network at all. On Free, sandboxes reach only a managed allowlist of package registries, Git hosts, and model APIs, and everything else is denied. - Secrets stay outside the sandbox: with credential brokering, the egress proxy adds API keys to outgoing requests, so code in the sandbox never sees them (Developer plan and above).
- Private until exposed: ports and services aren’t reachable from the internet until you expose them.
- Isolation: hardware virtualization (KVM), not shared-kernel containers. Sandboxes can’t reach each other, private networks, or cloud metadata. See Isolation.
- No per-command timeout: a session runs for up to 24 hours, then pauses with its processes intact. See Setting a time to live.
- Persistent: the root filesystem lives on an Archil disk, so files and installed packages survive stop, start, and pause. Fork a sandbox to run copies in parallel.
- Any image: public or private OCI images on x86-64, with 1 to 32 vCPU and 0.25 to 64 GiB of memory.
- Reversible: sandboxes boot from standard OCI images, and a workspace on a disk synced to your own bucket is stored as ordinary objects that any S3 tool can read without Archil. The same disk mounts in E2B, Daytona, and Modal, so you can move compute without moving data. See Data ownership and portability.
Limits and lifecycle at a glance
For every numeric limit, see Limits.
Persistent sandboxes are available in Archil’s public AWS regions and in
BYOC deployments on any cloud (AWS, Google Cloud, or Azure) or bare
metal. See Region availability.
Occasional maintenance events may
pause running sandboxes, and require that you resume them to continue working
from the same state. Rarer hardware failures result in sandboxes becoming failed, which may incur loss of in-memory
state or writes that haven’t yet been persisted to disk. Data already persisted to disk is kept, so starting the
sandbox again boots it from disk. See What survives a crash.amd64) and support between 1 and 32 vCPU cores and between 0.25 and 64 GiB of memory. Sandboxes run as the root
Linux user (uid: 0, gid: 0).
One-shot execution or a persistent sandbox
Not every task needs a sandbox that persists. Serverless execution (disk.exec) is
one-shot, ephemeral execution: each call runs one command in its own Firecracker microVM with your disk mounted, returns
the output, and shuts the VM down. Only what the command writes to the disk outlives the call, and there is no sandbox to
create, stop, or delete.
The quickstart gives an agent a one-shot
bash tool. The
code interpreter guide keeps a Python kernel alive in a persistent sandbox. For keeping an
agent’s environment across restarts, see
How to keep an AI agent’s environment across sandbox restarts.
Isolation
Each sandbox runs in a dedicated Firecracker microVM, isolated from the host and from other sandboxes by hardware virtualization (KVM) rather than by containers alone.- Each sandbox boots its own Linux kernel. Code in the sandbox, including code running as root, never runs on the host kernel.
- Root inside the VM grants no privileges on the host or in other sandboxes.
Linux and container compatibility
Sandboxes support running containers inside the VM. Include the tools your workload needs in your sandbox image; kernel support does not install Docker or other user-space tools.
The sandbox’s root filesystem and an additional FUSE-mounted Archil disk have different filesystem capabilities.
An additional Archil disk cannot be used as an OverlayFS upper directory; use it for application data or bind-mount
it into a container instead. See Application Compatibility for mounted-disk limitations.
Network egress
On Developer, Team, and Enterprise, you set each sandbox’s egress policy with the sandbox firewall: deny everything, allow only the domains and CIDR ranges you list, or broker credentials. A sandbox created without a policy has unrestricted egress. Sandboxes on the Free plan can’t reach arbitrary URLs. They can reach only a managed allowlist of package registries, Git hosts, container registries, OS package mirrors, and model provider APIs, and all other egress is denied. Sandboxes created on Free keep the managed allowlist after an upgrade until you replace their network policy.Attaching an Archil disk
Passmounts when creating a sandbox to give it access to files on an existing Archil disk. The disk must belong
to your account and be in the same region as the sandbox:
- TypeScript
- Python
- REST
path is optional and defaults to /mnt/archil. To mount more disks, add an entry for each
one with a separate path, such as /mnt/archil and /mnt/models.
Use subdirectory to expose only part of a disk. See Create Sandbox
for the full mount options and path restrictions.
By default, a mount takes exclusive access to the disk. To share it across sandboxes, use readOnly (read_only
in Python and REST) for readers or conditional for writers. Coordinate concurrent writes in your application
to avoid overwriting each other’s changes. See Sharing a disk between agents
for a pattern that does this, and Sharing Disks for how these modes work.
Sandboxes keep their mounts across stop/start and pause/resume. To change them, stop the sandbox and pass a new
mounts list to Start Sandbox. Omit mounts to keep the saved list,
or pass [] to remove all mounts without deleting their disks. For a paused sandbox, resume() keeps its mounts;
use start() to change them, which boots from disk and discards the paused memory state.
Root filesystem and mounted disks
A sandbox stores files in two places, and they persist differently.
Both are durable. For what each keeps after a hardware failure, see What survives a crash.
Mounting an Archil disk in another provider’s sandbox, such as E2B or Daytona, persists only what is written under the
mount path. That sandbox’s own root filesystem, including the packages you installed, still goes away with it. In an
Archil sandbox, the root filesystem is itself on an Archil disk, so installed packages persist too.
Passing environment variables
Environment variables can be set for the whole sandbox, for a single command, or both. Variables passed when the sandbox is created apply to every command that runs inside it:env to run:
Labels
Labels are a way of associating metadata with a sandbox, as key-value pairs set when you create or fork it:Starting and stopping sandboxes
A sandbox runs until you shut it down or its TTL expires. There are two ways to suspend one, and they differ in how much state they keep. Stopping or pausing a sandbox stops compute charges; retained disk data remains subject to storage pricing. Stopping a sandbox sendsSIGTERM to every running process and shuts down the VM, leaving the disk intact:
What survives a crash
A cleanstop or pause flushes the root filesystem and every mounted Archil disk to Archil storage before the
sandbox reaches stopped or paused, and pause also saves memory and running processes there. A paused sandbox doesn’t depend on
the machine it ran on, so it can resume after a hardware failure.
If a sandbox stops without a clean stop or pause, for example because of a hardware failure, it becomes failed:
Starting a
failed sandbox boots it from its root disk. For data you can’t lose, write it to a mounted Archil disk
and call fsync. When fsync returns, the write is durable on Archil. Writes are also flushed in the background
shortly after they’re made.
Forking a sandbox
In some situations, you may want to fork a sandbox into multiple branches from a single point in time. This makes it simple to, for example, start sandboxes from a template without needing to incur startup latency for a slow-running program or run parallel experiments on sandbox state from some point in the past. A sandbox without additional disk mounts can be forked while running, paused, or stopped:newSandbox will be able to run commands independently of the original sandbox, starting from the exact state
of the original sandbox. Forking a running sandbox pauses it while the snapshot is taken and resumes it once the fork is
accepted, so attached process connections close; reconnect with attach. A paused or stopped sandbox is left
as it is, and a fork of a stopped sandbox boots from its disk.
Forking a sandbox with mounted disks
A sandbox with mounted disks must be stopped before forking. Forking a running or paused sandbox copies its memory, and that copy would include the parent’s Archil disk clients, with their identity and any delegations they hold. Two sandboxes would then act as one client. So the fork is refused with409 and the code
sandbox_fork_mounted, and a running parent keeps running. A stopped sandbox has no memory to copy: its fork boots from
disk and mounts each disk as a new client.
To fork a sandbox that has mounted disks:
readOnly
or conditional (see Sharing Disks), or stop the fork and
start it with different mounts. To give the fork its own copy of a disk’s
data, mount a branch of that disk. Separate disks also keep their data isolated.
If you fork often, keep the data the fork needs on the root filesystem: a sandbox without mounted disks can be forked
while running, with its memory and processes.
A sandbox cannot be deleted while it has forks, so delete each fork before the sandbox it was forked from.
Hosting network services
Archil sandboxes support the ability to host network services, including creating per-sandbox preview URLs for CI-like workflows. There are two ways to expose a port for a network service, depending on whether you are inside or outside the sandbox. Outside the sandbox, you can specify a list of ports to expose when creating the sandbox or dynamically expose a port later.X-Archil-Token header;
requests without a valid token get 401. Tokens are checked when a connection opens, so revoking or expiring a token
blocks new connections while open ones stay open. Token access supports HTTP/1.1 over HTTPS only, and publicly exposed
ports ignore tokens.
archil services create runs a command as a supervised service: it starts immediately and restarts if
it exits. Service ports are private by default, so reach them by exposing the port or with a port token. To let services
publish their own hostnames, create the sandbox with enable_service_ingress: true through the
Create Sandbox API.
python3 -m http.server 8080 and returns a
stable HTTPS URL that proxies traffic to local port 8080. Without service ingress, the service still runs, but its
hostname is not routed until you expose the port.
Choosing a base image
UsebaseImage to start from a public Linux OCI image, such as python:3.13. The default is node:24-bookworm, which includes Node.js, Python, git and a C toolchain.
For private images, build with your registry credentials first, then pass the returned imageId when creating
the sandbox. See Sandbox images for examples and how to reuse builds.
Setting a time to live
A sandbox has a hard timeout and an idle timeout. Both pause the sandbox, preserving its disk, memory, and processes forresume(). Attached process connections close when it pauses; reconnect after resuming. If the pause
snapshot fails, the sandbox is marked failed. Stop a paused sandbox before deleting it.
idleTtlSeconds to 0 to turn idle expiry off for unattended jobs or services that must keep running
between connections. A process connection to a paused sandbox fails with 409, so call resume() before
reconnecting.
Activity does not extend the hard timeout. setTimeout() can extend it only within the session’s 24-hour limit.
For REST, use Set sandbox timeouts.
On the Free plan, a session lasts at most 30 minutes. A sandbox created without maxTtlSeconds gets 30 minutes, and
a longer maxTtlSeconds or setTimeout() is refused with 403 and the code sandbox_ttl_limit_exceeded. A
sandbox created without maxTtlSeconds on Free can also get a shorter session, so that it fits the sandbox compute
the plan has left that month.
Running long jobs
For an agent or job that runs for hours:- Turn off idle expiry. Create the sandbox with
idleTtlSeconds: 0, or callsetTimeout({ idleTtlSeconds: 0 }). Otherwise a detached process, or a service that only receives port traffic, pauses after 30 minutes. - Plan for the 24-hour pause. The 24-hour session limit is hard: neither activity nor
setTimeout()moves it. When it’s reached, the sandbox pauses with memory and processes intact, andresume()continues them in a new 24-hour session. A paused sandbox runs nothing until it is resumed, so a job that runs longer than 24 hours stops for as long as the sandbox stays paused. Check the sandbox’s status with Get Sandbox and callresume()when it ispaused. Traffic to an exposed port or a port token also resumes it (see Hosting network services). - Write results to disk as you go. If the pause snapshot fails, the sandbox becomes
failedand memory is lost, but data written to disk is kept. See What survives a crash.
Opening interactive shells
By default, processes run without allocating a pseudo-terminal (pty). This is usually desirable, since it signals to the process that it is not in an interactive terminal. However, some commands, such as those that emit color, full-screen tools likevim and top, or tools that need interactive input should instead be launched in a pseudo-terminal.
Provide terminal dimensions to launch a process in a pseudo-terminal. The process can then interactively receive input
and stream output to the caller: