---
title: "Images"
description: "The base image that new boxes start from, how abx image build creates and reuses it, and why it is tied to the host architecture."
---

> Documentation Index
> Fetch the complete documentation index at: https://sandrinodm.github.io/agent-box/llms.txt
> Use this file to discover all available pages before exploring further.

# Images

Every new box starts from one base image, a smolvm template that contains the guest operating system, abx's guest helpers and the agent CLIs. You build it once with `abx image build`. This page explains what the image holds, when abx reuses or rebuilds it, and how it is matched to your host.

## What the image is

The image is a template published under `$ABX_HOME/images/template-<id>/base.smolmachine`, read-only. `$ABX_HOME/images/current.json` names the active one. The build:

- prepares the base OS,
- installs the guest helpers `/usr/local/libexec/abx-guest` and `/usr/local/libexec/abx-session`,
- installs each selected agent from pinned versions and digests.

A template contains no credentials. Credentials are resolved on the host when a box starts; see [Access modes](https://sandrinodm.github.io/agent-box/authentication/access-modes/).

## Building

```sh
abx image build                  # all six agents
abx image build claude codex     # only these agents
abx image build --rebuild        # build again even if a matching template exists
```

With no agent names the image includes all six: `claude`, `codex`, `opencode`, `pi`, `agy` and `cursor`. A build takes several minutes. Each agent installation has a 10-minute host deadline. Without a terminal on stderr, each step prints as one `abx: <step>` line, for example `abx: Install claude <version>`, so the build is not silent.

abx takes a build lock, so only one build runs at a time. The build runs in a disposable builder machine that is restricted to build hosts and has no mounts or credential bindings. abx verifies the builder's policy before it runs guest commands and again after each state or network transition. A mismatch fails with `policy-mismatch` and deletes the builder. The builder is then sealed offline, packed into a template, and restored twice as offline clones that must report the expected architecture, guest user, disk, network, helper digests and agent versions.

## Reuse

Unless you pass `--rebuild`, `abx image build` returns the current template when it matches all of:

- the host's guest architecture,
- the requested agent selection,
- the image's `artifactDigest`.

With `--json`, `reused` is `true` when an intact image with the same agents already existed and nothing was built:

```sh
abx image build --json
```

The result has the fields `template`, `digest`, `agents`, `guestArch`, `metadataVersion`, `artifactDigest` and `reused`.

`--rebuild` builds again even when a matching template exists. Existing boxes keep the image they were created from. Only new boxes use a new image. An agent that is not in the image fails a launch with `agent-not-in-image`.

## Architecture matching

The guest architecture follows the host:

| Host | Guest |
| --- | --- |
| `x86_64` | `amd64` |
| `arm64` | `arm64` |

Images are not reused across architectures, pins or modified bytes. Creating a box reads the template again and checks the guest architecture and the SHA-256 of the pack (`shasum` on macOS, `sha256sum` on Linux). The pack is hashed again whenever abx checks a verification receipt against it, for example by `abx auth verify` or before it releases a masked credential. Copying `$ABX_HOME` to a machine of another architecture means you build a new image there.

## Inspecting the image

```sh
abx image
abx image --json
```

`abx image` shows the installed image and its agents, or says how to build one. It reads the image metadata and does not hash the pack; that happens when a box is created. `--json` prints:

| Field | Meaning |
| --- | --- |
| `present` | Whether an image is installed. |
| `template` | The template id. |
| `agents` | The agents in the image. |
| `digest` | SHA-256 of the pack. |
| `guestArch` | `amd64` or `arm64`. Must match the host. |
| `metadataVersion` | The metadata format, always `2`. Images built before `0.1.0` used `1`; rebuild those. |
| `artifactDigest` | Digest of the recipe: guest architecture, pinned base image, guest helpers and selected agent pins. |

On a fresh home, `present` is `false`, `agents` is `[]` and the other fields are `null`. The same object appears as `image` in `abx status --json`. `abx status` also tells you what to run next. If the metadata is damaged or from before `0.1.0`, `image` is `null` there and the suggested next step is `abx image build --rebuild`.

Upgrading abx or smolvm can change the recipe or the pins, which makes the installed image stale. See [Upgrading](https://sandrinodm.github.io/agent-box/operate/upgrading/).

Source: https://sandrinodm.github.io/agent-box/concepts/images/index.mdx
