Skip to main content
Harbor is a framework for evaluating and training agents on sandboxed tasks. Each trial runs an agent against one task inside an isolated environment, then a verifier scores the result. Harbor includes environments for Docker on your own machine and for several cloud sandboxes, and loads any other environment by import path. Sail provides one:
Pass that import path to Harbor and every trial’s environment becomes a Sailbox. Tasks, agents, verifiers, and datasets are unchanged.

Quickstart

Install sail and harbor in the same Python environment (Harbor needs Python 3.12 or newer) and set your Sail API key. Then run Harbor’s hello-world dataset with the oracle agent, which runs each task’s reference solution and doesn’t need a model key:
Harbor creates a Sailbox, runs the task’s solution in it, runs the verifier, writes the trial’s results under ./jobs, and terminates the Sailbox when the trial ends. A real evaluation is the same command with a real agent, a model, and more trials in flight. Each trial gets its own Sailbox, so the machine running Harbor is no longer the limit on concurrency:
A job config file (harbor run -c job.yaml) selects the environment the same way:

Credentials and app

The process that runs Harbor needs a Sail credential: set SAIL_API_KEY, or run sail auth login once on that machine. A run without one fails before any trial starts, and the error says what is missing. Sailboxes are created in the harbor app in your organization, which is created on first use. To use a different app, pass app_name to the environment, or set SAIL_APP. The argument wins when both are set.
Each Sailbox is named harbor- followed by the trial’s session id, and sail box list --app harbor (or the app you chose) lists the ones a run created.

Task images

Harbor decides where an environment’s image comes from, and Sail follows the same rules as Harbor’s other cloud providers.
  • A task that includes an environment/Dockerfile has it built into a Sailbox image. The build happens once per organization: the first trial of that task waits for it, and later trials start from the cached image. --force-build rebuilds it. See Build an image from a Dockerfile for what a Dockerfile can contain.
  • A task that declares a docker_image in its task.toml runs on that image, pulled from its registry. Docker-style short references work: python:3.11 means docker.io/library/python:3.11. The registry must be one Sail supports, the image must be public, and it must be Debian or Ubuntu based. See Bring your own base image for the full requirements.
  • A task can have both. Harbor treats docker_image as the published build of the Dockerfile and runs on that image unless you pass --force-build.
  • A task that includes an environment/docker-compose.yaml runs as a Docker Compose project.

Docker Compose projects

The project runs inside the Sailbox. Commands run in the task’s main service, and Harbor’s per-service operations (exec, download, stop) reach the other services. If the task also has a docker_image or a Dockerfile, main runs on that image, and the compose file’s main entry adds settings such as environment or ports. Each command in main uses non-login Bash and keeps the image’s PATH unless the task or call overrides it. Commands in sidecar services use sh. Sail builds the service images into the Sailbox image, cached and rebuilt the same way as a Dockerfile build. The compose files follow the rules in Build an image from a Compose project. A project that uses an unsupported feature fails before a Sailbox is created, and the error identifies the feature. Copies between Compose containers and their Sailbox have a 30-minute timeout per copy, allowing large artifacts more time to transfer. Set a different positive timeout in seconds through the environment’s kwargs:
This setting bounds each docker compose cp command for files or directories, in either direction and for any service. Transfers between your local machine and the Sailbox keep their separate limits, as do task commands and verifiers. By default a Sailbox lives until Harbor deletes its environment. To make Sail terminate every Sailbox a run creates on its own, a set number of seconds after each one is created, pass max_lifetime_seconds the same way:
The cap applies even mid-command and even when the Harbor process dies before it can clean up, so a run cannot leave Sailboxes behind. Pick a value longer than the trial’s longest allowed agent and verifier phases, plus setup. An environment that is stopped and started again runs on a new Sailbox, whose cap starts over.
  • ${VAR} or $VAR in the task’s compose files takes its value from the variables the trial adds, then the task’s env entries, then the environment of the machine running Harbor. Compose fills anything still unset from the project’s .env, then the default in the expression.
  • The task’s env entries and the trial’s variables are passed to the project whether or not a compose file references them.
  • DOCKER_HOST and the other variables that select a Docker daemon (DOCKER_CONTEXT, DOCKER_CONFIG, DOCKER_CERT_PATH, DOCKER_TLS, and DOCKER_TLS_VERIFY) are not taken from the machine, even when a compose file references them. A task env entry or trial variable with one of these names is still passed as written.
  • The build sees the same variables as the start.

