Guide 01 / Start here · 2026-08-21

Take one coding task from prompt to reviewed patch

The useful unit is not a sandboxed command. It is the whole coding session: repository, agent, shell, dependencies, dev server, and browser inside one disposable boundary.

Outcome. In about ten minutes you will create a named box, work inside it, inspect what changed and what ran, then choose whether the patch leaves the boundary.
One h5i command creates a supervised box with filesystem, syscall, network, and resource controls around the agent workload
The first run should establish the mental model: one command creates the environment; every agent child stays inside; evidence and a patch come back out.

Before you start

Use a Git repository with a clean enough baseline that you can recognize the agent's change. You do not need Podman or a microVM runtime for the first box. h5i can use its lightweight host-kernel tiers when the operating system supports them.

Choose one agent runtime. The guide shows Claude Code; Codex works the same way with the runtime-specific profile and command changed. One runtime per box keeps HOME state, API routing, and credential handling narrow.

1. Install h5i and check the host

Install the single binary, then ask it what this machine can actually enforce. probe performs a functional check; it does not infer support from the operating-system name.

host
$ curl -fsSL https://h5i.dev/install.sh | sh
$ h5i box probe
$ h5i skill install

The skill teaches a supported coding agent how to operate the box. It is embedded in the binary, so its commands match the version you installed.

2. Create a box from the current repository

repository root
$ h5i box create first-box --from HEAD --profile agent-claude
$ h5i box status first-box

Creation freezes the base revision and resolves the policy before the workspace exists. Read the status once. It names the isolation tier, filesystem grants, network policy, resource limits, and policy digest that the receipts will carry.

Do not skip that output on the first run. Find the answers to four questions: which tier was selected, whether the box shares the host kernel, which paths are writable, and how network access is scoped. The point is to verify the claim before asking the agent to do useful work.

what to record
box       first-box
base      <frozen commit>
profile   agent-claude
isolation <resolved tier>
policy    sha256:<digest>
write     $WORK only
Use the runtime-specific profile. Choose agent-claude or agent-codex. A box should not receive two runtimes' configuration or credential routes.

3. Work inside the boundary

host, then box
$ h5i box shell first-box
box$ claude
# Ask for one concrete change. Let the agent edit, build, and test.
box$ exit

shell is the boundary. Every child process inherits it, including package scripts and test runners. You do not need to remember to wrap each command.

For a single deterministic check, skip the interactive shell:

host
$ h5i box run first-box -- cargo test
$ h5i box run first-box -- npm test

4. Inspect before you export

host
$ h5i box diff first-box --stat
$ h5i box diff first-box
$ h5i box log first-box
$ h5i box status first-box

Use the diff to review the result and the log to review the execution. They answer different questions. A clean patch does not prove that tests ran; a successful test does not make an unrelated edit acceptable.

QuestionCommandSignal
What changed?box diffUnexpected files, generated output, dependency drift
What ran?box logMissing tests, nonzero exits, repeated retries
What governed it?box statusTier, grants, resource caps, policy digest
Can the claim still hold?box doctorBroken refs, missing runtime prerequisites, policy mismatch

5. Move the result through the output gate

host
$ h5i box export first-box --out ./review-first-box
$ git apply --check ./review-first-box/patch.diff
$ less ./review-first-box/report.md

The export contains patch.diff, report.md, and receipt.json. The patch is path-validated. The report puts denied egress and failed execution ahead of the agent's own proposal.

If this is a local box and you want h5i to land the work directly, freeze it first:

host
$ h5i box propose first-box
$ h5i box apply first-box

6. Remove the box when the decision is made

host
$ h5i box rm first-box
$ h5i box gc

A box is cheap because it is disposable. Keep the export. Remove the execution environment.

If the first run fails

The requested tier is unavailable

Run h5i box probe and read the reason. An explicit tier fails rather than falling back. Either satisfy the prerequisite or choose a tier whose stated boundary fits the task; do not translate refusal into “turn security off.”

A build cannot download dependencies

The default profile may have no network. Add only the registry destinations the build needs in a repository profile, or prepare a read-only warm cache. A denied telemetry endpoint is not automatically a missing dependency.

The agent cannot find its login

Check that the profile matches the runtime and run h5i box secrets first-box. It shows resolution state without printing values. Do not solve the problem by copying a whole host HOME into the box.

Apply refuses

Only local worktree boxes can use the mediated propose/apply path. Boxes created from a pull request, clone URL, or empty repository are detached; export the patch and apply it explicitly where you want it.

What “done” looks like

Your first run is successful when you can explain the boundary and the result separately. You should know which tier ran, which test exits were observed, which destinations were denied, and which exact patch you are choosing to take. The agent's summary is helpful, but none of those answers should depend on trusting it.

Reference

Questions that come up

Does h5i change my current checkout?
A box created from the current repository uses its own Git worktree and branch. Your current checkout is not where the agent works. Only an explicit apply step lands a proposed local change.
Which isolation tier should I use first?
Leave the tier on auto for the first run, then read h5i box status. An explicit tier fails closed if the host cannot provide it; h5i never silently substitutes a weaker tier.
Can I use Codex instead of Claude Code?
Yes. Replace agent-claude with agent-codex and run codex inside the shell. Keep one runtime per box so credentials and configuration remain scoped.
Next guide

Run an untrusted pull request

Use a detached box when the code did not originate in your repository.

Make the box the default place agents work

The boundary only helps when the whole session starts inside it.