Skip to main content

Harbor environment adapter backed by the Ascii Box public API

Project description

harbor-box

CI

A Harbor environment adapter backed by the Ascii Box public API.

BoxEnvironment runs Harbor agent trials and evals inside an Ascii Box instead of a local Docker container, E2B, or Modal. It implements Harbor's BaseEnvironment surface — lifecycle, command execution, environment variables, and file/dir upload + download — on top of Box's public HTTP API.

Some Harbor features aren't available on Box today: network policies, Docker image builds / Compose, and GPUs / TPUs / Windows.

Layout

Path What
sdks/harbor_box_environment.py BoxEnvironment — the Harbor adapter plus a small async Box API client
sdks/harbor-box-evals/ End-to-end evals: a from-scratch Claude Agent SDK coding agent solving tasks inside a Box

Install

pip install harbor-box                 # imports as: harbor_box_environment

Or from a clone of this repo:

pip install -r requirements.txt        # harbor>=0.14.0, httpx, tenacity

Configure

cp .env.example .env
# fill in BOX_API_KEY

BOX_API_KEY is required — get one at https://box.ascii.dev. Your .env is gitignored; never commit secrets.

Use it with Harbor

export BOX_API_KEY=...
harbor task run path/to/task.yaml \
  --environment-import-path harbor_box_environment:BoxEnvironment

Preparing the environment

Box runs a ready Ubuntu image — it doesn't build Docker images. The adapter prepares each box from your Harbor environment directory instead:

  • Files in the environment directory are uploaded into the box's working directory at start, so fixtures, configs, and scripts are in place before the agent runs.
  • The Dockerfile is read only for its WORKDIR; build steps (RUN / COPY / …) are not executed. Install dependencies from a setup command (await env.exec(...)) or your agent, not the image.
  • Environment variables come from the Harbor environment config and are forwarded into the box; per-command env is passed through exec.
task_env_config = EnvironmentConfig(
    workdir="/workspace",
    env={"DATABASE_URL": "postgres://..."},
)

Isolation

Boxes are no-env by default: a trial gets none of your Box account's secrets, credentials, or cloned repos and can't act on your account or other boxes. Pass no_env=False to use your account's environment instead, configured in the Box dashboard. See Secrets & Setup.

Verify the adapter

A self-contained end-to-end self-test exercises start → persistent/per-command env vars → binary upload/download → nested directory upload/download → stop:

export BOX_API_KEY=...
python sdks/harbor_box_environment.py
# -> Box Harbor adapter e2e self-test PASSED

CI runs this self-test on every push.

Evals

A from-scratch Claude Agent SDK coding agent solving tasks inside a Box, scored by inspecting the result. See sdks/harbor-box-evals/README.md.

Releasing

Maintainers publish harbor-box to PyPI from a local checkout — see docs/release.md. CI never publishes.

License

MIT.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

harbor_box-0.1.0.tar.gz (11.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

harbor_box-0.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

Details for the file harbor_box-0.1.0.tar.gz.

File metadata

  • Download URL: harbor_box-0.1.0.tar.gz
  • Upload date:
  • Size: 11.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for harbor_box-0.1.0.tar.gz
Algorithm Hash digest
SHA256 a737d3f561d6929928746663f666dc900567ae4e8b1cdb810422bfe7643785ad
MD5 7bec32e2d0cdef902078eb51013dbfb2
BLAKE2b-256 766de9810e977c0abe7a9d5449576b208c20b3e1f5d8f77723381ab8f043d373

See more details on using hashes here.

File details

Details for the file harbor_box-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: harbor_box-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.3

File hashes

Hashes for harbor_box-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7e95f30a2fe15b94e9324606eec1436e3ee2a12f8fd374b429e9bb11c720992d
MD5 dca3b89fd621e292fbd034e683653c31
BLAKE2b-256 6c387cd3479caaff302c53fd91dbf3affe9241f6aea35065f19db3ddf77368f3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page