Limits

A Sailbox is charged for the resources its workload actually consumes, and its limits are optional. The adapter maps a task’s resource requests onto them. The CPU request sets the Sailbox’s vCPU count, rounded up to a whole number, 1 to 8, and a task that doesn’t declare CPUs gets 1 vCPU. Memory and storage requests fit under the Sailbox’s default limits of 256 GiB of memory and 1024 GiB of disk; a task that requests more than that, or more than 8 CPUs, fails up front, before a Sailbox is created, and the error names the request and the limit. The vCPU count and the memory and disk limits are limits, not reservations. Regardless of configured limits, a Sailbox is only charged for the CPU, memory, and disk its workload actually consumes at runtime, so a task that requests 8 CPUs and uses one is charged for one. Harbor’s cpu_enforcement_policy and memory_enforcement_policy settings can be left at their default or set to request, which is how a Sailbox honors a task’s resources. The limit and guarantee policies ask for an enforced cap, which a Sailbox does not provide, so a job that sets one fails up front.

Interactive sessions

harbor tasks start-env starts a task’s environment and opens a shell in it on your terminal:
On a Sailbox that is a login shell on the Sailbox itself, or bash in the main service when the task is a Compose project. The shell starts in the task’s working directory with the task’s variables, as the agent’s commands do. The environment is stopped and deleted when the shell exits.

Cleanup

By default, harbor run deletes each environment when its trial ends, which terminates the Sailbox. A termination that fails does not change the trial’s result: Harbor logs a warning naming the Sailbox, which may still be running. Terminate it yourself with sail box terminate <id> or from the dashboard. With --no-delete, Harbor stops each environment without deleting it. The Sailbox goes to sleep with its filesystem and processes intact, and billing stops while it sleeps. Harbor’s debug log names the Sailbox and the command that reopens it, sail box shell <id>. Starting the environment again creates a new Sailbox rather than waking the sleeping one. Terminate kept Sailboxes yourself when you are done with them, with sail box terminate <id> or from the dashboard. A trial whose environment fails to start terminates its Sailbox before the error is reported, even with --no-delete. A termination that fails there is logged the same way, and the Sailbox may be left running.

Unsupported task features

Harbor checks a task’s needs against the environment before starting it, so a task that needs something unsupported fails up front with a clear error instead of running without the feature. Sailboxes do not offer:
  • GPUs, TPUs, or Windows environments.
  • IPv6 allowlist entries. A Sailbox does not reach the internet over IPv6. IPv6 loopback (::1) works within each Sailbox, including with no-network.
  • A healthcheck that waits for a service the image’s ENTRYPOINT or CMD would start. A Sailbox boots a single-container image without running either, so nothing starts for the check to wait on, and the failure says so. Start the service from a Compose project instead, where each service runs its own entrypoint.
The egress policy reference has the allowlist entry rules. A task’s mounts cannot attach a directory from the machine running Harbor, because a Sailbox is a separate machine. Outside a Compose project, each writable mount’s target is created on the Sailbox when it does not already exist, and any user can write to it, for the task to fill. Anything already at that path is kept. A read-only mount is skipped. In a Compose project the Sailbox stands in for the host: every bind mount’s source, read-only or not, becomes a Sailbox directory any user can write to at its target path, which the main service sees at that same path.