The adapter package keeps its pre-rename name until it is republished under the sandbox name; everything it talks to is Boat.
harbor-box connects the two. It is a Harbor environment adapter (SandboxEnvironment) that maps Harbor’s lifecycle, command, and file operations onto the Boat API, so your Harbor trials run on sandbox machines instead of a local Docker container, E2B, or Modal.
New to both? You only need two things to follow this guide: Python 3.12+ and a Boat API key. No prior Harbor or Boat experience required.
How it fits together
- Harbor owns your task/eval logic and calls an environment to do filesystem and shell work.
harbor-boxis the adapter you plug into Harbor (it imports asharbor_box_environment).- Boat is the machine the work actually happens on.
Set it up
1
Create a Boat account
Sign in at boat.dev with GitHub and start a Boat plan, which includes a free 7-day trial. You need an account to create sandboxes. See the Boat quickstart for the full onboarding walkthrough.
2
Get a Boat API key
Create a key from the API keys tab of the Boat dashboard. Keep it secret: store it in an environment variable, never in source control.
3
Install the package
harbor>=0.14.0) along with httpx and tenacity. Requires Python 3.12+.4
Wire it into Harbor
Point Harbor’s environment at Boat by passing the adapter’s import path when you run a task:That’s it: Harbor trials for this task now run on Boat.
A complete example
This standalone script provisions a sandbox-backed environment and exercises the operations Harbor relies on: running commands, reading files, and writing files. It runs on its own so you can verify your setup before wiring the adapter into a larger Harbor run.hello_sandbox.py
uname output, and exit code 0.
What the adapter maps
Configuration
SandboxEnvironment(...) takes Harbor’s standard arguments (environment_dir, environment_name, session_id, trial_paths, task_env_config) plus these sandbox-specific options:
BOAT_API_KEY is required: pass api_key=... or set the environment variable. The adapter calls preflight() and fails fast if it is missing.
Preparing the environment
Boat runs a ready image; it doesn’t build Docker images. The adapter prepares each sandbox from your Harbor environment directory instead:- Files in the environment directory are uploaded into the sandbox’s working directory at start, so fixtures, configs, and scripts are in place before the agent runs.
- The
Dockerfileis read only for its final-stageWORKDIR; build steps (RUN/COPY/ …) are not executed; install dependencies from a setup command (await env.exec(...)) or your agent. - Environment variables come from the Harbor environment config and are forwarded into the sandbox; per-command env is passed through
exec.
Isolation
Sandboxes are created no-env by default: a trial gets none of your Boat account’s secrets, credentials, or cloned private repos, and can’t act on your account or other sandboxes. This is the right default for evals and for sandboxes you hand to others. Passno_env=False to use your account’s environment instead, configured in the Boat dashboard’s Secrets and Repositories tabs. See Environments.
Not available on Boat
Some Harbor features don’t map to Boat today and raise a clear error: network policies (no-network / allow-lists), Docker image builds / Compose, and GPUs / TPUs / Windows. Run those tasks on a backend that supports them.Resources
PyPI package
harbor-box on PyPI.Source on GitHub
Issues, evals, and the adapter source.
Boat quickstart
Install Boat and create your first sandbox.
Boat API keys
Create and manage the key this adapter needs.