Skip to main content
Outcome: boxes that start with your compilers, CLIs, and pinned dependencies already present. Level: beginner+ · Time: ~10 minutes · Pattern: the agent lives in the box.

When to use this

The default sandbox image is clean, which also means it is empty. As soon as an agent needs a specific toolchain — a Node stack, ffmpeg, a compiler, an internal CLI, a set of pinned versions — installing it after every boot is slow, not reproducible, and fails outright when the network is restricted. More often, you already have the image. Your team’s standard dev image, your CI image, or a project’s official image. You just want the agent to live in it. BoxLite reduces that to one parameter: pass an image reference to image= to pull from a registry, or a local OCI image layout directory to rootfs_path= for offline use. Whatever the image contains, the box has — and every box is still a fully isolated microVM.

Architecture

The isolation properties do not change with the source. A custom image widens what the agent can do; it does not widen what it can reach.

Prerequisites

  • BoxLite installed and a working virtualization host — see Installation.
  • Network access to your registry, or a local OCI image layout on disk.

Build it

Option 1: pull a public image

Pass a fully qualified reference and the image becomes the box’s root filesystem.

Option 2: an image that already carries the toolchain

Same parameter, different image — the agent gets a full Node runtime with nothing to install.

Option 3: offline, from a local OCI image layout

When the box must not reach a registry at all, point at a directory on disk instead. rootfs_path takes precedence over image.
Private registries, resolution order for unqualified names, and credentials are configured once at runtime level — see Image registry configuration.

Run it

The box is running your image, and its package manager is there without a single install step.

Trust and limits

  • The image defines capability, not exposure. A richer image gives the agent more tools; it does not change the microVM boundary or open the network further. Whatever the image contains still runs on its own kernel and filesystem.
  • You inherit the image’s trust posture. A base image with a vulnerable library, or one from an unverified source, brings that into the box. Pin digests for anything you depend on, and prefer images you build.
  • The first pull is slow, later starts are not. Layers are cached by digest and deduplicated across images, so the cost lands once per image.
  • Disk is finite. Large toolchains plus runtime installs can exhaust the default box disk — the failure is OSError: [Errno 28] No space left on device. Size it with disk_size_gb.
  • image and rootfs_path are alternatives. Supplying neither raises ValueError at construction; supplying both means rootfs_path wins.

Troubleshooting

Next steps