- Evaluate any agent, such as Claude Code, OpenHands, or Codex CLI, against curated datasets like Terminal-Bench, SWE-Bench, and Aider Polyglot
- Build and share your own benchmarks
- Run thousands of trials in parallel across cloud providers
- Generate rollouts for reinforcement learning (RL) optimization
--env flag. Tensorlake is one of those providers, alongside other sandbox vendors and local Docker. The same Harbor commands run on Tensorlake sandboxes without changes to your tasks, agents, or evaluators.
This guide covers command-line interface (CLI) agent evaluations against benchmarks like Terminal-Bench. Harbor also generates rollouts for RL optimization. We’ll cover those workflows in follow-up guides.
Quickstart
Install Harbor with the Tensorlake extra, set 2 API keys, and run 1 Terminal-Bench task.1
Get a Tensorlake API key
Create one in the Tensorlake Dashboard. You also need an API key for the agent provider you want to evaluate, such as Anthropic.
2
Install Harbor with the Tensorlake provider
The
harbor[tensorlake] extra installs the TensorLakeEnvironment provider alongside Harbor.- uv
- pip
3
Set your environment variables
4
Run a Terminal-Bench task
Run a single Terminal-Bench task on Tensorlake with Claude Code as the agent:Remove
--include-task-name to run the full Terminal-Bench 2.1 suite. --ae forwards an environment variable from your shell into the sandbox where the agent runs. Add more --ae flags for any other secrets the agent needs.Why Tensorlake for Harbor
Harbor’s value comes from running large fleets of environments in parallel and trusting the results. Tensorlake’s runtime targets that workload:- Per-trial sandboxes: Each task starts on a clean sandbox, which Tensorlake destroys at the end. Trials share no kernel state, which matters for both eval reproducibility and RL reward integrity.
- Full task-environment support: Tensorlake imports a task’s real Docker image and converts it into a sandbox image that boots directly. Every trial runs the exact environment the benchmark defines, not an approximation built by replaying a Dockerfile. That closes the environment gap that otherwise skews results.
- Pre-warmed snapshots: Build environments with heavy
aptorpipinstalls, such as PyTorch, CUDA toolchains, or full Linux desktops, once. Snapshot them, then restore the snapshot for every later trial or rollout. - Independent verification: Harbor’s test script runs inside the sandbox and writes
1.0or0.0toreward.txt. The agent never sees or touches the verifier, so you never confuse “the agent said it worked” with “the tests pass”. - Parallel scale: Tensorlake schedules thousands of sandboxes concurrently, which is what RL rollout generation and full benchmark sweeps need.
Anatomy of a Harbor task
Harbor expects each task to use the layout below. gcode-to-text is an example:environment/Dockerfiledefines the base image and any setup steps.instruction.mdis the prompt the agent receives.solution/is a reference solution that validates the environment itself.tests/test.shruns after the agent finishes and producesreward.txt.
Tune sandbox resources
Each task’stask.toml controls the sandbox Harbor provisions on Tensorlake. Set resources in the [environment] block:
task.toml
If a value is below the Tensorlake minimum, Harbor raises it to the minimum. Harbor never lowers a value. Many benchmark tasks ask for 1 CPU and 4 GB, which causes out-of-memory (OOM) failures on sandbox hosts. A sandbox that you restore from a snapshot keeps the disk size of the snapshot.
Tensorlake requires between 1024 MB and 8192 MB of
memory_mb per CPU core.Harbor deprecated
allow_internet in favor of network_mode. Harbor still accepts it and maps true and false to network_mode = "public" and "no-network". Set network_mode directly in new tasks.- Large or heavy images: If your
environment/Dockerfilepulls in big toolchains, such as PyTorch, CUDA, full Linux desktops, or large datasets, raisecpusandmemory_mbso the build and runtime have headroom. Raisestorage_mbpast the image size plus working-set room. Underprovisioned sandboxes fail with build timeouts or out-of-memory (OOM) errors mid-trial. - Lock down
network_mode: Setnetwork_mode = "no-network"to stop the agent from searching the web for answers. Or set"allowlist"withallowed_hoststo permit only specific destinations.
Dynamic network policy
Different phases of a trial need different network access. Setup may need the open internet to install dependencies. The agent and verifier need tighter limits so the agent can’t search the web for answers and nobody can tamper with the verifier’s result. Tensorlake sandboxes switch the network policy on a running sandbox, so Harbor can scopenetwork_mode per phase in task.toml:
task.toml
- The old policy stays active for a few seconds. Tensorlake resolves each hostname in the new policy before it swaps the rules. A tighter policy usually takes effect in about 5 seconds, and a slow hostname can extend this to about 10 seconds. The sandbox is never unprotected during the swap.
- Open connections continue. The firewall is stateful. A connection that opened under the wider policy stays open after the swap.
- A hostname that does not resolve stops the switch. Tensorlake rejects the update, the previous policy stays in effect, and the phase fails.
allowed_hosts accepts exact hostnames, leading-wildcard hostnames such as *.example.com, IPv4 addresses, and IPv4 CIDR ranges. Tensorlake does not support IPv6 entries.
Network policies, including
allowlist and per-phase overrides, also apply to Docker Compose tasks. Tensorlake enforces the policy outside the sandbox VM, so one policy covers all compose containers.Image build and caching
Each trial boots from an image. Harbor uses a prebuilt image when the task declares one, and otherwise builds the task’s Dockerfile:
Either way, Harbor builds or imports the image once and reuses it. You pay the cost on the first trial only. Every later trial boots directly from the cached image. If a task sets both and the prebuilt image exists, Harbor uses the prebuilt image.
Prebuilt image
If a task declares adocker_image in task.toml, Harbor boots directly from that image and skips the Dockerfile:
task.toml
TENSORLAKE_API_KEY for image lookup and import. The API key selects the project, so you don’t need separate organization or project environment variables.
Dockerfile
If a task has nodocker_image, Harbor builds its environment/Dockerfile once with Tensorlake’s image builder and caches the result. Every later trial boots directly from the cached image, with no per-trial apt or pip work. The cache key covers the Dockerfile and every file in the build context, so editing a requirements.txt pin or any COPY’d file triggers a rebuild.
RUN and COPY steps on each trial, but Harbor removed that path. If you pass --ek use_oci_image_build=false, Harbor stops with an error.
Dockerfile requirements
The image builder is stricter than a localdocker build, so 3 Docker conventions need adjustments:
COPYdoes not auto-create parent directories:COPY x /a/b/cfails if/a/bdoesn’t exist yet. AddRUN mkdir -p /a/bbefore theCOPY.- Don’t pin exact apt versions (
apt-get install curl=8.5.0-2ubuntu10.6): Drop the pin or pick a version that exists in the target distro. - Use a FROM image that ships the Python you need, such as
python:3.10-bookworm, rather than fetching a non-native version at build time.
Force a fresh build
To rebuild the Dockerfile even when a valid cached image exists, add--force-build. Harbor registers the new image under a unique name for that run only. The cache for later runs does not change.
If the task sets both docker_image and a Dockerfile, --force-build skips docker_image and builds from the Dockerfile. If the task has no Dockerfile, Harbor uses docker_image as usual. --force-build has no effect when you restore from a snapshot.
Sharing images publicly
By default, images Harbor builds or imports are private to your organization. Only your org can boot from them. Add--ek is_public=true to register a freshly built or imported image as public, so any organization with Tensorlake access can reuse it:
docker_image imports. Another organization boots a public image through the prebuilt docker_image path. The published Terminal-Bench images work this way. To publish an environment that others boot directly, use a docker_image reference.
Publishing public images requires an allowlist entry. If your account isn’t on it, Harbor ignores the flag and the image stays private. Contact Tensorlake to be added.
is_public takes effect only when Harbor registers a new image. If an image with the same name already exists, either a private copy from an earlier run or an existing public one, Harbor boots it as-is and won’t republish it. If the existing image is private, Harbor logs a message that it did not publish the image. To turn an already-private image public, delete it first, then rerun with --ek is_public=true. Changing the build context so the image gets a new name also works.
Ad-hoc native dependencies
If a task needs extra apt packages and you don’t want to edit the Dockerfile or maintain a snapshot, usepreinstall_packages:
Other sandbox options
Pass these options with--ek:
Harbor also sets these environment variables in each single-container sandbox, so that agents and task scripts can adapt:
Docker Compose (multi-container) tasks
If a task needs more than one container, such as a database or sidecar service alongside the agent’s environment, add anenvironment/docker-compose.yaml. Harbor detects it and boots a docker-capable sandbox instead of a single container. You don’t need an extra flag:
dockerd and docker compose run on the sandbox. Your main service, where the agent and verifier operate, runs alongside any other services you declare.
Compose tasks differ from single-container tasks in 4 ways:
- No snapshots: Compose tasks don’t support
snapshot_id. If you set it, Harbor stops with an error. The compose project builds inside a fresh DinD host on every run. preinstall_packageshas no effect: Harbor ignores it and logs a warning. Put packages in the compose service images instead.- No stream mode:
--streamworks on single-container tasks only. The agent runs in a nested container that the stream tunnel cannot reach. - Size storage generously: Compose pulls and builds layers on top of the DinD host’s own rootfs, so
storage_mbneeds headroom beyond what a single-container task needs for the same images.
allowlist and per-phase overrides. Tensorlake enforces the policy outside the VM, so one policy covers all compose containers. Your compose networks do not change. The DinD host starts with internet access so that docker compose can build and pull images. Harbor then creates the containers, applies the task’s policy, and only then starts the containers. No container runs before the policy is in effect.
To use a custom DinD host image instead of Harbor’s default, for example a smaller or Alpine-based one, pass --ek dind_image=your_dind_image_reference. It must ship dockerd, docker compose, and a systemd-managed docker.service.
Interactive debugging
Open a shell in a task environment
To inspect a task’s environment by hand, start it on Tensorlake and open a shell:tl sbx ssh. Inspect state, rerun tests by hand, and confirm whether the agent or the environment caused the failure. This command needs the Tensorlake CLI (tl) on your PATH.
For Compose tasks, the shell opens on the DinD host. Run docker ps to list the compose containers, and docker exec -it <container> bash to enter the main service.
Stream a running trial
Add--stream to follow the agent’s steps and browse the sandbox files while the trial runs:
harbor view jobs. Harbor’s Stream docs describe the viewer.
Harbor runs a root SSH server inside the sandbox and connects to it through a Tensorlake tunnel. Stream mode needs only TENSORLAKE_API_KEY. It does not need the tl CLI. Stream mode works on single-container tasks only.
If the task image has no SSH server, Harbor installs openssh-server at sandbox start. When the task’s network_mode is not public, Harbor opens access to the apt mirrors for the install only. It then restores the task’s policy and waits until that policy is in effect before the trial starts. To skip this step, include openssh-server in the task image.
Add --no-delete to keep the sandbox after the run for debugging. Delete it when you finish.
Structured logs
Each trial produces structured artifacts:- The agent’s actions and outputs
- What the verifier checked
- Why the trial passed or failed
Next steps
Snapshots
Build an environment once, snapshot it, and restore it for every trial.
Reproducible RL Environments
Use sandboxes as a deterministic reward oracle for RL training loops.