Archil also runs sandboxes itself. Archil sandboxes are Firecracker microVMs whose root
filesystem is an Archil disk, with an egress firewall and forks that branch the root disk at any size. This guide is
for teams that already run agents on E2B and want their workspace data on storage they can take with them.
Prerequisites
E2B sandboxes meet the requirements for mounting: they provide/dev/fuse, and
archil runs as root with user: "root". If you restrict the sandbox’s outbound traffic, allow TCP 8100 and 32050.
Export your Archil API key and region, and your E2B API key, then install both SDKs:
Mount a disk
First, build an E2B template with thearchil client installed and create a disk. You only do this once:
eval "$(npx tsx setup.ts)" (or eval "$(python setup.py)") to export the disk ID and the disk’s mount token, which grants access to this disk only.
Now start a sandbox from the template, mount the disk at /mnt/archil, and write a file. archil needs root, so these commands run with user: "root", and the token is passed only to the mount command:
archil client buffers recent writes, so the script unmounts before it kills the sandbox: archil unmount returns once every write has reached the disk.
Run npx tsx mount.ts (or python mount.py) twice. Each run starts a new sandbox, and the second one finds the line the first one wrote:
--conditional, so every sandbox can read and write without a checkout. See Sharing a disk between agents for how to hand files from one sandbox to another, and Consistency for when each one sees the others’ writes.
Read it from anywhere
Both sandboxes are gone, and the file is still on the disk. Read it from your own machine or app with the SDK:Clean up
Delete the disk with thedisk CLI, and the E2B template:
Next steps
archilCLI: every mount option, including--conditionaland--read-only.- Persistent sandboxes: Archil’s own sandboxes, with the disk mounted for you.