# Agent harness (Harbor)

> Run Harbor tasks such as Terminal-Bench in dvm.run sandboxes using the Python SDK.

This is the Markdown of https://docs.dvm.run/guides/harbor/. Every page of the dvm.run docs is served as Markdown at its address plus `.md`; the list of pages is https://docs.dvm.run/llms.txt.

The Python SDK provides a Harbor environment (`dvm.harbor:DvmEnvironment`) for agent benchmarks such as Terminal-Bench. Each of a task’s environments runs in a recorded session (a sandbox accepting commands), so you can inspect what the agent did afterward. Python only.

## Run a task

Install the SDK in the Python environment Harbor runs in, then pass the environment:



```sh
uv tool install harbor --with dvm-run
harbor run -p <task dir> --agent oracle --env dvm.harbor:DvmEnvironment
```

Harbor is not a dependency of `dvm-run`, and there is no Harbor extra. Credentials resolve as in the SDK: `DVM_API_URL`, `DVM_API_KEY`, or a key saved by `dvm-run login` ([Getting in](/start/access/)). Tested with Harbor 0.26.0.

## What it supports

* **Images.** Uses the task’s `docker_image` (must be a public, prebuilt Linux image with a POSIX shell and `tar`). Local Dockerfiles are not built.
* **Size.** Applies task CPU and memory; storage uses dvm.run’s default (`storage_mb` is ignored).
* **Commands.** Run in Harbor’s working directory with its environment and user. At a deadline, the process group is killed and `TimeoutError` is raised.
* **Files.** Single files use SDK file calls; directories transfer as tar archives, preserving executable bits, internal links, and empty directories.
* **Network.** Supports no network, internet, or an allowlist of hostnames, `*.domain` wildcards, IPv4 addresses, and IPv4 CIDR ranges; Harbor can change it between phases. No IPv6 ([Network](/guides/network/)).
* **Grading.** Supports shared or separate grading, copying declared artifacts between sandboxes for separate grading. Sandboxes are named `<task>-agent` and `<task>-grading`, truncated to fit dvm.run’s rule for names.

Rejects upfront: missing images, image builds (`force_build` included), Docker Compose, multiple containers, GPUs, TPUs, Windows, and host mounts.

## After a task

Shutting down an environment closes session input and waits for clean exit so the sandbox stays inspectable. Only if that fails or exceeds 30 seconds is the sandbox force-stopped. Harbor’s `delete` keeps the sandbox either way. Use `sandbox_id` to open it in the panel or inspect it from the SDK ([Inspecting a finished run](/guides/inspect/)).

## Terminal-Bench

Published `terminal-bench/terminal-bench@latest` tasks name prebuilt images for both agent and grader:



```sh
harbor download terminal-bench/terminal-bench@latest -o tasks
```

Source checkouts may omit image fields. Set `[environment].docker_image` and `[verifier.environment].docker_image` in `task.toml` to the published images, and `[verifier].environment_mode = "separate"`. The grader image must already contain its tests.
