# ACP Source: https://docs.harborframework.com/agents/acp Run agents from the Agent Client Protocol registry. Harbor's generic `acp` integration installs and runs agents from the [ACP Registry](https://agentclientprotocol.com/get-started/registry) inside the task environment. ACP provides a common protocol between clients and agents. > [!NOTE] > > `--agent acp:...` selects an ACP registry agent. It is different from > [`--bridge acp`](/jobs/simulate-a-user), which connects a > simulated user to the target agent. ## Run a registry agent Harbor supports **all acp agents** in the [ACP Registry Github](https://github.com/agentclientprotocol/registry) or [ACP registry.json](https://cdn.agentclientprotocol.com/registry/v1/latest/registry.json). The four agents below are examples. Use `acp:` for the latest entry or `acp:@` to pin a version. > [!WARNING] > > Unlike Harbor's installed agents, ACP agents do not receive provider credentials > automatically. Pass each required variable with `--agent-env` (`--ae`). > > Authentication rules also vary by agent. Some agents require > `--agent-kwarg authenticate_method_id=...` in addition to the credential. Check > the agent's documentation in the > [ACP Registry](https://github.com/agentclientprotocol/registry). > [tab] CLI > > ```bash Codex theme={"system"} > harbor run \ > -t hello-world/hello-world \ > --agent acp:codex-acp \ > --model openai/gpt-5.6-sol \ > --agent-env OPENAI_API_KEY="$OPENAI_API_KEY" \ > --agent-kwarg authenticate_method_id=api-key > ``` > > ```bash Claude Code theme={"system"} > harbor run \ > -t hello-world/hello-world \ > --agent acp:claude-acp \ > --model anthropic/claude-sonnet-5 \ > --agent-env ANTHROPIC_API_KEY="$ANTHROPIC_API_KEY" > ``` > > ```bash Cursor theme={"system"} > harbor run \ > -t hello-world/hello-world \ > --agent acp:cursor \ > --agent-env CURSOR_API_KEY="$CURSOR_API_KEY" \ > --agent-kwarg authenticate_method_id=cursor_login > ``` > > ```bash OpenCode theme={"system"} > harbor run \ > -t hello-world/hello-world \ > --agent acp:opencode \ > --model openai/gpt-5.6-sol \ > --agent-env OPENAI_API_KEY="$OPENAI_API_KEY" > ``` > [tab] Config > > ```json theme={"system"} > { > "agents": [ > { > "name": "acp:codex-acp", > "model_name": "openai/gpt-5.6-sol", > "env": {"OPENAI_API_KEY": "${OPENAI_API_KEY}"}, > "kwargs": {"authenticate_method_id": "api-key"} > } > ] > } > ``` > [tab] Python > > ```python theme={"system"} > from harbor.models.trial.config import AgentConfig > > agent = AgentConfig( > name="acp:codex-acp", > model_name="openai/gpt-5.6-sol", > env={"OPENAI_API_KEY": "${OPENAI_API_KEY}"}, > kwargs={"authenticate_method_id": "api-key"}, > ) > ``` Authentication references: [Codex ACP](https://github.com/agentclientprotocol/codex-acp#authentication), [Claude](https://platform.claude.com/docs/en/manage-claude/authentication), [Cursor ACP](https://cursor.com/docs/cli/acp#authentication), and [OpenCode](https://opencode.ai/docs/providers). ## Common options Pass these options with `--agent-kwarg` (`--ak`) or `agents[].kwargs`: | Option | Default | Purpose | | - | - | - | | `auth_policy` | `auto` | Use `auto`, `explicit`, or `disabled` authentication. | | `authenticate_method_id` | — | Select an ACP authentication method. | | `permission_mode` | `allow` | Allow or deny ACP tool permission requests. | | `distribution_preference` | `binary,npx,uvx` | Set the installation order. | | `registry_ref` | `main` | Set the registry Git ref for unpinned agents. | | `registry_cache_dir` | `.cache/acp-registry` | Set the local registry cache directory. | See the [ACP agent constructor](https://github.com/harbor-framework/harbor/blob/main/src/harbor/agents/installed/acp.py) for all supported options. > [accordion] Use a local registry entry > > Run the generic `acp` agent with a local `agent.json` file: > > ```yaml theme={"system"} > agents: > - name: acp > kwargs: > registry_entry_path: /path/to/agent.json > ``` ## Output ACP runs write `acp.txt`, `acp-events.jsonl`, `acp-summary.json`, and an [ATIF trajectory](/agents/atif) named `trajectory.json` to the agent log directory. # Agent auth resolution Source: https://docs.harborframework.com/agents/agent-auth-resolution Choose models, secrets, endpoints, and API formats for your agents. ## Model name parsing Harbor uses LiteLLM to parse model slugs during setup. Use the **same LiteLLM model slug across all agents**. Browse [Harbor Model Lookup](https://harbortoolkit.com/model?model=openai%2Fgpt-6-sol), or enter a model name below to see its provider and parsed model name.
Model name
> [!NOTE] > > * **Input model (`-m`)** → Your original model name. > * **Parsed provider** → Selects Harbor’s built-in credential and endpoint mappings. > * **Parsed model ID** → Usually sent to the inference provider; adapters may transform it. Try `openai/gpt-6-sol`, `openrouter/openai/gpt-6-sol`, `anthropic/claude-sonnet-5-5`, `deepseek/deepseek-v4-flash`, or `fireworks_ai/accounts/my-account/models/my-custom-model`. Model slugs that cannot be parsed by LiteLLM are forwarded directly to the agent. Each agent adapter may then infer the provider from the model slug. ## Automatic Secret Collection For recognized [providers](https://harbortoolkit.com/model?model=openai%2Fgpt-6-sol) and built-in [agents](https://harbortoolkit.com/agent?agent=codex), Harbor supports automatic secret collection from host environment variables. This behavior is agent and provider specific, unrelated host variables are not forwarded. See your agent’s [auth settings](#inspecting-agent-auth-settings). > [tab] Provider Match > > ```bash theme={"system"} > export OPENROUTER_API_KEY="sk-or-v1-...1234" > export HF_TOKEN="hf_...3456" > harbor run \ > -t hello-world/hello-world \ > --agent codex \ > --model openrouter/openai/gpt-5.6-sol \ > ``` > > > [accordion] See collected secrets > > > > ```text nocopy theme={"system"} > > Collected from host: OPENROUTER_API_KEY > > Not forwarded to agent: HF_TOKEN > > ``` > [tab] Agent Match > > ```bash theme={"system"} > export ANTHROPIC_API_KEY="sk-ant-api03-...9012" > harbor run \ > -t hello-world/hello-world \ > --agent claude-code \ > --model vercel_ai_gateway/z-ai/glm-5.3 > ``` > > > [accordion] See collected secrets > > > > ```text nocopy theme={"system"} > > Collected from host: ANTHROPIC_API_KEY > > ``` > [tab] Explicitly Provided > > ```bash theme={"system"} > harbor run \ > -t hello-world/hello-world \ > --agent mini-swe-agent \ > --model openai/gpt-6-sol \ > --agent-env OPENAI_API_KEY="sk-proj-...5678" > ``` > > > [accordion] See collected secrets > > > > ```text nocopy theme={"system"} > > Collected from --agent-env: OPENAI_API_KEY > > ``` > [accordion] Common automatic secret collection > > | Provider | Recognized host variables | > | - | - | > | `openai`, `openai-responses` | `OPENAI_API_KEY` | > | `anthropic` | `ANTHROPIC_API_KEY` | > | `openrouter` | `OPENROUTER_API_KEY` | > | `gemini`, `google` | `GOOGLE_API_KEY`, `GEMINI_API_KEY`, `GOOGLE_GENERATIVE_AI_API_KEY` | > | `azure` | `AZURE_API_KEY`, `AZURE_OPENAI_API_KEY` | > | `amazon-bedrock`, `bedrock` | `AWS_BEARER_TOKEN_BEDROCK` and standard AWS credential variables | > | `vercel_ai_gateway`, `vercel` | `VERCEL_AI_GATEWAY_API_KEY`, `AI_GATEWAY_API_KEY` | > | `meta` | `META_API_KEY`, `MODEL_API_KEY` | > | `xai` | `XAI_API_KEY` | > | `mistral` | `MISTRAL_API_KEY` | > | `deepseek` | `DEEPSEEK_API_KEY` | > | `groq` | `GROQ_API_KEY` | > | `kimi` | `KIMI_API_KEY`, `MOONSHOT_API_KEY` | > | `moonshot` | `MOONSHOT_API_KEY` | > | `huggingface` | `HF_TOKEN`, `HUGGINGFACE_API_KEY` | > | `together`, `together_ai` | `TOGETHER_API_KEY`, `TOGETHERAI_API_KEY` | > | `fireworks_ai` | `FIREWORKS_API_KEY` | > | `nvidia` | `NVIDIA_API_KEY` | > | `opencode` | `OPENCODE_API_KEY` | > > These agent-specific variables are recognized in addition to provider variables. > > | Agent | Recognized host variables | > | - | - | > | `codex` | `OPENAI_API_KEY`, `CODEX_API_KEY` | > | `claude-code` | `ANTHROPIC_API_KEY`, `ANTHROPIC_AUTH_TOKEN`, `CLAUDE_CODE_OAUTH_TOKEN` | > | `gemini-cli` | `GEMINI_API_KEY` | > | `antigravity-cli` | `GEMINI_API_KEY`, `GOOGLE_API_KEY` | > | `antigravity-sdk` | `GEMINI_API_KEY` | > | `copilot-cli` | `COPILOT_GITHUB_TOKEN`, `GH_TOKEN`, `GITHUB_TOKEN`; custom providers: `COPILOT_PROVIDER_API_KEY`, `COPILOT_PROVIDER_BEARER_TOKEN` | > | `cursor-cli` | `CURSOR_API_KEY` | > | `fx` | `AI_GATEWAY_API_KEY`, `VERCEL_AI_GATEWAY_API_KEY`, `VERCEL_OIDC_TOKEN` | > | `muse-code` | `META_API_KEY` | > | `openhands`, `openhands-sdk` | `LLM_API_KEY` | > | `mini-swe-agent` | `MSWEA_API_KEY` | > | `goose`, `mimo`, `opencode`, `pi`, `qwen-coder`, `trae-agent` | `OPENAI_API_KEY` | > > ACP registry agents do not use this automatic forwarding; always pass their credentials > with `--agent-env`. ## Automatic Secret Routing For built-in agents, Harbor automatically matches model provider secrets to the expected agent api key name. This means you can use your `OPENROUTER_API_KEY` even though Codex reads `OPENAI_API_KEY`; Harbor handles the rename for you. For example, when using OpenRouter with Codex, **Codex only expects** the API key in `OPENAI_API_KEY`. Harbor assigns the value of `OPENROUTER_API_KEY` to `OPENAI_API_KEY` so Codex can authenticate with OpenRouter. This lets you use one provider key, such as `OPENROUTER_API_KEY`, across multiple agents without knowing each agent's native credential variable name. It is especially useful for benchmark sweeps that compare different agents using the same model and provider. > [tab] Provider Match > > ```bash theme={"system"} > export OPENROUTER_API_KEY="sk-or-v1-...1234" > export HF_TOKEN="hf_...3456" > harbor run \ > -t hello-world/hello-world \ > --agent codex \ > --model openrouter/openai/gpt-5.6-sol \ > ``` > > > [accordion] See routed secrets > > > > ```text nocopy theme={"system"} > > Collected from host: OPENROUTER_API_KEY > > Automatic Routing: OPENROUTER_API_KEY -> OPENAI_API_KEY > > Codex reads: OPENAI_API_KEY > > ``` > [tab] Agent Match > > ```bash theme={"system"} > export ANTHROPIC_API_KEY="sk-ant-api03-...9012" > harbor run \ > -t hello-world/hello-world \ > --agent claude-code \ > --model vercel_ai_gateway/z-ai/glm-5.3 > ``` > > > [accordion] See routed secrets > > > > ```text nocopy theme={"system"} > > Collected from host: ANTHROPIC_API_KEY > > Automatic Routing: ANTHROPIC_API_KEY -> ANTHROPIC_API_KEY (nop) > > Claude Code reads: ANTHROPIC_API_KEY > > ``` > [tab] Explicitly Provided > > ```bash theme={"system"} > harbor run \ > -t hello-world/hello-world \ > --agent mini-swe-agent \ > --model openai/gpt-6-sol \ > --agent-env OPENAI_API_KEY="sk-proj-...5678" > ``` > > > [accordion] See routed secrets > > > > ```text nocopy theme={"system"} > > Collected from --agent-env: OPENAI_API_KEY > > Automatic Routing: OPENAI_API_KEY -> OPENAI_API_KEY (nop) > > Mini SWE Agent reads: OPENAI_API_KEY > > ``` ## Automatic Secret Routing rules > [!TIP] > > **Recommended: use `--dry-run` first.** You don't need to understand all the routing > rules—it shows the resolved credential, endpoint, model, and API format. When multiple secrets are supplied that match either the provider or the agent, Harbor uses the following precedence rules to determine which secret is utilized. 1. `--api-key-name ENV_VAR_NAME` 2. `--agent-env ENV_VAR_NAME` matching the parsed model slug's provider 3. `--agent-env ENV_VAR_NAME` matching the chosen agent's declared defaults 4. Host environment variables matching the parsed model slug's provider 5. Host environment variables matching the chosen agent's declared provider Use `harbor run --dry-run` to see which variable will be chosen in order of precedence. > [tab] OpenAI > > ```bash theme={"system"} > export OPENAI_API_KEY="sk-proj-...5678" > harbor run --dry-run \ > -t hello-world/hello-world \ > -a codex \ > -m openai/gpt-6-sol > ``` > > > [accordion] ▶ Run > > > > | Setting | Value | > > | - | - | > > | Parsed provider | `openai` | > > | Resolved model | `gpt-6-sol` | > > | Endpoint | `https://api.openai.com/v1` | > > | API format | `openai_responses` | > > | API key precedence | `1. --api-key-name — not set` `2. --ae OPENAI_API_KEY — not set` `3. --ae CODEX_API_KEY — not set` `4. ambient OPENAI_API_KEY — selected (********5678)` `5. ambient CODEX_API_KEY — not set` | > > | Base URL precedence | `1. --base-url — not set` `2. --ae OPENAI_BASE_URL — not set` `3. --ae OPENAI_API_BASE — not set` `4. ambient OPENAI_BASE_URL — not set` `5. ambient OPENAI_API_BASE — not set` `6. Default base URL — selected (https://api.openai.com/v1)` | > [tab] Provider precedence > > ```bash theme={"system"} > export OPENAI_API_KEY="sk-proj-...5678" > export OPENROUTER_API_KEY="sk-or-v1-...1234" > harbor run --dry-run \ > -t hello-world/hello-world \ > -a codex \ > -m openrouter/openai/gpt-6-sol > ``` > > > [accordion] ▶ Run > > > > | Setting | Value | > > | - | - | > > | Parsed provider | `openrouter` | > > | Resolved model | `openai/gpt-6-sol` | > > | Endpoint | `https://openrouter.ai/api/v1` | > > | API format | `openai_responses` | > > | API key precedence | `1. --api-key-name — not set` `2. --ae OPENROUTER_API_KEY — not set` `3. --ae OPENAI_API_KEY — not set` `4. --ae CODEX_API_KEY — not set` `5. ambient OPENROUTER_API_KEY — selected (********1234)` `6. ambient OPENAI_API_KEY — not selected (********5678)` `7. ambient CODEX_API_KEY — not set` | > > | Base URL precedence | `1. --base-url — not set` `2. --ae OPENROUTER_BASE_URL — not set` `3. --ae OPENAI_BASE_URL — not set` `4. ambient OPENROUTER_BASE_URL — not set` `5. ambient OPENAI_BASE_URL — not set` `6. Default base URL — selected (https://openrouter.ai/api/v1)` | > [tab] Explicit overrides > > ```bash theme={"system"} > export OPENAI_API_KEY="sk-proj-...5678" > export OPENROUTER_API_KEY="sk-or-v1-...1234" > harbor run --dry-run \ > -t hello-world/hello-world \ > -a codex \ > -m openrouter/openai/gpt-6-sol \ > --ae NEW_ENV_VAR="sk-or-v1-...7890" \ > --api-key-name NEW_ENV_VAR \ > --base-url https://directly-supplied-url.fake > ``` > > > [accordion] ▶ Run > > > > | Setting | Value | > > | - | - | > > | Parsed provider | `openrouter` | > > | Resolved model | `openai/gpt-6-sol` | > > | Endpoint | `https://directly-supplied-url.fake` | > > | API format | `openai_responses` | > > | API key precedence | `1. --api-key-name NEW_ENV_VAR — selected (********7890)` `2. --ae OPENROUTER_API_KEY — not set` `3. --ae OPENAI_API_KEY — not set` `4. --ae CODEX_API_KEY — not set` `5. ambient OPENROUTER_API_KEY — not selected (********1234)` `6. ambient OPENAI_API_KEY — not selected (********5678)` `7. ambient CODEX_API_KEY — not set` | > > | Base URL precedence | `1. --base-url — selected (https://directly-supplied-url.fake)` `2. --ae OPENROUTER_BASE_URL — not set` `3. --ae OPENAI_BASE_URL — not set` `4. ambient OPENROUTER_BASE_URL — not set` `5. ambient OPENAI_BASE_URL — not set` `6. Default base URL — not selected (https://openrouter.ai/api/v1)` | Use the **Model Auth Override** options in `harbor run`, `harbor job start`, or `harbor trial start` when you need a different endpoint, credential variable, or API format: | CLI option | AgentConfig field | Purpose | | - | - | - | | `--base-url` | `model_base_url` | Set the inference endpoint. | | `--api-key-name` | `model_api_key_name` | Read the key from this environment variable. | | `--api-format` | `model_api_format` | Select a supported API format. | > [!NOTE] > > `--base-url`, `--api-key-name`, and `--api-format` can each be > used independently, **without `--skip-model-parsing-and-provider-mapping`**. When you enable > `--skip-model-parsing-and-provider-mapping`, you will typically use these overrides together to > specify the endpoint, credential variable, and API format explicitly. Base URL environment variable injection follows the same selection and routing rules as credentials. ## Advanced ### Parsing and credential mapping under the hood LiteLLM splits the model name into a provider and model ID. Harbor then looks up that provider in `PROVIDERS` and combines its credential and endpoint candidates with the agent's declared fallbacks and any explicit overrides. If parsing does not identify a provider, Harbor uses the agent's `default_provider`. After applying precedence, Harbor writes the selected credential value to the agent's declared destination. In this Codex example, the value of `OPENROUTER_API_KEY` is injected as `OPENAI_API_KEY`. ![Model parsing and credential routing: LiteLLM identifies OpenRouter, Harbor applies overrides then provider credentials then Codex fallbacks, and injects the selected value into OPENAI\_API\_KEY.](https://mintcdn.com/harborframework/vzYWOwnch5t54m5e/images/agent-auth-resolution/parsing-and-routing-light.svg?fit=max\&auto=format\&n=vzYWOwnch5t54m5e\&q=85\&s=a82a3e693975b9bbf7732795a7f57376) ### Skipping model parsing and credential mapping In certain cases, such as hosting a local model, it may be necessary to skip the model name parsing and subsequent credential mapping. To accomplish this, use `--skip-model-parsing-and-provider-mapping` (or `--sm`) in your `harbor run` command. With `--skip-model-parsing-and-provider-mapping`, Harbor preserves the model name exactly and uses `harbor-skip-parsing` as the provider marker. The red steps above (LiteLLM parsing and provider mapping) are skipped. The agent's declared fallbacks, explicit overrides, precedence, and credential injection still apply. In this example, `--api-key-name CUSTOM_KEY` selects the value of `CUSTOM_KEY`, which Codex receives as `OPENAI_API_KEY`. Skipping parsing does not disable this final injection step. ![Skipping model parsing: the local model path is preserved, provider lookup is bypassed, and an explicit CUSTOM\_KEY override is injected into Codex as OPENAI\_API\_KEY.](https://mintcdn.com/harborframework/vzYWOwnch5t54m5e/images/agent-auth-resolution/skip-parsing-light.svg?fit=max\&auto=format\&n=vzYWOwnch5t54m5e\&q=85\&s=7dcb546dc0aade44986023bf9691d408) ### Inspecting agent auth settings Browse [Harbor Agent Auth Lookup](https://harbortoolkit.com/agent) to see each agent’s credential mappings, default endpoints, and supported API format overrides. Use `harbor agent auth ` to inspect an agent's default provider, credential and endpoint routing, and supported API formats. > [tab] Grok Build > > ```bash theme={"system"} > harbor agent auth grok-build > ``` > > > [accordion] ▶ Run > > > > **Harbor provider defaults (bypassed by `--skip-model-parsing-and-provider-mapping`)** > > > > | Setting | Value | > > | - | - | > > | Default provider | `xai` | > > | Default base URL | `https://api.x.ai/v1` | > > | Provider API key names | `XAI_API_KEY` | > > | Provider base URL names | `XAI_BASE_URL` | > > | Provider extra environment variables | none | > > > > **Agent connection settings** > > > > | Setting | Contract | > > | - | - | > > | Default API key names | `XAI_API_KEY` | > > | API key injected into | `default: XAI_API_KEY` `openai_chat_completions: OPENAI_API_KEY` `openai_responses: OPENAI_API_KEY` `anthropic_messages: ANTHROPIC_API_KEY` | > > | Default base URL name | `XAI_BASE_URL` | > > | Base URL injected into | unknown | > > | Supported API formats | `openai_chat_completions`, `openai_responses`, `anthropic_messages` | > > | Default API formats | `default: openai_chat_completions` `openai: openai_responses` `anthropic: anthropic_messages` `openrouter: openai_chat_completions` | > > | Accepts custom base URL | yes (`--base-url`) | > > | Accepts credential selector | yes (`--api-key-name`) | > [tab] Codex > > ```bash theme={"system"} > harbor agent auth codex > ``` > > > [accordion] ▶ Run > > > > **Harbor provider defaults (bypassed by `--skip-model-parsing-and-provider-mapping`)** > > > > | Setting | Value | > > | - | - | > > | Default provider | `openai` | > > | Default base URL | `https://api.openai.com/v1` | > > | Provider API key names | `OPENAI_API_KEY` | > > | Provider base URL names | `OPENAI_BASE_URL`, `OPENAI_API_BASE` | > > | Provider extra environment variables | none | > > > > **Agent connection settings** > > > > | Setting | Contract | > > | - | - | > > | Default API key names | `OPENAI_API_KEY`, `CODEX_API_KEY` | > > | API key injected into | `default: OPENAI_API_KEY` | > > | Default base URL name | `OPENAI_BASE_URL` | > > | Base URL injected into | `default: OPENAI_BASE_URL` | > > | Supported API formats | `openai_responses` | > > | Default API formats | `default: openai_responses` | > > | Accepts custom base URL | yes (`--base-url`) | > > | Accepts credential selector | yes (`--api-key-name`) | > [tab] Mini SWE Agent > > ```bash theme={"system"} > harbor agent auth mini-swe-agent > ``` > > > [accordion] ▶ Run > > > > **Harbor provider defaults (bypassed by `--skip-model-parsing-and-provider-mapping`)** > > > > | Setting | Value | > > | - | - | > > | Default provider | none | > > | Default base URL | none | > > | Provider API key names | none | > > | Provider base URL names | none | > > | Provider extra environment variables | none | > > > > **Agent connection settings** > > > > | Setting | Contract | > > | - | - | > > | Default API key names | `MSWEA_API_KEY` | > > | API key injected into | Determined by model slug and API format | > > | Default base URL name | `OPENAI_BASE_URL`, `OPENAI_API_BASE` | > > | Base URL injected into | `default: OPENAI_BASE_URL` `anthropic_messages: ANTHROPIC_API_BASE` | > > | Supported API formats | `openai_chat_completions`, `openai_responses`, `anthropic_messages` | > > | Default API formats | `gemini: google_generate_content` `amazon-bedrock: bedrock_converse` | > > | Accepts custom base URL | yes (`--base-url`) | > > | Accepts credential selector | yes (`--api-key-name`) | ### Selecting API formats An API format defines how the agent communicates with the model provider. Claude Code supports only Anthropic Messages, while agents such as Grok Build support multiple formats. Harbor selects the agent's default format for the provider identified by LiteLLM. Use `--api-format` to override this default. Values are `openai_responses`, `openai_chat_completions`, `anthropic_messages`, `google_generate_content`, and `bedrock_converse`. Each agent accepts only the formats it supports. ### Routing across API formats The provider determines where Harbor looks for credentials and which endpoint it uses. The agent's selected API format determines how it sends requests and which variable receives the credential. These can differ even for the same agent. Some agents read the same credential variable for every provider; others change it based on the API format. Grok Build is an example of the latter: | Model provider | API format | Credential routing | | - | - | - | | `anthropic` | Anthropic Messages | `ANTHROPIC_API_KEY` → `ANTHROPIC_API_KEY` | | `openai` | OpenAI Responses | `OPENAI_API_KEY` → `OPENAI_API_KEY` | | `openrouter` | OpenAI Chat Completions | `OPENROUTER_API_KEY` → `OPENAI_API_KEY` | In the OpenRouter case, `OPENAI_API_KEY` is the variable Grok Build reads; requests still go to OpenRouter using the OpenRouter credential. For a custom endpoint, use `--api-format` to select its protocol, `--api-key-name` to select the credential source, and `--base-url` to select the endpoint. The agent still determines the destination variable. ### Local Models Local models may require explicit routing to preserve the model name and select the endpoint and credential. This Codex example assumes a vLLM server with Responses and tool calling support, serving the model as `/dev/shm/my-model`: ```bash theme={"system"} export VLLM_API_KEY="dummy" harbor run \ -t hello-world/hello-world \ -a codex \ -m /dev/shm/my-model \ --skip-model-parsing-and-provider-mapping \ --api-key-name VLLM_API_KEY \ --base-url http://host.docker.internal:8000/v1 ``` vLLM does not require authentication by default; if you enable `--api-key`, set `VLLM_API_KEY` to that value. Replace the URL with your server's address as seen from the agent environment. `host.docker.internal` reaches the host from Docker on macOS; `localhost` inside the agent refers to its own container. # ATIF Source: https://docs.harborframework.com/agents/atif Record and exchange agent trajectories in a standard JSON format. The **Agent Trajectory Interchange Format (ATIF)** records an agent's complete interaction history as JSON: messages, reasoning, tool calls, observations, and metrics. ## Why Agents produce [different native logs](/jobs/loading-trajectories#native-trajectories). Without a shared format, every viewer, dataset, and training pipeline needs an agent-specific parser. ATIF provides one stable representation across agents, making trajectories easier to inspect, compare, validate, load, and reuse. See the [ATIF RFC](https://github.com/harbor-framework/harbor/blob/main/rfcs/0001-trajectory-format.md) for the complete specification. ## `trajectory.json` in Harbor > [!NOTE] > > In Harbor, an ATIF trajectory is usually named **`trajectory.json`**. Agents with `capabilities.atif = true` write it to the agent log directory. In a downloaded trial result, the path is `agent/trajectory.json`. Harbor uses this file to: * **Render trajectories:** The [results viewer](/results/view-job-results#start-the-viewer) reads `agent/trajectory.json` and displays its steps in the **Trajectory** tab. * **Load trajectories:** Supported agents can use an [ATIF trajectory](/jobs/loading-trajectories#atif-trajectories) to seed a new session. > [!NOTE] > > Producing ATIF and loading ATIF are separate capabilities. An agent may write > `trajectory.json` without supporting [loading trajectories](/jobs/loading-trajectories). Custom agents should declare `AgentCapabilities(atif=True)` only when they write a valid `self.logs_dir / "trajectory.json"`. ## Structure Harbor's current format is `ATIF-v1.8`. A trajectory contains: | Field | Purpose | | - | - | | `agent` | Agent name, version, model, and optional tool definitions. | | `steps` | Ordered system, user, and agent interactions. | | `session_id` | Optional identifier shared by trajectories from one run. | | `trajectory_id` | Optional document identifier; required for embedded subagents. | | `final_metrics` | Optional aggregate token, cost, and step metrics. | | `subagent_trajectories` | Optional embedded ATIF trajectories. | | `extra` | Custom root-level metadata. | Step IDs start at `1` and remain sequential. Agent steps can include `tool_calls`, matching `observation` results, and per-step `metrics`. ```json theme={"system"} { "schema_version": "ATIF-v1.8", "session_id": "session-123", "agent": { "name": "my-agent", "version": "1.0.0", "model_name": "openai/gpt-5.6-sol" }, "steps": [ { "step_id": 1, "source": "user", "message": "Create hello.txt." }, { "step_id": 2, "source": "agent", "message": "I'll create it.", "tool_calls": [ { "tool_call_id": "call-1", "function_name": "write_file", "arguments": {"path": "hello.txt", "content": "Hello"} } ], "observation": { "results": [ {"source_call_id": "call-1", "content": "File created"} ] } } ] } ``` > [accordion] Build with Harbor models > > Harbor provides Pydantic models in `harbor.models.trajectories`: > > ```python theme={"system"} > import json > from pathlib import Path > > from harbor.models.trajectories import Agent, Step, Trajectory > > trajectory = Trajectory( > agent=Agent(name="my-agent", version="1.0.0"), > steps=[ > Step(step_id=1, source="user", message="Create hello.txt."), > Step(step_id=2, source="agent", message="Done."), > ], > ) > > Path("trajectory.json").write_text( > json.dumps(trajectory.to_json_dict(), indent=2) + "\n" > ) > ``` ## Validate a trajectory ```bash theme={"system"} uv run python -m harbor.utils.trajectory_validator path/to/trajectory.json ``` Validation checks the schema, sequential step IDs, tool-call references, timestamps, and referenced local images. Use `--no-validate-images` to skip the image-file check. > [accordion] Validate in Python > > ```python theme={"system"} > from harbor.utils.trajectory_validator import TrajectoryValidator > > validator = TrajectoryValidator() > > if not validator.validate("trajectory.json"): > for error in validator.get_errors(): > print(error) > ``` ## Versions and extensions Harbor accepts `ATIF-v1.0` through `ATIF-v1.8`. Version 1.8 adds audio content parts with referenced audio files and optional durations. Version 1.7 adds embedded subagent trajectories, per-document trajectory IDs, `llm_call_count`, and additional extension fields. See the [RFC changelog](https://github.com/harbor-framework/harbor/blob/main/rfcs/0001-trajectory-format.md#version-history) for earlier versions. > [!TIP] > > Use the schema's `extra` fields for custom metadata. Harbor's Pydantic models > reject undeclared fields. ## Resources [ATIF RFC](https://github.com/harbor-framework/harbor/blob/main/rfcs/0001-trajectory-format.md), [Harbor trajectory models](https://github.com/harbor-framework/harbor/tree/main/src/harbor/models/trajectories), [Valid trajectory examples](https://github.com/harbor-framework/harbor/tree/main/tests/golden), [Trajectory validator](https://github.com/harbor-framework/harbor/blob/main/src/harbor/utils/trajectory_validator.py) # Base URL management Source: https://docs.harborframework.com/agents/base-url-management Base URL management for networking and configuration. There are three ways Harbor handles provider routing, depending on the user, agent integration, and agent itself. 1. The agent handles provider routing (e.g. OpenCode, Mini-SWE-Agent) 2. The Harbor integration handles provider routing by setting the `base_url` based on the requested provider (e.g. Codex, Claude Code) 3. The user handles provider routing by setting `--base-url` or `model_base_url` in the job config. We recommend deferring as much routing functionality as possible to the agent and falling back to the Harbor integration when possible, while always allowing the user to explicitly set routing. # Auto-allowlisting base URLs Harbor will attempt to automatically allowlist an agent's inference endpoint under the following conditions: * No allowed hosts were explicitly set for the agent (`--allow-agent-host`) * The agent-phase network mode of a task is `no-network` or `allowlist` * The agent has not opted out of auto-allowlisting Harbor picks the `base_url` to allowlist based on the following precedence: 1. The `base_url` explicitly set by the user ([case (3)](#provider-routing)) 2. The `base_url` set by the Harbor integration ([case (2)](#provider-routing)) 3. Harbor’s best guess of the agent’s `base_url` ([case (1)](#provider-routing)) > [!WARNING] > > In rare cases, (3) may result in Harbor allowlisting the wrong `base_url`, especially for providers whose inference endpoints have changed over time (e.g. together.xyz -> together.ai). In this case, the user will need to explicitly set `--base-url`. # Custom agents Source: https://docs.harborframework.com/agents/custom-agents Integrate and run your own agent with Harbor. Custom agents are integrations developed outside Harbor's built-in registry. They may be local work in progress or private integrations not intended for upstream. A custom agent can be either **installed** or **external**. | Type | How it runs | Example | | - | - | - | | Installed agent | Harbor installs and runs the agent CLI inside the task environment. | [Claude Code](https://github.com/harbor-framework/harbor/blob/main/src/harbor/agents/installed/claude_code.py) | | External agent | The agent loop runs in Harbor and controls the task environment through `BaseEnvironment`. | [Terminus-2](https://github.com/harbor-framework/harbor/blob/main/src/harbor/agents/terminus_2/terminus_2.py) | > [!TIP] > > When adding a new agent locally or integrating one into Harbor, **prefer** > `BaseInstalledAgent`. Most agent integrations follow this design. Use > `BaseAgent` **only when** the agent loop must remain outside the task environment. Before adding model parsing or credential and endpoint routing, check whether Harbor's [built-in agent auth resolution](#agent-auth-resolution) already covers the requirement. Reuse its mappings and resolved values in your harness. Choose the base class based on where the agent runs. > [tab] Installed agent > > Extend `BaseInstalledAgent` when Harbor should install and run the agent CLI > inside the task environment. > > ```python my_agent.py theme={"system"} > import shlex > > from harbor.agents.installed.base import ( > BaseInstalledAgent, > with_prompt_template, > ) > from harbor.environments.base import BaseEnvironment > from harbor.models.agent.context import AgentContext > > > class MyAgent(BaseInstalledAgent): > @staticmethod > def name() -> str: > return "my-agent" > > async def install(self, environment: BaseEnvironment) -> None: > await self.exec_as_agent( > environment, > command="pip install my-agent", > ) > > @with_prompt_template > async def run( > self, > instruction: str, > environment: BaseEnvironment, > context: AgentContext, > ) -> None: > await self.exec_as_agent( > environment, > command=f"my-agent {shlex.quote(instruction)}", > ) > ``` > > Use `exec_as_root` for system packages and `exec_as_agent` for user-level > installation and execution. Override `populate_context_post_run` to parse > usage or trajectory data after the logs are synced. > > `install()` is skipped when users pass `--ak skip_install=true`, so keep it > to what could be baked into the image. Steps that must run on every trial, > such as uploading a runner script, writing credentials, or registering MCP > servers and skills, belong in `configure()`, which runs after `install()` > and also when it is skipped. Reconstruct any required in-memory state from > the installed files in `configure()` so it doesn't depend on `install()` > running in the same process. > [tab] External agent > > Extend `BaseAgent` when the agent loop runs outside the task environment and > controls it through `BaseEnvironment`. > > ```python my_agent.py theme={"system"} > from harbor.agents.base import BaseAgent > from harbor.environments.base import BaseEnvironment > from harbor.models.agent.context import AgentContext > > > class MyAgent(BaseAgent): > @staticmethod > def name() -> str: > return "my-agent" > > def version(self) -> str | None: > return "1.0.0" > > async def setup(self, environment: BaseEnvironment) -> None: > pass > > async def run( > self, > instruction: str, > environment: BaseEnvironment, > context: AgentContext, > ) -> None: > # Call your model and act through environment.exec(...). > pass > ``` ## Run a custom agent Custom agents are not registered by name, so pass `module.path:ClassName` to `--agent` (`-a`). The module must be importable from the Harbor process. ```bash theme={"system"} harbor run \ -t hello-world/hello-world \ -a examples.agents.marker_agent:MarkerAgent ``` Use `--model` (`-m`) if the agent takes a model, `--agent-kwarg` (`--ak`) for other constructor options, and `--agent-env` (`--ae`) for environment variables. > [card] [Custom agent example](https://github.com/harbor-framework/harbor/blob/main/examples/agents/marker_agent.py) > > See a complete `BaseAgent` implementation in the Harbor repository. ## Agent auth resolution For inference connections, accept the same model slug users pass to other agents ([model lookup](/agents/agent-auth-resolution#model-name-parsing)). With `MODEL_CONNECTION` declared, use `self.model_connection.provider` and `self.model_connection.model_id` for the resolved provider and model ID. These respect `--skip-model-parsing-and-provider-mapping`; unresolved model names remain unchanged. For a LiteLLM client, pass `self.model_name` verbatim instead of rebuilding a slug from those parts. Handle client-specific formatting inside the adapter, and preserve native identifiers and authentication for other backends, such as Tinker. Declare the connection your runtime supports: Use `agent_provider_access` for the agent's credential and endpoint input names. These are fallbacks after the selected provider's names within each environment source. ```python theme={"system"} from harbor.agents.agent_auth_resolution import ModelConnectionSpec, ProviderAccess from harbor.agents.capabilities import AgentCapabilities from harbor.models.model_api_format import ModelApiFormat class MyAgent(BaseInstalledAgent): capabilities = AgentCapabilities(base_url=True) MODEL_CONNECTION = ModelConnectionSpec( default_provider="openai", agent_provider_access=ProviderAccess( api_key_candidate_names=["MY_AGENT_API_KEY", "OPENAI_API_KEY"], base_url_candidate_names=["MY_AGENT_BASE_URL"], ), supported_api_formats=[ModelApiFormat.OPENAI_CHAT_COMPLETIONS], default_api_format_by_provider={ "default": ModelApiFormat.OPENAI_CHAT_COMPLETIONS, }, ) ``` In `default_api_format_by_provider`, a provider match takes precedence over `"default"`. Use `ModelApiFormat` members in declarations and resolved connections. Native defaults can include formats that the adapter does not support as explicit overrides. Declare `AgentCapabilities(base_url=True)` only when the adapter applies `--base-url`. For an SDK, pass the resolved values directly to its constructor: ```python theme={"system"} connection = self.model_connection client = Client(api_key=connection.api_key, base_url=connection.execution_base_url) model_id = connection.model_id ``` For a client that reads environment variables, also declare the variable names it reads in `MODEL_CONNECTION`: ```python theme={"system"} api_key_destination_names={"default": "MY_CLIENT_API_KEY"}, base_url_destination_names={"default": "MY_CLIENT_BASE_URL"}, ``` Pass `self.model_connection.env` to the client's execution environment. The resolver selects the credential and maps it to the declared variable. In either dictionary, additional keys can name API formats or providers. A matching API format takes precedence over a provider match, then `"default"`. Adapter hooks can override the destination for native configuration or authentication. When no entry matches, Harbor forwards the selected value using the provider's or selected transport's environment variable names. Provider `extra_env_names` are forwarded independently, using scoped agent values before ambient values. Preserve native settings unless the corresponding common override is supplied. Declare only API formats your adapter implements, and reject unsupported formats clearly. Inspect your declaration with: ```bash theme={"system"} harbor agent auth module.path:MyAgent --json ``` See [auth resolution settings](/agents/agent-auth-resolution) for common options and credential precedence. # Pre-integrated agents Source: https://docs.harborframework.com/agents/pre-integrated-agents Run agents supported by Harbor. Harbor includes integrations for many agents so that you don't have to install any dependencies. > [tab] CLI > > ```bash theme={"system"} > export OPENAI_API_KEY="..." > harbor run \ > -t hello-world/hello-world \ > -a codex -m openai/gpt-5.6-sol > ``` > [tab] Config > > ```json config.json theme={"system"} > { > "agents": [ > { > "name": "codex", > "model_name": "openai/gpt-5.6-sol" > } > ], > "tasks": [ > { > "name": "hello-world/hello-world" > } > ] > } > ``` > > ```bash theme={"system"} > export OPENAI_API_KEY="..." > harbor run --config config.json > ``` > [tab] Python > > ```python theme={"system"} > import asyncio > > from harbor.job import Job > from harbor.models.job.config import JobConfig > from harbor.models.trial.config import AgentConfig, TaskConfig > > > async def main(): > job = await Job.create( > JobConfig( > agents=[ > AgentConfig( > name="codex", > model_name="openai/gpt-5.6-sol", > ) > ], > tasks=[TaskConfig(name="hello-world/hello-world")], > ) > ) > await job.run() > > > asyncio.run(main()) > ``` Use `-a` to select the agent and `-m` to select its model. Run `harbor run --help` for the current options. ## Available agents > [accordion] Agent names > > `aider`, `antigravity-cli`, `antigravity-sdk`, `claude-code`, `cline-cli`, > `codex`, `computer-1`, `copilot-cli`, `cortex-code`, `cursor-cli`, `deerflow`, > `devin`, `dspy-rlm`, `eve`, `fx`, `gemini-cli`, `goose`, `grok-build`, > `hermes`, `junie`, `kimi-code`, `kimi-cli`, `langgraph`, `mcode`, > `mimo`, `mini-swe-agent`, `muse-code`, `nemo-agent`, `openclaw`, `opencode`, > `openhands`, `openhands-sdk`, `oracle`, `nop`, `pi`, `qwen-coder`, > `rovodev-cli`, `strands`, `swe-agent`, `terminus-2`, `trae-agent`, `vibe`, `fabric` You can also run agents from the [ACP registry](/agents/acp) or add a [custom agent](/agents/custom-agents). ## Agent capabilities Capabilities describe optional features supported by each integration. | Capability | Purpose | Supported agents | | - | - | - | | [ATIF](/agents/atif) | Produce an ATIF trajectory | `acp`, `antigravity-cli`, `antigravity-sdk`, `claude-code`, `cline-cli`, `codex`, `computer-1`, `copilot-cli`, `cortex-code`, `cursor-cli`, `devin`, `eve`, `gemini-cli`, `goose`, `grok-build`, `hermes`, `junie`, `kimi-cli`, `mimo`, `mini-swe-agent`, `nemo-agent`, `openclaw`, `opencode`, `openhands`, `openhands-sdk`, `qwen-coder`, `rovodev-cli`, `strands`, `swe-agent`, `terminus-2`, `trae-agent`, `vibe`, `pi`, `fx` | | [Resume](/tasks/multi-step) | Continue the native session between task steps | `aider`, `claude-code`, `codex`, `copilot-cli`, `cortex-code`, `gemini-cli`, `goose`, `junie`, `kimi-code`, `kimi-cli`, `mcode`, `mimo`, `opencode`, `pi`, `qwen-coder` | | [Load native trajectory](/jobs/loading-trajectories#native-trajectories) | Restore an agent's native session | `claude-code`, `codex` | | [Load ATIF trajectory](/jobs/loading-trajectories#atif-trajectories-1) | Load prior ATIF context | `claude-code`, `codex` | | [Handoff](/jobs/handoff) | Continue a completed session locally | `claude-code` | | [Native configuration](#native-configuration) | Accept the agent's native configuration format | `claude-code`, `codex`, `deerflow`, `junie`, `openhands-sdk`, `qwen-coder` | | [Windows](/tasks/environment#operating-system) | Run in Windows task containers | `nop`, `oracle` | | [ACP bridge](/jobs/simulate-a-user#bridge) | Act as the target in a simulated-user trial | `claude-code`, `gemini-cli`, `codex`, `opencode` | | [MCP servers](/tasks/environment#mcps) | Expose task-provided MCP server configurations to the agent's runtime or prompt | `acp`, `antigravity-cli`, `antigravity-sdk`, `claude-code`, `cline-cli`, `codex`, `copilot-cli`, `cursor-cli`, `dspy-rlm`, `eve`, `fx`, `gemini-cli`, `goose`, `grok-build`, `hermes`, `junie`, `kimi-cli`, `kimi-code`, `langgraph`, `mcode`, `mimo`, `mini-swe-agent`, `openclaw`, `opencode`, `openhands`, `openhands-sdk`, `qwen-coder`, `strands`, `terminus-2`, `vibe`, `pi`, `fabric` | | [Skills](/tasks/skills) | Make task-provided skills discoverable through the agent's native configuration or prompt | `antigravity-cli`, `antigravity-sdk`, `claude-code`, `cline-cli`, `codex`, `copilot-cli`, `cursor-cli`, `eve`, `fx`, `gemini-cli`, `goose`, `grok-build`, `hermes`, `junie`, `kimi-cli`, `kimi-code`, `mcode`, `mimo`, `openclaw`, `opencode`, `openhands-sdk`, `pi`, `qwen-coder`, `terminus-2`, `vibe`, `fabric` | | [HTTP MCP headers](/tasks/environment#mcps) | Forward HTTP request headers configured for an MCP server | `claude-code`, `codex` | | [Native web tools](/tasks/network-policies#built-in-web-tools) | Disable built-in web search and fetch tools with `disable_web_search` or restricted network policies | `claude-code`, `codex`, `copilot-cli`, `cortex-code`, `deerflow`, `gemini-cli`, `mimo`, `openclaw`, `opencode`, `grok-build` | Pi converts its active session branch to ATIF format. MCP server support means the integration passes the supplied configuration to the agent; it does not guarantee connectivity to the server. ## Agent options `--effort`, `--ak`, and `--ae` are commonly used agent flags. Run `harbor run --help` to see the full set. | Flag | Purpose | | - | - | | `--ak`, `--agent-kwarg` | Pass a setting to the agent implementation. Values such as numbers, booleans, lists, and objects are parsed into their corresponding types. | | `--ae`, `--agent-env` | Set an environment variable during agent setup and execution. Values remain strings. | | `--effort` | Set reasoning effort for supported agents. Accepted levels depend on the agent and model. | > [accordion] Antigravity CLI gateway reasoning effort > > For `antigravity-cli` gateway runs, `reasoning_effort` accepts `low`, `medium`, > `high`, `xhigh`, and `max`. Harbor forwards the selected value as `--effort` > without translating it. The installed Antigravity version and model catalog must > support that level; accepting the option in Harbor does not add model support. > Omit the option to use the model's default effort. `none` is not accepted. > [!NOTE] > > Each agent supports its own kwargs and environment variables. Check the > agent's integration before setting them. ```bash theme={"system"} harbor run \ -t hello-world/hello-world \ -a claude-code -m anthropic/claude-sonnet-5 \ --ak max_turns=20 \ --ae MCP_TIMEOUT=20000 ``` Here, `max_turns=20` configures the Claude Code integration, while `MCP_TIMEOUT` is available to the agent process. Both flags can be **repeated**. ### Native configuration Load native config file for corresponding agent. Check out [Claude Code settings.json](https://code.claude.com/docs/en/settings) and [Codex configuration config.toml](https://learn.chatgpt.com/docs/config-file/config-reference) as example. `claude-code`, `codex`, `deerflow`, `junie`, `openhands-sdk`, and `qwen-coder` accept a native config file: ```bash theme={"system"} # Config file harbor run ... -a codex --ak "config=path/to/config.toml" ``` Inline JSON is also supported. Harbor converts inline JSON to the agent's native config file format and passes it to the agent: ```bash theme={"system"} # Inline config harbor run ... -a codex --ak 'config={"model_context_window": 200000}' ``` ### Pre-installed agents If the task image already contains the agent, for example because the sandbox has no internet access, skip the install with `skip_install`: ```bash theme={"system"} harbor run ... -a opencode --ak skip_install=true ``` Harbor then trusts the image to provide the agent and everything it needs to run, including system packages. Steps that depend on the run, such as uploading Harbor's runner scripts or writing the agent's config, still run. The recorded agent version is the one the image provides. This option works for every installed agent. The image must use the paths and runtime expected by that integration; use `--install-only` to prepare it. `claude-code`, `codex`, and `opencode` reuse the version installed in the image if it matches the requested `version`, or if no version is specified. Otherwise, they install the requested version (latest if unspecified). # Download Source: https://docs.harborframework.com/api-sdk/files/download /api-sdk/openapi.json get /download Download an artifact or job lock by its registered URI. # Inspect file Source: https://docs.harborframework.com/api-sdk/files/inspect-file /api-sdk/openapi.json head /download Download an artifact or job lock by its registered URI. # Cancel Job Source: https://docs.harborframework.com/api-sdk/jobs/cancel-job /api-sdk/openapi.json post /jobs/{job_id}/cancel Cancel a job. Set soft=true to let running rollouts finish. # Get Job Source: https://docs.harborframework.com/api-sdk/jobs/get-job /api-sdk/openapi.json get /jobs/{job_id} Get a job's state, configuration, rollout counts, and lock URI. # List Jobs Source: https://docs.harborframework.com/api-sdk/jobs/list-jobs /api-sdk/openapi.json get /jobs List jobs with filters and pagination. Pass next_cursor as cursor. # Pause Job Source: https://docs.harborframework.com/api-sdk/jobs/pause-job /api-sdk/openapi.json post /jobs/{job_id}/pause Pause queued rollouts in a job; running rollouts continue. # Resolve Job Source: https://docs.harborframework.com/api-sdk/jobs/resolve-job /api-sdk/openapi.json post /jobs/resolve Resolve a job configuration into a lock without starting execution. # Resume Job Source: https://docs.harborframework.com/api-sdk/jobs/resume-job /api-sdk/openapi.json post /jobs/{job_id}/resume Resume paused rollouts in a job. # Submit Job Source: https://docs.harborframework.com/api-sdk/jobs/submit-job /api-sdk/openapi.json post /jobs/submit Submit a job for background execution; returns immediately after acceptance. # Job Filters Source: https://docs.harborframework.com/api-sdk/queries/job-filters /api-sdk/openapi.json get /jobs/filters Discover available job filter values and counts, optionally narrowed by other filters. # Query Schema Source: https://docs.harborframework.com/api-sdk/queries/query-schema /api-sdk/openapi.json get /query/schema Discover public SQL views and columns before using query_sql; optionally select one view. # Query Sql Source: https://docs.harborframework.com/api-sdk/queries/query-sql /api-sdk/openapi.json post /query Run read-only SQL on public views. Supply statements as SQL strings or [SQL, parameters...]. Use LIMIT for large results. # Rollout Filters Source: https://docs.harborframework.com/api-sdk/queries/rollout-filters /api-sdk/openapi.json get /rollouts/filters Discover rollout filter values and counts, optionally within a job. # Cancel Rollout Source: https://docs.harborframework.com/api-sdk/rollouts/cancel-rollout /api-sdk/openapi.json post /rollouts/{rollout_id}/cancel Cancel a rollout. Set soft=true to let it finish if already running. # Get Rollout Source: https://docs.harborframework.com/api-sdk/rollouts/get-rollout /api-sdk/openapi.json get /rollouts/{rollout_id} Get a rollout's state, result, error information, and artifact URIs. # List Rollouts Source: https://docs.harborframework.com/api-sdk/rollouts/list-rollouts /api-sdk/openapi.json get /rollouts List rollouts, optionally within a job, with filters and pagination. # Pause Rollout Source: https://docs.harborframework.com/api-sdk/rollouts/pause-rollout /api-sdk/openapi.json post /rollouts/{rollout_id}/pause Pause a queued rollout; an already running rollout continues. # Resume Rollout Source: https://docs.harborframework.com/api-sdk/rollouts/resume-rollout /api-sdk/openapi.json post /rollouts/{rollout_id}/resume Resume a paused rollout. # Retry Rollout Source: https://docs.harborframework.com/api-sdk/rollouts/retry-rollout /api-sdk/openapi.json post /rollouts/{rollout_id}/retry Create a new attempt of a finished or cancelled rollout in the same job. # Changelog Source: https://docs.harborframework.com/changelog Release notes and product updates for Harbor. **October 25, 2026** v0.25.0 * **Task linting:** Check task configuration, files, dependencies, and verifier setup with `harbor lint`. Supports JSON output and rule selection in CLI flags, `task.toml`, and `dataset.toml`. * **Agent auth:** Configure inference with shared `--base-url`, `--api-key-name`, and `--api-format` flags. Inspect supported settings with `harbor agent auth `. * **Failure classification:** Trial errors now share a policy for retries, verification, and whether rewards count toward results. * **Task file exclusions:** Use `.harborignore` in tests and solution directories to exclude files from sandbox uploads, publication, and task content hashes. * **Network controls:** Restricted runs automatically allow resolved inference hosts. Added `--allow-verifier-host` to extend verifier allowlists. `no-network` and `allowlist` now disable supported agents' built-in web tools by default; explicit `disable_web_search` settings take precedence. * **New integrations:** Added NVIDIA NeMo Fabric, plus Sail, Docker Sandboxes (`sbx`), and Kernel environments. * **Trajectories:** Kimi Code now records ATIF trajectories and token usage. Simulated-user artifacts are preserved in uploaded result archives. * **RewardKit:** Added `Worker` to run submitted code as an unprivileged user inside the verifier container. Agent judges now receive `reasoning_effort`. > [!WARNING] > > **Breaking changes:** New tasks created with `harbor tasks init` or > `harbor init --task` now use separate verifiers by default. To opt out, set > `[verifier].environment_mode = "shared"` and install verifier dependencies > in the agent image. > > Local sandbox logs and artifacts are collected after execution instead of > automatically mounted on the host. Use `--ek auto_mounting=true` to restore > live mounts. The default skills path moved from `/harbor/skills` to > `/runtime/skills` (`C:/runtime/skills` on Windows); update tasks and verifiers > that read the old path. > > RewardKit's `all-pass`, `any-pass`, and `required-pass` now require scores > of at least `1.0` to count as passing. Use `weighted-mean` or `threshold` > for partial credit. > > Regrading now rejects symlinks outside recorded outputs, dangling links, > and cycles. Collect referenced files into the trial's recorded outputs. > See the [repository changelog](https://github.com/harbor-framework/harbor/blob/v0.25.0/CHANGELOG.md) > for additional migration details. **October 5, 2026** v0.24.0 * **Live streaming:** Follow agent trajectories and browse sandbox files during a run with `--stream`. Supports Claude Code and Codex on Docker, Daytona, Modal, Tensorlake, and Smol Machines. * **Results viewer:** Added Pareto and Outcomes views, range filters, and improved evaluation tables and trial navigation. * **Job comparison:** Use `harbor run --diff` to compare against previous jobs and preview which trials can be reused, regraded, or rerun. * **Agent controls:** Added `--effort` and a common `disable_web_search` option for supported agents. Harbor now validates MCP and skills capabilities before starting a sandbox. * **New integrations:** Added the Code Puppy agent and Prime, Mosaic, and Smol Machines sandboxes. Docker now supports GPU allocation through Compose. * **Simulated users:** Codex and OpenCode can now act as primary agents in simulated-user evaluations. * **Hosted workflows:** Regrade jobs and trials on Harbor Hub with `--launch`, share jobs during launch, and share packages with organizations when publishing. * **RewardKit:** Added JEV judges, rubric criteria, repeated judge sampling, and cost estimation for agent and LLM judges. > [!WARNING] > > **Breaking changes:** RewardKit now groups criteria by Python file. > Migrate directory-wide scoring to per-file configuration. > > Separate verifiers now prefer their own images and build definitions, > falling back to the agent's definition with tests uploaded to `/tests`. > Dedicated verifier images still need bundled tests. **September 12, 2026** v0.23.0 * **Agent options:** Discover supported settings with `harbor agent schema `. Built-in agents validate options before starting a sandbox. * **Job configuration:** Compose config files and validate runs with `harbor run --dry-run` before downloading tasks or starting environments. * **New integrations:** Added Muse Code, Strands, and the FX dev-channel agent, plus Podman, Runta, and Kata sandboxes. * **Trajectories:** ATIF v1.8 supports audio content. Agent results now record token usage by model. * **RewardKit:** Judges can receive trajectory images and audio. Added FX agent judges and signed weighted aggregation. * **Multi-step tasks:** Added Hermes session resume and regrading for completed multi-step trials. * **Hosted workflows:** Added Hub job renaming, ownership transfer, and agent catalog discovery. **August 22, 2026** v0.22.0 * **Simulated users:** Run multi-turn evaluations in which a user agent and a primary agent communicate through ACP. * **Trajectory loading:** Tasks can provide prior ATIF context through `trajectory.json` before the agent's first turn. * **New agents:** Added MCode, Junie, and FX integrations. * **New sandboxes:** Added Hyperbrowser and Vercel Sandbox integrations. * **Hosted workflows:** Added hosted custom agents, resumable trial uploads, and task and dataset sharing commands. * **RewardKit:** Added nested dimension groups and simplified agent judges. **August 10, 2026** v0.21.0 * **Trial handoff:** Resume a completed Claude Code session locally to ask the agent about its run. * **Regrading:** Use `harbor job regrade` or `harbor trial regrade` to run a new verifier against recorded trials without rerunning the agent. * **Trajectory loading:** Claude Code and Codex can load native or ATIF trajectories at run time. * **Package versioning:** Task and dataset packages now record versions and warn when a selected version has been yanked. * **New agents:** Added Cortex Code, Kimi Code, and Google Antigravity. * **New sandbox:** Added Hugging Face Sandbox. > [!WARNING] > > **Breaking security change:** GKE sandboxes no longer mount Kubernetes > service-account credentials. Workloads that need cluster access must provide > credentials explicitly. > [!NOTE] > > This changelog highlights user-facing stable releases and is not an exhaustive > commit history. See the [repository changelog](https://github.com/harbor-framework/harbor/blob/main/CHANGELOG.md), > [GitHub releases](https://github.com/harbor-framework/harbor/releases), or > [PyPI history](https://pypi.org/project/harbor/#history) for earlier releases. # Contributing Source: https://docs.harborframework.com/contributing/contributing Contributing documentation for Harbor. Harbor welcomes community contributions. This guide describes how Harbor manages issues and PRs and how to contribute in a way that is likely to be accepted. # Golden Rule We've adopted [Ghostty's golden rule](https://github.com/ghostty-org/ghostty/blob/main/CONTRIBUTING.md): **you must understand the code you contribute**. Feel free to use coding agents liberally, but you are in charge of demonstrating an understanding of your code. How to demonstrate an understanding: * Write your own PR descriptions * Document your design process including approaches and tradeoffs * Propose clean code with good abstractions (coding agents don't do this without a heavy hand) * Disclose which agents were used and to what extent As models improve, we may loosen this constraint. In an ideal world, we could trust the agents without needing to understand code ourselves. In our experience, this is not currently the case. # Communication Code can be written by agents. Docs, PR descriptions, issues, and comments should be written by a human with AI assistance. A general guideline for written communication: **you are in charge of the *first* draft and the *last* draft but can use agents in between**. # Issues The issues section is to report bugs and request features. In line with our communication standards, please write the first and last draft of your issue description and feel free to use agents in between. You must understand the *problem* but do not need to propose a solution. Because implementation is easier than ever, issues are often better than a PR. # PRs ## Agents, Sandboxes, and Plugins We are fairly liberal with integrations. All that we require is that at least one *user* has asked for the integration so please provide evidence of that (e.g. by having them leave a comment). We are slightly less liberal with plugins and only plan to maintain plugins with high demand. ## Interfaces and Core Logic We are unlikely to change interfaces or core logic without first discussing a design. This is especially true for Harbor format. To open a design discussion, create a PR with an RFC. The RFC should be **concise** and written by a human with AI assistance. If an RFC is slop, we will close it. RFCs should be placed in the `rfcs/` directory and follow the existing naming convention. # CHANGELOG.md For a **major feature** or **breaking change**, add a concise bullet under **Unreleased** in `CHANGELOG.md`. Otherwise, do not edit it. # Release policy Source: https://docs.harborframework.com/contributing/release-policy Harbor's stable and nightly release policy. Harbor publishes stable releases as needed (usually biweekly) and nightly releases daily. ## Stable releases Maintainers publish stable releases to [PyPI](https://pypi.org/project/harbor/) when ready. [Changelog](/changelog) will be updated. * **Patch release:** fixes and incremental improvements, such as `0.22.0` to `0.22.1`. * **Minor release:** used for a **major feature** or **breaking change**, such as `0.22.x` to `0.23.0`. Install the latest stable release with: ```bash theme={"system"} uv tool install harbor ``` ## Nightly releases Nightly builds publish the latest `main` to PyPI each day. Their versions use the format `.dev`, such as [`0.22.1.dev202608271032`](https://pypi.org/project/harbor/0.22.1.dev202608271032/). See the [PyPI release history](https://pypi.org/project/harbor/#history) for all stable and nightly versions. Install the latest nightly build with: ```bash theme={"system"} uv tool install --prerelease explicit "harbor>=0.dev0" ``` > [!NOTE] > > Nightly builds provide early access to unreleased changes and may be less > stable. # Core concepts Source: https://docs.harborframework.com/core-concepts/index Core concepts for understanding Harbor. Harbor has the following core concepts: ## Task A task defines one or more instructions, a sandbox environment, and a verifier. Tasks are used to evaluate agents and models and are implemented as directories in the [Harbor task format](/tasks/overview). See [Multi-step](/tasks/multi-step) for tasks with multiple instructions. ## Dataset A [dataset](/datasets/datasets) is a collection of tasks. Datasets are used to evaluate agents and models. Usually, a dataset corresponds to a benchmark (e.g. Terminal-Bench or SWE-Bench Verified). Datasets can optionally be distributed through [Harbor Hub](https://hub.harborframework.com). ## Agent An agent is a program that completes tasks. Harbor includes [pre-integrated agents](/agents/pre-integrated-agents) and supports [custom agents](/agents/custom-agents) implemented with the `BaseAgent` interface. ## Sandbox A sandbox is an isolated environment for running tasks. Harbor includes [pre-integrated sandboxes](/sandboxes/pre-integrated-sandboxes) such as [Daytona](https://www.daytona.io/) and [Modal](https://modal.com/products/sandboxes). Other runtimes can be integrated as [custom sandboxes](/sandboxes/custom-sandboxes) by implementing `BaseEnvironment`. ## Verifier A [verifier](/tasks/verifier) evaluates the agent's work and produces the task's reward. ## Trial A trial is one agent's attempt at completing one task. ## Job A [job](/jobs/run-a-job) is a collection of trials used to evaluate agents and models. A job can combine datasets, agents, tasks, and models. Under the hood, a job generates trials and runs them in parallel. ## Trajectory A trajectory is the conversation and action history of the agent and user while completing a task. Trajectories are one of the most useful tools for understanding and debugging agent behavior. Harbor's standard trajectory format is [ATIF](/agents/atif). Trajectories can also be [loaded into a later agent session](/jobs/loading-trajectories). # Create a Dataset Source: https://docs.harborframework.com/datasets/create-a-dataset Create a dataset of Harbor tasks ## Implicit datasets The simplest way to create a dataset is to collocate a group of tasks in a directory. ```bash theme={"system"} my-dataset/ ├── task1/ ├── task2/ └── task3/ ``` which can be run with: ```bash theme={"system"} harbor run -p ./my-dataset -a "" -m "" ``` ## Explicit datasets You may want to define multiple datasets containing overlapping tasks. For example, you may have a directory of tasks defining an implicit dataset that you want to subset into categories. In this case, copying and pasting the tasks is inconvenient, inefficient, and adds maintenance overhead. Instead, you should create a `dataset.toml` manifest, which contains pointers to the task directories. ### Create a `dataset.toml` manifest To create a `dataset.toml` manifest, run ```bash theme={"system"} harbor dataset init "" ``` which outputs a `dataset.toml` manifest in the current directory. > [!NOTE] > > Usually, `` is the name of your company and `` is the name of the dataset. ### Add and remove tasks To add tasks to the dataset, run ```bash theme={"system"} harbor dataset add "" ``` To remove tasks from the dataset, run ```bash theme={"system"} harbor dataset remove "" ``` You can also add and remove all tasks from another dataset ```bash theme={"system"} harbor dataset add "" harbor dataset remove "" ``` ### Run the `dataset.toml` To run the `dataset.toml` manifest, run ```bash theme={"system"} harbor run -p "" ``` ## Publish a dataset To share your dataset with team members or publicly using Harbor Hub, run ```bash theme={"system"} harbor publish "" ``` Think of Harbor Hub like PyPI or NPM rather than GitHub. Because tasks are software, development typically happens in a version-controlled repository and versions are published to Harbor Hub. Once a dataset is published, anyone with access can run it using the `harbor run -d ` command. # Datasets Source: https://docs.harborframework.com/datasets/datasets Collections of tasks for evaluation and training. A [Harbor task](/tasks/overview) is an instruction, sandbox environment, and test script. A dataset is a collection of tasks. Datasets sometimes define custom metrics that aggregate task rewards. There are three ways to use datasets: 1. **Local datasets**: run a local directory of tasks or `dataset.toml` manifest 2. **Published datasets**: run a dataset from [Harbor Hub](https://hub.harborframework.com/) 3. **Git repository datasets**: run a dataset from a Git repository ## Local datasets Run a local dataset with `--path` or `-p`: ```bash theme={"system"} harbor run -p "" -a "" -m "" ``` The path can be a directory of tasks or a `dataset.toml` manifest file. ## Published datasets Datasets can be published and shared with members of your organization or publicly on [Harbor Hub](https://hub.harborframework.com/). Run a published dataset with `--dataset` or `-d`: ```bash theme={"system"} harbor run -d "" -a "" -m "" ``` To learn how to create and publish a dataset, see [Publish a dataset](/datasets/create-a-dataset#publish-a-dataset). ## Git repository datasets Run a dataset directly from any Git repository with `--repo`: ```bash theme={"system"} harbor run --repo org/repo-name -p "./tasks" -a "" -m "" ``` Supports GitHub, GitLab, and Hugging Face URLs, with optional ref pinning (`@v1.0`, `@main`). See [Git repos](/datasets/git-repos) for the full guide. # Git repos Source: https://docs.harborframework.com/datasets/git-repos Run a dataset from a Git repo. Harbor can resolve datasets directly from Git repositories using the `--repo` flag. This lets you run benchmarks hosted in any GitHub, GitLab, or Hugging Face repo. ## Quick start ```bash theme={"system"} harbor run --repo "" -a "" -m "" ``` This clones the repository, and by default runs that tasks in the `tasks/` directory. ## Specifying the repository The `--repo` flag accepts several formats: ```bash theme={"system"} # GitHub shorthand (defaults to github.com) --repo "" # Pinned to a branch, tag, or commit --repo "@" --repo "@" --repo "@" # Full URL --repo "https://github.com/" # Subdirectory via /tree/ path --repo "https://github.com//tree//" # Hugging Face --repo "https://huggingface.co/datasets/" # GitLab --repo "https://gitlab.com/" ``` When no `@ref` is specified, the repository's default branch is used. ## Selecting a dataset You can select datasets using `-p` to specify a path within the repo or `-d` to specify a dataset defined in a root-level `registry.json` file (or as specified by `--registry-path`). > [tab] Repo-relative path > > Run an implicit dataset from a repo-relative directory: > > ```bash theme={"system"} > harbor run --repo "" -p "" \ > -a "" -m "" > ``` > [tab] Default registry path > > Select a dataset from the repo's root-level `registry.json`: > > ```bash theme={"system"} > harbor run --repo "" -d "" \ > -a "" -m "" > > harbor run --repo "" -d "@" \ > -a "" -m "" > ``` > [tab] Custom registry path > > Select a dataset from a repo-relative registry path: > > ```bash theme={"system"} > harbor run --repo "" \ > --registry-path "" \ > -d "" -a "" -m "" > ``` Without `-p` or `-d`, Harbor treats the repo's `tasks/` directory as an implicit dataset. ## Combining with other flags Standard dataset flags work with `--repo`: ```bash theme={"system"} # Include specific tasks harbor run --repo "" -d "" \ -i "" -i "" \ -a "" -m "" # Limit task count harbor run --repo "" -d "" \ -l "" \ -a "" -m "" ``` > [!WARNING] > > `--repo` cannot be combined with `--registry-url` or `--task` / `--task-git-url`. ## Repository layout A git repository used with `--repo` should contain a `registry.json` at its root (or in the targeted subdirectory). This is the same format used by local `--registry-path`: ```bash theme={"system"} my-repo/ ├── registry.json # optional, required for -d └── tasks/ ├── task-a/ │ ├── task.toml │ ├── instruction.md │ ├── environment/ │ └── tests/ ├── task-b/ │ └── ... └── ... ``` The `registry.json` maps dataset names to task lists. See [Tasks → Overview](/tasks/overview) for task directory structure. ## Authentication Public repositories work without any configuration. For private repositories, Harbor uses the Git credentials available in your environment (SSH keys, credential helpers, `GIT_ASKPASS`, etc.). If `git ls-remote` can reach the repo, `--repo` will work. # Metrics Source: https://docs.harborframework.com/datasets/metrics Custom dataset metrics. Metrics define how to aggregate rewards across tasks in a job or dataset. By default, Harbor averages rewards across tasks and treats missing rewards as 0. However, you may want to define custom logic or handle missing rewards differently. You can do this by creating a `metric.py` file. If you are working with a `dataset.toml`, you can run the following command to create a `metric.py` file and automatically add it to the `[[files]]` section of your `dataset.toml`: ```bash theme={"system"} harbor init --dataset "/" --with-metric ``` If you are running a local dataset, it will automatically use the `metric.py` if it's present in the dataset directory. ## Default behavior By default, Harbor averages rewards across tasks and treats missing rewards as 0. > [tab] Single dimension > > ```jsonl title="Rewards" theme={"system"} > {"reward": 1} > {"reward": 0} > null > {"reward": 0} > ``` > > ```json title="Aggregate" theme={"system"} > {"mean": 0.25} > ``` > [tab] Multi-dimensional > > ```jsonl title="Rewards" theme={"system"} > {"correctness": 1, "style": 0.5} > {"correctness": 0, "style": 1} > null > {"correctness": 1, "style": 0.5} > ``` > > ```json title="Aggregate" theme={"system"} > {"correctness": 0.5, "style": 0.5} > ``` > [tab] Missing dimensions > > ```jsonl title="Rewards" theme={"system"} > {"correctness": 1} > {"style": 1} > {} > null > ``` > > ```json title="Aggregate" theme={"system"} > {"correctness": 0.25, "style": 0.25} > ``` For single-dimension rewards, Harbor names the aggregate after the metric (`mean`). For multi-dimensional rewards, it aggregates each dimension independently. Missing rewards and missing dimensions count as 0. ## Custom metrics with `metric.py` A `metric.py` script must accept the following arguments: * `-i, --input-path`: rewards JSONL file * `-o, --output-path`: output JSON file with computed metrics ### Example ```python title="metric.py" theme={"system"} # /// script # dependencies = [] # /// # To add a dependency: uv add --script metric.py import argparse import json from pathlib import Path def main(input_path: Path, output_path: Path): rewards = [] for line in input_path.read_text().splitlines(): reward = json.loads(line) if reward is None: rewards.append(0) elif len(reward) != 1: raise ValueError( f"Expected exactly one key in reward dictionary, got {len(reward)}" ) else: rewards.extend(reward.values()) mean = sum(rewards) / len(rewards) if rewards else 0 output_path.write_text(json.dumps({"mean": mean})) if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument( "-i", "--input-path", type=Path, required=True, help="Path to a jsonl file containing rewards, one json object per line.", ) parser.add_argument( "-o", "--output-path", type=Path, required=True, help="Path to a json file where the metric will be written as a json object.", ) args = parser.parse_args() main(args.input_path, args.output_path) ``` ### Considerations When implementing a custom metric, be sure to account for 1. Missing or invalid reward keys 2. Invalid reward values 3. Null rows in the JSONL input 4. Default aggregate reward keys ### Publishing custom metrics When publishing a dataset, Harbor automatically publishes the `metric.py` file in the same directory: ```bash theme={"system"} harbor publish "" --public ``` ### Output format `metric.py` output should be a JSON object. Multiple metric values are allowed: ```json theme={"system"} {"mean": 0.81, "pass_rate": 0.5} ``` # Registries Source: https://docs.harborframework.com/datasets/registries Create custom registries of datasets. Harbor supports running and downloading datasets from custom registries via `--registry-url` or `--registry-path`. > [!NOTE] > > This document describes how anyone can create a custom registry. By default, Harbor uses Harbor Hub as the registry. ## Schema `registry.json` is a JSON array. Each entry defines one version of a dataset and must include `name`, `version`, `description`, and `tasks`. The `metrics` field is optional. ```json title="registry.json" theme={"system"} [ { "name": "", "version": "", "description": "", "tasks": [ { "name": "", "git_url": "https://github.com//.git", "git_commit_id": "", "path": "" } ], "metrics": [ { "type": "mean", "kwargs": {} } ] } ] ``` ### Dataset fields **name** `string` Dataset name used with `--dataset`. **version** `string` Dataset version. Define another top-level entry to publish another version of the same dataset. **description** `string` Human-readable description of the dataset. **tasks** `list[Task]` Tasks included in the dataset. **metrics** `list[Metric]` (default: \[]) Optional reward aggregations. See [Metrics](/datasets/metrics). ### Task fields Every task must include `name` and `path`. The Git fields are optional. **tasks\[].name** `string` Task name. **tasks\[].git\_url** `string | null` (default: null) Git repository containing the task. Without `--repo`, omitting this field makes `path` a local path. **tasks\[].git\_commit\_id** `string | null` (default: null) Commit containing the task. If omitted, Harbor resolves the repository's default branch. **tasks\[].path** `string` Path to the task directory, relative to the Git repository root when `git_url` is set. ### Metric fields **metrics\[].type** `"sum" | "min" | "max" | "mean" | "uv-script"` (default: "mean") Metric implementation used to aggregate task rewards. **metrics\[].kwargs** `object` (default: \{}) Keyword arguments passed to the metric implementation. > [!NOTE] > > When loading the registry with [`--repo`](/datasets/git-repos), Harbor fills omitted `git_url` and `git_commit_id` values from the selected repository and resolved commit. > [!TIP] > > Use unique dataset name and version pairs, and pin remote tasks to full commit SHAs for reproducible runs. # Installation Source: https://docs.harborframework.com/getting-started/installation Install Harbor. ## Install Harbor Install Harbor with a Python package manager. > [tab] uv > > First, [install uv](https://docs.astral.sh/uv/getting-started/installation/). > > ```bash theme={"system"} > uv tool install harbor > ``` > [tab] pip > > ```bash theme={"system"} > pip install harbor > ``` > [tab] uv upgrade > > ```bash theme={"system"} > uv tool uninstall harbor > uv tool install harbor > ``` ## Nightly builds (not frequently used for most users) We publish [a dev release](https://pypi.org/project/harbor/#history) from the latest `main` to [PyPI](https://pypi.org/project/harbor/) daily. Install it with a pre-release flag (stable installs are unaffected): > [tab] uv > > ```bash theme={"system"} > uv tool install --prerelease explicit 'harbor>=0.dev0' > ``` > [tab] pip > > ```bash theme={"system"} > pip install --pre harbor > ``` > [tab] uv upgrade > > ```bash theme={"system"} > uv tool uninstall harbor > uv tool install --prerelease explicit 'harbor>=0.dev0' > ``` ## Configure a sandbox Harbor runs agents in sandboxes. By default, Harbor uses [Docker](https://www.docker.com/) as the sandbox runtime, so you'll need to [have Docker installed](https://docs.docker.com/get-started/get-docker/) on your machine. However, many users find it more productive to use a cloud sandbox. See [Pre-integrated sandboxes](/sandboxes/pre-integrated-sandboxes) for a list of out-of-the-box cloud sandbox options. For non-Docker sandboxes, you'll need to install the extra dependencies. E.g. > [tab] uv > > ```bash theme={"system"} > uv tool install "harbor[modal]" > ``` > [tab] pip > > ```bash theme={"system"} > pip install "harbor[modal]" > ``` # Quick start Source: https://docs.harborframework.com/getting-started/quick-start Run your first job. ## Install Harbor Follow our [installation instructions](/getting-started/installation) to install Harbor, which involves installing the package and its dependencies. ## Run a job In Harbor, a trial is an agent's attempt to solve a task. A job is a collection of trials. To run your first job, run ```bash theme={"system"} OPENAI_API_KEY="" \ harbor run -t hello-world/hello-world \ -a codex -m openai/gpt-5.6-luna ``` By default, the agent will run in a [Docker](https://www.docker.com/) sandbox. Use the `--env/-e` flag to configure it to run in a cloud sandbox like [Modal](https://modal.com/products/sandboxes) or [Daytona](https://www.daytona.io/). Add the `--launch` flag to run the job on Harbor Hub. See [Run a job](/jobs/run-a-job) for more information. ## View the results Harbor ships with a local web viewer for inspecting results. ```bash theme={"system"} harbor view ./jobs ``` See [View job results](/results/view-job-results) for more information. ## Share results You can upload your results to Harbor Hub to share with others. Those you share with can the job's configuration and reproduce the results. ```bash theme={"system"} harbor upload "./jobs/" ``` See the [Terminal-Bench website](https://www.tbench.ai/) for an example of how publishing results enables full auditability. ## Other resources > [card] [Task overview](/tasks/overview) > > Learn what a Harbor task is. > [card] [Create a task](/tutorials/create-a-task) > > Build your first Harbor task. # Download Source: https://docs.harborframework.com/harbor-hub/download Download datasets, tasks, jobs, trials, and trajectories. Harbor Hub is a shared storage layer for datasets, tasks, jobs, trials, and trajectories. Users can upload data to the hub using the following commands. ```bash theme={"system"} harbor run ... --upload harbor upload "" harbor publish "" ``` Downloading datasets and tasks from the hub is done using the `harbor download` command. ```bash theme={"system"} harbor download "" harbor download "" ``` Users may also download jobs, trials, and trajectories from the hub using the following commands. ```bash theme={"system"} harbor job download "" harbor trial download "" harbor trial download "" --trajectory ``` If you want to include retried trials in your download, include the `--include-retries` flag. # Hosted jobs Source: https://docs.harborframework.com/harbor-hub/hosted-jobs Submit hosted jobs and check their status. See [Submitting jobs](/hosted-harbor/submitting-jobs) for instructions on launching hosted jobs, configuring agents and credentials, selecting tasks and datasets, and checking job status. # Leaderboards Source: https://docs.harborframework.com/harbor-hub/leaderboards Create, rank, and share evaluation results on Harbor Hub. A leaderboard is a ranked table of results for a dataset. You define its columns and ranking rules, add rows with metadata and scores, and optionally link each row to the trials behind it. > [!NOTE] > > Harbor Hub intentionally does not calculate row scores from linked trials, to enable maximally flexible leaderboard construction. Public leaderboards can be read without signing in. Private leaderboards are visible to members of the owning organization. Creating a leaderboard requires owner access to the dataset's organization. In the commands below, `` is either a UUID or an `org/dataset/leaderboard` slug. ## General approach 1. Choose a published dataset and the [versions](#dataset-versions) the leaderboard will cover. 2. [Generate a configuration](#create) with `init`, then define the metadata, metrics, columns, and ranking rules. 3. Prepare your results as [rows](#add-rows), calculating the scores yourself. Include trial IDs if you want to link each result to its runs. 4. Create the leaderboard with its definition and rows files. Keep it private while reviewing the results. 5. [Inspect the leaderboard](#browse), check the rankings and trial links, then [make it public](#edit-a-leaderboard) when it is ready. ## Browse ```bash theme={"system"} harbor hub leaderboard list harbor hub leaderboard list "/" harbor hub leaderboard show "" ``` `list` optionally filters by dataset slug or ID. ## Create Generate a configuration file, edit it, then create the leaderboard: ```bash theme={"system"} harbor auth login harbor hub leaderboard init \ --package "/" \ --name main \ --title "Main leaderboard" \ --output leaderboard.yaml # Edit leaderboard.yaml. harbor hub leaderboard create --config leaderboard.yaml ``` New leaderboards are private. Set `visibility: public` in the file or pass `--visibility public` to `create`. ### Configuration schema The definition file passed to `create --config` accepts the fields below. Use either `package` or `package_id`. Rows go in a separate file passed with `--rows`. **package** `string` Dataset slug, such as `acme/my-dataset`. Required unless `package_id` is provided. **package\_id** `string (UUID)` Dataset package UUID, as an alternative to `package`. **name** `string` *required* Leaderboard slug, up to 100 characters. Starts with a lowercase letter or digit; may also contain `.`, `_`, and `-`. **title** `string` *required* Display title, from 1 to 200 characters. **description** `string | null` Optional description, up to 5,000 characters. **visibility** `string` (default: private) `public` or `private`. **metadata\_schema** `object` (default: \{}) Schema for each row's metadata, such as the agent name and configuration. **metrics\_schema** `object` (default: \{}) Schema for each row's metrics, such as scores and costs. **columns** `object[]` (default: \[]) Display columns, in left-to-right order. **Column fields** **id** `string` *required* Unique column key. Starts with a letter, digit, or underscore; may also contain `.` and `-`. **header** `string` *required* Non-empty display heading. **accessor** `string` *required* Value path beginning with `metadata.` or `metrics.`, such as `metrics.reward`. **type** `string` *required* `text`, `number`, `boolean`, `date`, `markdown`, or `link`. Links accept a URL string or an object with `url` and `label`. **display\_accessor** `string` Alternate value path for display. The original `accessor` remains the sort value. **display\_type** `string` Formatter for the alternate display value; accepts the same values as `type`. **align** `string` `left`, `center`, or `right`. **description** `string` Explanation of the column. **enable\_sorting** `boolean` Whether users can sort by this column in Hub. **rank\_by** `object[]` (default: \[]) Ranking rules, evaluated in order to break ties. **Ranking rule fields** **accessor** `string` *required* Value path beginning with `metadata.` or `metrics.`. **direction** `string` *required* `asc` for lowest first or `desc` for highest first. **nulls** `string` Place missing values `first` or `last`. **dataset\_version\_refs** `string[]` Dataset version refs to associate, such as `latest` or a version tag. Resolved to fixed UUIDs at creation. **dataset\_version\_ids** `string (UUID)[]` Dataset version UUIDs to associate. Can be combined with refs. Omit both fields to associate all existing versions; set both to `[]` for none. ### Columns and ranking The generated file includes an example with an agent name and reward score: ```yaml theme={"system"} metadata_schema: type: object properties: agent: type: string metrics_schema: type: object properties: reward: type: number columns: - id: agent header: Agent accessor: metadata.agent type: text - id: reward header: Reward accessor: metrics.reward type: number rank_by: - accessor: metrics.reward direction: desc nulls: last ``` This displays an agent column and a reward column, with the highest reward ranked first. ### Dataset versions By default, a new leaderboard is associated with every dataset version that exists at creation time. Later versions are not added automatically. To select versions explicitly, add `dataset_version_refs` or `dataset_version_ids` to the configuration: ```yaml theme={"system"} dataset_version_refs: - latest ``` Refs resolve to fixed version UUIDs. Both fields can be combined; setting both to `[]` associates no versions. ## Add rows Create `rows.yaml` with the values your columns expect: ```yaml theme={"system"} rows: - metadata: agent: Example agent metrics: reward: 0.85 ``` Then add the rows: ```bash theme={"system"} harbor hub leaderboard row create "" --config rows.yaml ``` ### Row file schema The file passed to `row create --config` or `create --rows` has this structure: **rows** `object[]` *required* Between 1 and 500 new rows. Trial IDs must be unique across the rows in the request. **Row fields** **metadata** `object` (default: \{}) Values matching the leaderboard's `metadata_schema`. **metrics** `object` (default: \{}) Values matching the leaderboard's `metrics_schema`. **status** `string` (default: display) `display` to show the row or `hide` to hide it. **trial\_ids** `string (UUID)[]` (default: \[]) Trials linked to this row. Linking trials does not compute metadata or metrics. To create the leaderboard and its rows together, pass the separate rows file to `create`: ```bash theme={"system"} harbor hub leaderboard create --config leaderboard.yaml --rows rows.yaml ``` ## Edit a leaderboard Change its title, description, or visibility directly: ```bash theme={"system"} harbor hub leaderboard update "" \ --title "Updated leaderboard" --visibility public ``` Use `--description` to change the description or `--visibility private` to make the board private. To replace dataset-version associations, repeat `--dataset-version-ref` or `--dataset-version-id`. Omit these fields to preserve existing associations. For columns, schemas, or ranking changes, export the definition, edit it, then apply it: ```bash theme={"system"} harbor hub leaderboard export "" --output leaderboard.yaml # Edit leaderboard.yaml. harbor hub leaderboard update "" --config leaderboard.yaml ``` Flags override corresponding values in the file. The package and leaderboard name cannot be changed through `update`. ## Edit rows List rows to find their IDs, then inspect or edit one: ```bash theme={"system"} harbor hub leaderboard row list "" harbor hub leaderboard row show "" harbor hub leaderboard row export "" --output row.yaml # Edit row.yaml. harbor hub leaderboard row update "" --config row.yaml ``` Row updates change `metadata`, `metrics`, or `status`. To hide, restore, or permanently delete rows: ```bash theme={"system"} harbor hub leaderboard row update "" --status hide harbor hub leaderboard row update "" --status display harbor hub leaderboard row delete "" "" --yes ``` Deleting rows also removes their trial links. Omit `--yes` for an interactive confirmation. The CLI has no command to delete an entire leaderboard. ### Batch edits Export all visible rows, edit them, then apply the file: ```bash theme={"system"} harbor hub leaderboard row export "" --all --output rows.yaml # Edit rows.yaml. harbor hub leaderboard update "" --rows rows.yaml ``` If a schema change requires row changes, apply both files together so they succeed or fail as one transaction: ```bash theme={"system"} harbor hub leaderboard update "" \ --config leaderboard.yaml --rows rows.yaml --dry-run harbor hub leaderboard update "" \ --config leaderboard.yaml --rows rows.yaml ``` Export both files before editing. Their timestamps protect against overwriting newer changes. `--dry-run` requires both a definition change and row updates. ## Link trials Trial links record which runs support a row. `set` replaces all links; `add` and `remove` change only the specified links. ```bash theme={"system"} harbor hub leaderboard row trial list "" harbor hub leaderboard row trial set "" --trial-id "" harbor hub leaderboard row trial add "" --trial-id "" harbor hub leaderboard row trial remove "" --trial-id "" harbor hub leaderboard row trial set "" --clear ``` Repeat `--trial-id` for multiple trials. Alternatively, replace the links from a YAML or JSON file containing a non-empty `trial_ids` list: ```bash theme={"system"} harbor hub leaderboard row trial set "" --trial-ids-file trials.yaml ``` Use the file option on its own; use `--clear` to remove all links. ## Files and scripting Configuration files accept YAML or JSON. Exports require a `.yaml`, `.yml`, or `.json` extension; `init` also accepts `--format json`. Use `--force` to overwrite an existing output file. Read and mutation commands support `--json`. Use `list --quiet` for leaderboard slugs, `row list --quiet` for row IDs, and `row trial list --quiet` for trial IDs. Row and trial lists support `--limit` (default 50, maximum 1,000) and `--page` (starting at 1). JSON returns one page. Quiet or piped output streams all pages unless `--page` is supplied; `--no-headers` removes piped table headers. ```bash theme={"system"} harbor hub leaderboard row list "" --page 2 --limit 100 --json harbor hub leaderboard row trial list "" --quiet ``` ## Display a leaderboard on your own website Fetch a public leaderboard without authentication to display it on your website: ```bash theme={"system"} curl --fail-with-body -sS \ "https://api.harborframework.com/functions/v1/leaderboard-read" \ -H "Content-Type: application/json" \ -d '{ "package": "/", "name": "", "page": 1, "page_size": 100 }' ``` The response contains the `leaderboard` definition, ranked `rows`, and `pagination`. Fetch through `pagination.total_pages` for all rows. You can also select a board by `leaderboard_id` instead of `package` and `name`. For private boards, authenticate from your server; keep API keys out of browser code. See [terminal-bench-2-1](https://github.com/harbor-framework/terminal-bench-2-1) for an example pipeline and [tbench.ai](https://www.tbench.ai/) for custom visuals backed by Hub. Links to trials and versioned datasets let readers audit results and reproduce evaluations. # Publish Source: https://docs.harborframework.com/harbor-hub/publish Publish datasets and tasks to the Hub. Harbor Hub allows for publishing & sharing datasets and tasks. Think of Harbor Hub like HuggingFace or PyPI for RL environments. ## Publishing To publish a task or dataset to Harbor Hub, run ```bash theme={"system"} harbor publish "" # or path/to/dataset ``` You can also tag uploads using the `--tag` flag. If you publish a dataset, it will automatically publish referenced tasks in the same folder. The path can be a `dataset.toml` file or a directory containing one. ## Visibility By default, published tasks and datasets are private. You can make them public by using the `--public` flag. ```bash theme={"system"} harbor publish "" --public # or dataset ``` Making a dataset public cascades to all tasks contained in any dataset version. See [Sharing](/harbor-hub/sharing) for instructions on sharing published content. # Sharing Source: https://docs.harborframework.com/harbor-hub/sharing Sharing tasks, datasets, and jobs. Harbor Hub allows you to share tasks, datasets, and jobs with other users. ## Sharing tasks and datasets Tasks and datasets can be shared publicly or privately. Set visibility when publishing a new task or dataset with `--public` or `--private`: ```bash theme={"system"} harbor publish "" --public harbor publish "" --public harbor publish "" --private ``` New packages default to private. These flags only set visibility for new packages; publishing another version of an existing package preserves its visibility. Use the `visibility` commands below to change it. To share a published task or dataset privately with an organization, use: ```bash theme={"system"} harbor task share "/" --org "" harbor dataset share "/" --org "" ``` To make a published task or dataset public, use: ```bash theme={"system"} harbor task visibility "/" --public harbor dataset visibility "/" --public ``` > [!WARNING] > > Sharing a dataset makes all tasks public, including those referenced in prior and future versions. ## Sharing jobs You can share jobs at upload time or after. ```bash theme={"system"} harbor run ... --upload --share "" harbor upload "" --share "" harbor job share "" --org "" ``` Sharing a job automatically shares all trials and trajectories with the shared party. To make a job public, use: ```bash theme={"system"} harbor run ... --upload --public harbor upload "" --public ``` For an already-uploaded job, `harbor upload "" --public` updates its visibility using the local job directory. Use `--private` to make it private again. ## Inspecting share status You can inspect task and dataset access and job shares using: ```bash theme={"system"} harbor task access "/" harbor dataset access "/" harbor hub job shares "" ``` # Upload Source: https://docs.harborframework.com/harbor-hub/upload Upload job results to the Hub. Harbor Hub lets you store, view, and share job results, including their trials and trajectories. ## Uploading Sign in, then upload a local job directory: ```bash theme={"system"} harbor auth login harbor upload "" ``` The directory must contain `config.json` and `result.json`. To upload trials as they finish during a run, add `--upload`: ```bash theme={"system"} harbor run ... --upload ``` If an upload is interrupted or some trials fail to upload, rerun `harbor upload ""`. Already-uploaded trials are skipped. ## Visibility New uploads are private by default. Use `--public` to make a job public, or `--private` to make it private: ```bash theme={"system"} harbor upload "" --public harbor upload "" --private harbor run ... --upload --public ``` For an already-uploaded job, these flags update its visibility. Omitting them preserves its current visibility. ## Ownership and sharing Jobs default to your personal organization. Use `--org` to select the owning organization for a new upload: ```bash theme={"system"} harbor upload "" --org "" ``` Re-uploading cannot change a job's owner. To share a job with another organization, use `--share`: ```bash theme={"system"} harbor upload "" --share "" harbor run ... --upload --share "" ``` Repeat `--share` to share with multiple organizations. Sharing with an organization you do not belong to requires confirmation; use `--yes` to confirm in scripts. See [Sharing](/harbor-hub/sharing) for managing access after upload and [Download](/harbor-hub/download) for retrieving results. # API server Source: https://docs.harborframework.com/harbor-serve/api-server Start a Harbor server and connect through HTTP, the CLI, the Python SDK, or MCP. `harbor serve` runs jobs and manages sandboxes. Clients connect to the same server and see the same jobs; execution continues when a client disconnects. ## Start the server With Docker running, start the server: ```bash theme={"system"} harbor serve ``` Leave `HARBOR_API_KEY` unset for this local example. The examples below use the public [hello-world task](https://hub.harborframework.com/tasks/hello-world/hello-world) and the **oracle agent**, which runs its reference solution. No Hub or model API key is needed. > [accordion] Use Daytona instead of Docker > > Configure the sandbox provider on the **server**, then use `"environment": {"type": "daytona"}` in your job config, or `--env daytona` in the CLI. > > ```bash theme={"system"} > uv pip install "harbor[daytona]" > export DAYTONA_API_KEY="your-daytona-key" > harbor serve > ``` ## Choose a client Once the server is running, there are **four ways to interact with it**: 1. **HTTP / cURL** 2. **Harbor CLI** with `--server` 3. **Python SDK** (`Harbor` / `AsyncHarbor`) 4. **MCP** Choose one of the examples below to submit a job: > [tab] HTTP / cURL > > Open [Submit job](/api-sdk/jobs/submit-job), select **Local server**, leave the Bearer field empty, and click **Send** on the prefilled example. Or run: > > ```bash theme={"system"} > curl http://127.0.0.1:8390/jobs/submit \ > -H 'Content-Type: application/json' \ > -d '{ > "job": { > "tasks": [{"name": "hello-world/hello-world"}], > "agents": [{"name": "oracle"}], > "environment": {"type": "docker"} > } > }' > ``` > > > [!NOTE] > > > > The playground sends real requests from your browser. Allow local-network access if prompted. If blocked, use cURL or `http://127.0.0.1:8390/docs`. > [tab] Harbor CLI > > The CLI submits a job config to `POST /jobs/submit`. `--watch` follows progress: > > ```bash theme={"system"} > harbor run --server http://127.0.0.1:8390 \ > --task hello-world/hello-world \ > --agent oracle --env docker --watch > ``` > > To submit an existing config, use `harbor run --server http://127.0.0.1:8390 --config job.json --watch`. > [tab] Python SDK > > `Harbor()` defaults to `http://127.0.0.1:8390` and reads `HARBOR_API_KEY` if set. Run this with `python submit_job.py`: > > ```python submit_job.py theme={"system"} > from harbor import Harbor > > client = Harbor() > job = client.submit_job(job={ > "tasks": [{"name": "hello-world/hello-world"}], > "agents": [{"name": "oracle"}], > "environment": {"type": "docker"}, > }) > job_id = job.job_id > print(job_id) > print(client.get_job(job_id)) > print(client.list_rollouts(job_id=job_id)) > client.close() > ``` > > `job` accepts a dictionary or `JobConfig`; responses are typed models. Set `base_url` to connect remotely. `AsyncHarbor` provides the same methods with `await`. > > Select **Python** on any [endpoint page](/api-sdk/jobs/submit-job) for its SDK example. > [tab] MCP > > Harbor exposes MCP at `http://127.0.0.1:8390/mcp`. No authentication is needed for this local example. > > > [accordion] Configure MCP permanently > > > > ```bash Claude Code theme={"system"} > > claude mcp add --transport http --scope user harbor http://127.0.0.1:8390/mcp > > ``` > > > > ```bash Codex theme={"system"} > > codex mcp add harbor --url http://127.0.0.1:8390/mcp > > ``` > > > > ```json Cursor theme={"system"} > > { > > "mcpServers": { > > "harbor": { > > "url": "http://127.0.0.1:8390/mcp" > > } > > } > > } > > ``` > > > > For Cursor, add the entry to `~/.cursor/mcp.json`. Other clients can use the same URL with Streamable HTTP. > > **Per conversation:** an agent with HTTP tools can communicate with MCP directly using the prompt below. Otherwise, configure MCP above first. > > > Use the Harbor MCP server at [http://127.0.0.1:8390/mcp](http://127.0.0.1:8390/mcp) to run hello-world/hello-world with oracle on Docker. Show the job ID, job, and rollouts. The server downloads the task from Hub and returns `job_id`. For local tasks, use `path` instead of `name`; paths refer to the **server's filesystem**. > [accordion] Run Codex with an OpenAI API key > > Keep the server running. Supply your **OpenAI key per job**: > > > [tab] HTTP / cURL > > > > ```bash theme={"system"} > > curl http://127.0.0.1:8390/jobs/submit \ > > -H 'Content-Type: application/json' \ > > -d '{ > > "job": { > > "tasks": [{"name": "hello-world/hello-world"}], > > "agents": [{ > > "name": "codex", > > "model_name": "openai/gpt-6.1-sol", > > "env": {"OPENAI_API_KEY": "your-openai-key"} > > }], > > "environment": {"type": "docker"} > > } > > }' > > ``` > > > [tab] Harbor CLI > > > > ```bash theme={"system"} > > harbor run --server http://127.0.0.1:8390 \ > > --task hello-world/hello-world \ > > --agent codex --model openai/gpt-6.1-sol \ > > --agent-env OPENAI_API_KEY=your-openai-key \ > > --env docker --watch > > ``` > > > [tab] Python SDK > > > > ```python submit_job.py theme={"system"} > > from harbor import Harbor > > > > client = Harbor() > > job = client.submit_job(job={ > > "tasks": [{"name": "hello-world/hello-world"}], > > "agents": [{ > > "name": "codex", > > "model_name": "openai/gpt-6.1-sol", > > "env": {"OPENAI_API_KEY": "your-openai-key"}, > > }], > > "environment": {"type": "docker"}, > > }) > > job_id = job.job_id > > print(job_id) > > print(client.get_job(job_id)) > > print(client.list_rollouts(job_id=job_id)) > > client.close() > > ``` > > > [tab] MCP > > > > > Use the Harbor MCP server at [http://127.0.0.1:8390/mcp](http://127.0.0.1:8390/mcp) to run hello-world/hello-world with Codex (openai/gpt-6.1-sol) on Docker, setting OPENAI\_API\_KEY=your-openai-key in the agent env. Show the job ID, job, and rollouts. > > Replace `your-openai-key` with your key. This makes real OpenAI API calls; no server restart is needed. > [accordion] Run Codex on Daytona with an OpenAI API key > > Restart the server with **Daytona credentials**: > > ```bash theme={"system"} > uv pip install "harbor[daytona]" > export DAYTONA_API_KEY="your-daytona-key" > harbor serve > ``` > > Submit the **OpenAI key per job** using your chosen client: > > > [tab] HTTP / cURL > > > > ```bash theme={"system"} > > curl http://127.0.0.1:8390/jobs/submit \ > > -H 'Content-Type: application/json' \ > > -d '{ > > "job": { > > "tasks": [{"name": "hello-world/hello-world"}], > > "agents": [{ > > "name": "codex", > > "model_name": "openai/gpt-6.1-sol", > > "env": {"OPENAI_API_KEY": "your-openai-key"} > > }], > > "environment": {"type": "daytona"} > > } > > }' > > ``` > > > [tab] Harbor CLI > > > > ```bash theme={"system"} > > harbor run --server http://127.0.0.1:8390 \ > > --task hello-world/hello-world \ > > --agent codex --model openai/gpt-6.1-sol \ > > --agent-env OPENAI_API_KEY=your-openai-key \ > > --env daytona --watch > > ``` > > > [tab] Python SDK > > > > ```python submit_job.py theme={"system"} > > from harbor import Harbor > > > > client = Harbor() > > job = client.submit_job(job={ > > "tasks": [{"name": "hello-world/hello-world"}], > > "agents": [{ > > "name": "codex", > > "model_name": "openai/gpt-6.1-sol", > > "env": {"OPENAI_API_KEY": "your-openai-key"}, > > }], > > "environment": {"type": "daytona"}, > > }) > > job_id = job.job_id > > print(job_id) > > print(client.get_job(job_id)) > > print(client.list_rollouts(job_id=job_id)) > > client.close() > > ``` > > > [tab] MCP > > > > > Use the Harbor MCP server at [http://127.0.0.1:8390/mcp](http://127.0.0.1:8390/mcp) to run hello-world/hello-world with Codex (openai/gpt-6.1-sol) on Daytona, setting OPENAI\_API\_KEY=your-openai-key in the agent env. Show the job ID, job, and rollouts. ## Check progress and results **Recommended: use the Harbor viewer** to monitor live progress and browse results and artifacts: ```bash theme={"system"} harbor view --server http://127.0.0.1:8390 ``` ![Rollouts move from queued to running to finished. Queued rollouts can pause or cancel; running rollouts can cancel through cancelling. Retry creates a new rollout.](https://mintcdn.com/harborframework/vzYWOwnch5t54m5e/images/rollout-lifecycle.png?fit=max\&auto=format\&n=vzYWOwnch5t54m5e\&q=85\&s=3641a8234e7a9280ad02de14bdf11c55) Rollout lifecycle. > [accordion] Check through the API > > Use the returned ID with [Get job](/api-sdk/jobs/get-job) and [List rollouts](/api-sdk/rollouts/list-rollouts): > > ```bash theme={"system"} > JOB_ID="paste-job-id" > curl "http://127.0.0.1:8390/jobs/$JOB_ID" > curl "http://127.0.0.1:8390/rollouts?job_id=$JOB_ID" > ``` > > Poll until `finished` or `cancelled`. `finished` means execution ended; inspect rollout `error_type` and `rewards` for the outcome. > > [Get rollout](/api-sdk/rollouts/get-rollout) returns its full result and artifact URI map. Pass a file URI to [Download](/api-sdk/files/download), or use `client.download(uri, destination)` to save it locally. > [accordion] Request behavior > > * Submit a `JobConfig`; optional `/jobs/resolve` returns a lock for inspection, not submission. > * Lists return summaries and `next_cursor`; pass it as `cursor` with unchanged filters for the next page. Detail endpoints return full records. > * Pause affects queued rollouts. Cancel stops queued and running rollouts; `soft: true` lets running rollouts finish. Retry creates a new rollout ID in the same job. > * Submission and retry accept `Idempotency-Key` (`idempotency_key` in the SDK). Reuse it after a lost response; duplicates return `409` with the original ID. The SDK does not retry requests automatically. > * HTTP errors return `{"error": {"code": "...", "message": "..."}}`; the SDK raises `harbor.client.APIError`. `Harbor-API-Version` is optional; the SDK supplies it. ## Server settings | Setting | Behavior | | - | - | | `--host`, `--port` | Default: `127.0.0.1:8390`. | | `--data-dir` | Defaults to `.harbor`; persists jobs, results, and artifacts. Use one server process per directory. | | `--max-concurrent` | Default: `8092` running rollouts across all jobs. Each job also has `n_concurrent_trials`. | | `HARBOR_API_KEY` | Optional locally; required for non-local binding or relay. When set, clients send `Authorization: Bearer `. The CLI and SDK read it from their environment. | Use HTTPS for remote deployments. Set sandbox-provider credentials, such as `DAYTONA_API_KEY`, on the server; send model credentials per job through `agents[].env`. `environment.env` sets variables **inside** the sandbox, not provider credentials. The **API & SDK** tab has the [endpoint reference](/api-sdk/jobs/submit-job), and your server exposes its OpenAPI schema at `/openapi.json`. # API overview Source: https://docs.harborframework.com/hosted-harbor/api Base URL, authentication, and error shapes for the remote rollout API The launch functionality available through the Web UI and CLI is largely available through an API. The base URL for all endpoints is: ```text theme={"system"} https://ofhuhcpkvzjlejydnvyd.supabase.co/functions/v1 ``` ## Authentication Every request needs a Harbor API key sent as a bearer token. See [Harbor Hub API key](/hosted-harbor/api-key) for how to create one. ```http theme={"system"} Authorization: Bearer sk-harbor-... Content-Type: application/json ``` ## Errors All errors share one shape: ```json theme={"system"} { "error": { "code": "validation_failed", "message": "config must contain at least one agent" } } ``` | Code | Status | Meaning | | - | - | - | | `bad_request` | 400 | Malformed request, or a missing/oversized `Idempotency-Key` | | `validation_failed` | 400 | The body parsed but broke a schema or server-side rule | | `unauthorized` | 401 | Missing or invalid API key | | `forbidden` | 403 | Not approved for remote rollouts, or not a member of the chosen organization | | `not_found` | 404 | The job does not exist or is not visible to you | | `method_not_allowed` | 405 | HTTP method not supported on that path | | `replacement_required` | 409 | A credential with this identity already exists; confirm the replacement | | `replacement_stale` | 409 | The credential changed while you were confirming; re-read and retry | | `quota_exceeded` | 429 | You are over your hosted quota | | `server_error` | 500 | Internal failure | | `agent_version_resolution_failed` | 503 | Could not resolve the latest agent version; retry | # Harbor Hub API key Source: https://docs.harborframework.com/hosted-harbor/api-key Create a Harbor Hub API key To authenticate any command via the [CLI](/hosted-harbor/cli) or [API](/hosted-harbor/api), you must first create a Harbor API key. ## CLI If using the CLI, an API key is minted automatically when you successfully run `harbor auth login`. The key is stored in `~/.harbor/credentials.json` and revoked upon `harbor auth logout`. You can also authenticate the CLI via the `HARBOR_API_KEY` environment variable. The next section demonstrates creating an API key via the web UI. ## Web UI To mint an API key on the web UI, first go to [the Hub](https://hub.harborframework.com). Click on your profile in the top-right corner: ![The Harbor Hub home page, listing published datasets](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/hub-home.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=f86605d6cc0529b7a5f16d339a442abb) Then click the **Settings** tab: ![Profile page](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/hub-settings.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=5feff5526a2797eeb0bc015a7e7d1b31) Scroll down to the API keys section and click **Create API key**. Give the key a name and an expiration date. Store this key somewhere safe. It has full access to your Harbor Hub account. ![Profile page](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/harbor-api-key.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=4a72af19e81f2d2b5fac83ac892bd567) # CLI Source: https://docs.harborframework.com/hosted-harbor/cli Launch remote rollouts and browse jobs, trials, and secrets from the harbor CLI Please ensure you have either logged in with `harbor auth login` or minted an API key (see [Harbor Hub API key](/hosted-harbor/api-key)) ## Launching a Job The command `harbor run --launch` will attempt to launch a job under your personal organization The `--launch` flag can be combined with a singular agent/model combination (e.g. `harbor run --launch -a claude-code -m anthropic/fable-5 -d harbor/hello-world`). Agent/model sweeps must be launched using a config file (e.g. `harbor run --launch -c config.yaml`) ```yaml theme={"system"} # config.yaml job_name: opus-vs-codex-sweep organization: my-org # omit to use your personal org credential_mode: gateway # or "direct" n_attempts: 3 # 1-10 n_concurrent_trials: 32 # 1-1000 # Every agent runs against every task. Trials = n_attempts x tasks x agents. agents: - name: claude-code model_name: anthropic/claude-opus-4-1 secrets: - name: ANTHROPIC_API_KEY tag: default as: ANTHROPIC_API_KEY - name: claude-code model_name: anthropic/claude-sonnet-5-5 secrets: - name: ANTHROPIC_API_KEY tag: default as: ANTHROPIC_API_KEY - name: codex model_name: openai/gpt-5 secrets: - name: OPENAI_API_KEY tag: default as: OPENAI_API_KEY - name: HF_TOKEN tag: default as: HF_TOKEN n_concurrent: 8 # per-agent sub-limit under n_concurrent_trials env: RUST_LOG: info # nonsensitive only - secrets go in `secrets` - name: oracle # needs no inference credential secrets: [] datasets: - name: terminal-bench/terminal-bench-2-1 ref: "6" # `ref` or `version`, never both n_tasks: 25 exclude_task_names: - "flaky-*" tasks: - name: harbor/hello-world ref: latest # Supplied for this job only, read from your local environment at launch. job_secrets: HF_TOKEN: from_env: HF_TOKEN retry: max_retries: 2 include_exceptions: - EnvironmentStartError ``` ### Injecting Secrets Use `--stored-secret NAME[@TAG][=AS]` to select a stored credential, or `--one-off-secret NAME` to read a job-only secret from your local environment. These flags add selections to every agent in the job. For per-agent selections, use `agents[].secrets` in the config. ```bash theme={"system"} harbor run --launch -d harbor/hello-world -a codex -m openai/gpt-5 \ --stored-secret OPENAI_API_KEY@production=MODEL_KEY --api-key-name MODEL_KEY ``` See [agent secrets](/hosted-harbor/submitting-jobs#agent-secrets) for tags, aliases, and one-off precedence. | Flag | Value | Effect | | - | - | - | | `--dry-run` | — | Validate without queuing. Resolves tasks, agents, and the owning org, checks selections, and reports the trial count | | `--org` | `TEXT` | Organization that should own the hosted job. Defaults to your personal org | | `--credential-mode` | `gateway` \| `direct` | `gateway` proxies the key through the Hub, `direct` hands the real key to the agent | | `--stored-secret` | `NAME[@TAG][=AS]` | Select a secret already stored in the owning org. Repeatable | | `--one-off-secret` | `NAME[=VALUE]` | Supply a secret for this job only. Bare `NAME` reads it from your environment. Repeatable | | `--env-file` | `PATH` | Load a `.env`. Every name in it is selected, as with `--one-off-secret` | | `--registry-secret` | `HOST=NAME_OR_ID` | Pin a stored pull secret for a private image host. Repeatable | | `--no-secrets` | — | Launch with no credentials at all | `--launch` and `--upload` are mutually exclusive, so the upload-side flags do not apply to a hosted launch: `--upload`, `--public` / `--private`, and `--share`. ### Credential proxy configuration Use `environment.credential_proxy` to describe destination rules and HTTP header templates in a hosted job config. The following example describes a rule for `POST` requests to paths starting with `/v1/` on `inference.example.com`. It references `NEW_LLM_API_KEY`, which must be selected in the agent's `secrets` list. See [Injecting Secrets](#injecting-secrets) for stored and one-off credential options. ```yaml config.yaml theme={"system"} credential_mode: gateway agents: - name: codex model_name: openai/gpt-5 secrets: - name: OPENAI_API_KEY tag: default as: OPENAI_API_KEY - name: NEW_LLM_API_KEY tag: default as: NEW_LLM_API_KEY tasks: - name: harbor/hello-world ref: latest environment: credential_proxy: inference.example.com: - match: path: startsWith: /v1/ method: [POST] transform: - headers: Authorization: "Bearer ${NEW_LLM_API_KEY}" ``` Each destination is an exact DNS host mapped to a list of rules: | Field | Description | | - | - | | `match.path.startsWith` | Optional path prefix to match, such as `/v1/`. | | `match.method` | Optional list of HTTP methods, such as `[POST]`. | | `transform` | Required list of header transformations. Each entry contains a `headers` mapping from header names to string templates. | Omitting `match` describes all requests to that host. Proxy rules do not grant network access; network allowlists are configured separately. #### Header templates Header values can combine literal text with `${SECRET_NAME}` references, including multiple references in one value. Secret names start with an uppercase letter and contain uppercase letters, digits, or underscores, up to 64 characters. The CLI preserves templates in memory and never substitutes local environment values into them. ## Regrading Add `--launch` to regrade recorded Hub results with an updated verifier. This creates a new private job without rerunning the agent or changing the source. Specify `--org` for the launch organization's credits, permissions, and credentials. It must match the source organization, and you must have permission to launch there; shared read access alone is insufficient. ### Regrade a job ```bash theme={"system"} harbor job regrade --launch --org -d org/dataset@version harbor job regrade --launch --org -p ./updated-tasks ``` Use `-d` for datasets, `-p` for local task directories, or `-t` for registry tasks. These options are repeatable and can be combined. Verifiers match by task name. Harbor selects the latest trial attempts with recorded archives. ### Regrade a trial ```bash theme={"system"} harbor trial regrade --launch --org -t org/task@ref ``` Use exactly one `-t` or `-p`; for `-p`, provide a single task directory. Local verifier tasks are uploaded as temporary private packages. Add `--yes` to accept launch and upload without prompting. ### Requirements Hosted regrade currently supports single-step trials with separate verifiers. Source trials must have finished, and the replacement task must have the same name and be able to grade from the recorded artifacts. Sources must be Hub UUIDs. Use `--dry-run` to validate without creating a job. With local verifier tasks, it checks inputs without uploading; full source validation happens on launch. ### Options These options apply with `--launch`. See the [secret options](#injecting-secrets) for credential details. | Option | Description | | - | - | | `--launch` | Run the regrade on Hosted Harbor. | | `--org NAME` | Launch organization. Required; must match the source organization. | | `-p, --task-path PATH` | Local verifier task. Jobs also accept parent directories; repeatable for jobs. | | `-t, --task REF` | Registry verifier task, such as `org/task@ref`. Repeatable for jobs. | | `-d, --dataset REF` | Dataset of verifier tasks. Job regrade only; repeatable. | | `-n, --n-concurrent N` | Concurrent regrades. Job regrade only. | | `--job-name NAME` | Name of the new hosted job. Job regrade only. | | `--trial-name NAME` | Currently sets the new hosted job's name for trial regrade. | | `--ve, --verifier-env KEY=VALUE` | Verifier environment variable. Repeatable. | | `--stored-secret NAME` | Stored verifier credential from the launch organization. Repeatable. | | `--one-off-secret NAME[=VALUE]` | Job-only credential; bare `NAME` reads your local environment. Repeatable. | | `--registry-secret HOST=NAME_OR_ID` | Select a stored credential for pulling private images. Repeatable. | | `--use-static-ip` | Use a static outbound IP. Otherwise, the server chooses its default. | | `-y, --yes` | Accept launch and local task upload without prompting. | | `--dry-run` | Validate without creating a job. | ## Listing Jobs Using the command `harbor hub job list` you can print out a list of all jobs visible to your user on the hub. | Flag | Value | Effect | | - | - | - | | `--scope` | `my` \| `shared` \| `all` | Visibility scope. Defaults to `my`, the jobs your user owns | | `--search` | `TEXT` | Only jobs whose names contain the substring | | `--agent` | `NAME` | Filter by agent name. Repeatable, and multiple values match any of them | | `--provider` | `NAME` | Filter by model provider. Repeatable | | `--model` | `NAME` | Filter by model. Repeatable | ## Job Overview Use the command `harbor hub job show JOB_ID JOB_ID_2 ...` to print an overview similar to the one provided on the hub. The overview reports the number of trials, errors, and retries, the average return on each metric, the cost in USD, and token usage. ## Per-Task Job Breakdown Use the command `harbor hub job tasks JOB_ID` to see a per-task breakdown of a job. | Flag | Value | Effect | | - | - | - | | `--search` | `TEXT` | Only tasks whose names contain the substring | | `--agent`, `--provider`, `--model` | `NAME` | As for [`job list`](#listing-jobs) | ## Trials Overview Use the command `harbor hub job trials JOB_ID JOB_ID_2 ...` to list trials across one or more jobs. In interactive terminals, you can switch pages to audit all trials without running a second command. | Flag | Value | Effect | | - | - | - | | `--search` | `TEXT` | Only trials whose names contain the substring | | `--agent`, `--provider`, `--model` | `NAME` | As for [`job list`](#listing-jobs) | | `--limit` | `N` | Page size. Defaults to 100 here | | `--failed-only` | — | Only trials that errored or failed | | `--include-retries` | — | Include retry history, not just the latest execution | | `--sort-by` | `started_at` \| `task_name` \| `name` \| `error_type` | Sort column | | `--sort-order` | `asc` \| `desc` | Sort direction | ## Comparing 2 or More Jobs Use command `harbor hub job compare JOB_ID JOB_ID_2 ...` to get the side-by-side grid for performance on tasks ## Job Visibility Use command `harbor hub job shares JOB_ID` to see who a job is shared with. This returns orgs and users ## Renaming Jobs Use `harbor hub job rename JOB_ID "NEW NAME"` to change the name displayed on the Hub. This does not change the job ID, artifact identity, or submitted configuration. Add `--json` to print the rename RPC response. ## Transferring Job Ownership Use `harbor hub job transfer JOB_ID ORGANIZATION` to transfer a completed job and all of its trials to another organization you own. Job and trial IDs do not change. The destination must already have access to every execution dependency used by the job. The command prompts for confirmation; pass `--yes` / `-y` when scripting. By default, the source organization keeps shared read access and job-specific secrets are permanently removed. Use `--drop-source-access` to remove the source grant or `--keep-job-credentials` to retain and reauthorize secrets you originally supplied. ## Deleting Jobs Use command `harbor hub job delete JOB_ID JOB_ID_2 ...` to permanently delete jobs you own from the hub, including all of their trials and shares. The command prompts for confirmation before deleting anything; pass `--yes` / `-y` to skip the prompt (required when scripting or piping). Only the job's owner can delete a job. Jobs linked to a leaderboard submission and hosted jobs that are still running cannot be deleted. ## Hosted Job Status Use command `harbor hub job status JOB_ID` to get your job status. Returns counts of pending, running, failed, and completed trials. ## Trial Show Use command `harbor hub trial show TRIAL_ID` to show a single trial's metadata ## Downloading a Trial Use command `harbor hub trial download TRIAL_ID` to download a particular trial | Flag | Value | Effect | | - | - | - | | `--output-dir`, `-o` | `PATH` | Directory to materialize the trial into. Defaults to `./trials` | | `--overwrite` | — | Replace an existing trial directory | | `--trajectory` | — | Download only `trajectory.json`. Errors if the trial has no stored trajectory | ## Retrying a Hosted Trial For a trial in a job that was launched remotely, you can use the command `harbor hub trial retry TRIAL_ID` to retry those trials. These flags are cumulative filters. `harbor hub trial retry --job JOB_ID --failed-only` selects every trial in the job, then narrows to the ones that failed. | Flag | Value | Selects | | - | - | - | | `--job` | `JOB_ID` | Every trial in that job | | `--search` | `TEXT` | Trials whose names contain the substring | | `--agent` | `TEXT` | Trials run with that agent | | `--provider` | `TEXT` | Trials run with that provider | | `--model` | `TEXT` | Trials run with that model | | `--task` | `TEXT` | Trials run against that task | | `--exception` | `TEXT` | Trials that failed with that exception | | `--failed-only` | — | Only trials that failed | | `--yes` | — | Skip confirmation | ## Canceling a Hosted Trial To cancel a hosted trial, use command `harbor hub trial cancel TRIAL_ID` | Flag | Value | Effect | | - | - | - | | `--job` | `JOB_ID` | Cancel every trial in the job. Same as `harbor hub job cancel JOB_ID` | | `--all` | — | Cancel every currently running trial | | `--reason` | `TEXT` | Record a reason for the cancellation | | `--yes` | — | Skip confirmation | The selection filters from [`trial retry`](#retrying-a-hosted-trial) apply here too. ## Adding Secrets Use command `harbor hub secrets add NAME` to upload a secret to the Hub. | Flag | Value | Effect | | - | - | - | | `--org` | `ORG_ID` | Organization to store the secret on. Defaults to your personal org | | `--job` | `JOB_ID` | Scope the secret to a single job instead of account-wide | | `--from-env` | — | Read the value from the local environment variable of the same name | | `--yes`, `-y` | — | Supersede an existing secret without prompting | ## Listing Secrets Use command `harbor hub secrets list` to list the names and metadata of your uploaded secrets. | Flag | Value | Effect | | - | - | - | | `--org` | `ORG_ID` | Organization to list secrets for | | `--job` | `JOB_ID` | List secrets scoped to that job | | `--include-revoked` | — | Include secrets that have been revoked | ## Deleting Secrets Use command `harbor hub secrets delete` to revoke a secret. | Flag | Value | Effect | | - | - | - | | `--org` | `ORG_ID` | Revoke a secret in that organization | | `--job` | `JOB_ID` | Revoke a secret scoped to that job | | `--purge` | — | Delete the record outright, so it no longer appears under `list --include-revoked` | ## Adding an Image Registry Secret Use command `harbor hub secrets registry add` to add an image registry secret. Also supports `secrets registry list` and `secrets registry delete`. | Flag | Value | Effect | | - | - | - | | `--name` | `TEXT` | Display name used to select the credential later | | `--from-file` | `PATH` | Read the credential from a file, such as a GAR service account JSON | | `--yes`, `-y` | — | Supersede an existing credential without prompting | ## Shared Flags The listing commands above also accept these: | Flag | Value | Effect | | - | - | - | | `--quiet`, `-q` | — | Print only IDs, for piping into `xargs` | | `--no-trunc` | — | Show full cell content, wrapping instead of truncating | | `--no-headers` | — | Omit the header row | | `--page` | `N` | Fetch one specific page, disabling interactive paging | | `--json` | — | Return the raw API response as JSON | # Custom agents Source: https://docs.harborframework.com/hosted-harbor/custom-agents Run an ACP agent from a GitHub repository Custom agents run over ACP from a source repository containing a `harbor-agent.json` manifest. Connect the repository from your profile settings before using a private one. The template below intentionally omits `source.ref`, so Harbor starts from the repository's default branch and records the resolved commit SHA in the stored job config: ```json theme={"system"} { "config": { "retry": { "exclude_exceptions": [ "AgentTimeoutError", "VerifierTimeoutError", "RewardFileNotFoundError", "RewardFileEmptyError", "VerifierOutputParseError", "ApiUsageLimitError", "AgentSafetyRefusalError" ], "include_exceptions": [] }, "agents": [ { "name": "acp", "source": { "path": ".", "repo": "/", "type": "github", "manifest": "harbor-agent.json" }, "model_name": "/", "secrets": [{"name": "", "tag": "default", "as": ""}] } ], "datasets": [ { "ref": "", "name": "/", "n_tasks": 3 } ], "job_name": "" }, "job_secrets": { "": "" }, "dry_run": false } ``` Replace every `<...>` value before submitting. To select an explicit revision, add `"ref": ""` inside `source`. The source rules are: * `name` must be `acp` when `source` is present. * `source.type` must be `github`, and `source.repo` must use `owner/repo` form. * `source.ref` is optional and accepts a branch, tag, or commit SHA. When omitted, Harbor resolves GitHub `HEAD`, which is the repository's configured default branch and is normally `main`, then records the exact commit SHA in the stored config so retries stay reproducible. * `source.path` defaults to `.` and selects the repository directory holding the agent project. * `source.manifest` defaults to `harbor-agent.json` and is resolved relative to `source.path`. * Custom agents bring their own model credentials. Supply the key in `job_secrets` or store it as a hosted secret, and name it in the agent's [`secrets`](/hosted-harbor/submitting-jobs#agent-secrets) either way. Select the credential matching `model_name`'s provider; it backs `HOSTED_INFERENCE_TOKEN` as described in [Inference Credentials](#inference-credentials). The source directory needs a locked Python project and a manifest: ```json theme={"system"} { "schema_version": 1, "id": "", "version": "", "protocol": "acp", "runtime": { "kind": "python-uv", "python": "3.12", "project": ".", "lockfile": "uv.lock", "entrypoint": ["python", "-m", ""] } } ``` `schema_version` must be `1`, `protocol` must be `acp`, `runtime.kind` must be `python-uv`, and `runtime.python` must be `"3.12"`. The entrypoint must be an executable that speaks ACP over standard input and output, and its first element is a command name rather than a path. Commit the manifest, the project files, and `uv.lock` to the repository. To check repository access, the ref, and the manifest without launching anything, send the same request with `"dry_run": true`. A successful validation returns the resolved repository, the pinned commit, the manifest identity, and the access mode. ## Inference Credentials Set `config.credential_mode` to choose how the custom agent receives its selected model credential: | Mode | `HOSTED_INFERENCE_TOKEN` | `HOSTED_INFERENCE_URL` | How to connect | | - | - | - | - | | `direct` (default) | The selected model provider's real credential | Not set | Use the provider's normal endpoint | | `gateway` | A scoped proxy credential | The hosted inference gateway URL | Use this URL with the scoped token | Read `HOSTED_INFERENCE_TOKEN` for inference authentication. Only override the provider client's base URL when `HOSTED_INFERENCE_URL` is set. An absent URL is expected in direct mode; do not require it or substitute a hard-coded gateway URL. Direct mode also injects selected secrets under their environment variable names, so agent code can read their real values. Gateway mode proxies supported inference provider credentials; selected non-provider secrets still arrive with their real values. See [Agent Secrets](/hosted-harbor/submitting-jobs#agent-secrets) for supported providers and secret selection. # Hosted Harbor Source: https://docs.harborframework.com/hosted-harbor/index Launching Jobs On The Hub The [Harbor Hub](https://hub.harborframework.com) can now be used to run remote harbor rollouts. This guide provides instructions for launching remote jobs through the CLI, web UI, and API. First, visit [the job launcher](https://hub.harborframework.com/jobs/launch). Click the link in the banner to fill out a google form for access to remote rollouts. Then follow the [API key creation guide](/hosted-harbor/api-key) to create an API key. ## Interfaces | Page | Use it for | | - | - | | [Web UI](/hosted-harbor/web-ui) | Adding secrets and launching a job from the browser | | [CLI](/hosted-harbor/cli) | Launching with `harbor run --launch`, then browsing jobs and trials | | [API overview](/hosted-harbor/api) | Base URL, authentication, and error shapes | ## API Reference | Page | Endpoints | | - | - | | [Submitting jobs](/hosted-harbor/submitting-jobs) | `POST /job-submit`, `GET /job-status` | | [Custom agents](/hosted-harbor/custom-agents) | Running an ACP agent from a GitHub repository | | [Managing secrets](/hosted-harbor/secrets) | `/secrets`, `/secrets/preflight` | | [Registry credentials](/hosted-harbor/registry-credentials) | `/registry-credentials` | | [Leaderboards](/harbor-hub/leaderboards) | Curated leaderboards from the CLI | # Registry credentials Source: https://docs.harborframework.com/hosted-harbor/registry-credentials Store credentials for pulling private task images `/registry-credentials` stores encrypted credentials for pulling private task images. It supports Google Artifact Registry (GAR), GitHub Container Registry (GHCR), and Amazon Elastic Container Registry (ECR). The examples below use `$BASE` and `$KEY`. Get a key from [Harbor Hub API key](/hosted-harbor/api-key). ```bash theme={"system"} export BASE=https://ofhuhcpkvzjlejydnvyd.supabase.co/functions/v1 export KEY=sk-harbor-... ``` ## Storing a Credential `POST /registry-credentials` validates the credential, encrypts it, and returns metadata without ever returning the secret. Every request takes a `registry_host` and a `display_name` of at most 100 characters, which is how jobs later select the credential. The provider is inferred from the host, so `provider` is optional; if you do send it, it has to agree with the host. | Provider | Host | Secret fields | | - | - | - | | `gar` | `-docker.pkg.dev` | `service_account_json` | | `ghcr` | `ghcr.io` | `username`, `token` | | `ecr` | `.dkr.ecr..amazonaws.com` | `access_key_id`, `secret_access_key` | A GAR credential: ```json theme={"system"} { "registry_host": "us-east1-docker.pkg.dev", "display_name": "prod-puller", "service_account_json": "{...service account JSON...}" } ``` Use a service account with read access to the repository you need, typically `roles/artifactregistry.reader` scoped to that repository. A GHCR credential: ```json theme={"system"} { "registry_host": "ghcr.io", "display_name": "github-packages-puller", "username": "octocat", "token": "ghp_..." } ``` Use a classic GitHub personal access token limited to `read:packages`. An ECR credential: ```json theme={"system"} { "registry_host": "123456789012.dkr.ecr.us-east-1.amazonaws.com", "display_name": "production-ecr-puller", "access_key_id": "AKIAIOSFODNN7EXAMPLE", "secret_access_key": "..." } ``` Use a long-lived IAM access key limited to the ECR pull permissions your task images need. Temporary session credentials, the ones beginning `ASIA`, are rejected because they need a session token that Harbor does not store. A successful response looks like: ```json theme={"system"} { "id": "00000000-0000-0000-0000-000000000003", "org_id": "00000000-0000-0000-0000-00000000000a", "provider": "gar", "registry_host": "us-east1-docker.pkg.dev", "display_name": "prod-puller", "fingerprint": "harbor-puller@my-project.iam.gserviceaccount.com", "status": "active", "created_at": "2026-08-13T14:30:00Z" } ``` Reusing an existing `display_name` returns `409 replacement_required` with the existing record's fingerprint; confirm it with `supersede_credential_id` exactly as with secrets. Each organization can hold at most 20 active registry credentials. For GAR, build the request from the service account file to avoid shell quoting problems: ```bash theme={"system"} curl -sS -X POST "$BASE/registry-credentials" \ -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ -d "$(jq -n --rawfile sa ./gar-puller.json \ '{registry_host:"us-east1-docker.pkg.dev", display_name:"prod-puller", service_account_json:$sa}')" ``` ## Listing and Revoking Registry Credentials `GET /registry-credentials` lists active credentials and returns metadata only. Use `status=revoked` or `status=all` to include other states. ```bash theme={"system"} curl -sS "$BASE/registry-credentials?status=active" \ -H "Authorization: Bearer $KEY" ``` `DELETE /registry-credentials` revokes a credential by default. Set `purge` to `true` only when the stored record should be permanently deleted. ```bash theme={"system"} curl -sS -X DELETE "$BASE/registry-credentials" \ -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ -d '{"credential_id":"00000000-0000-0000-0000-000000000003","purge":false}' ``` ## Using a Credential In a Job Pin a stored credential by display name or ID in `registry_credentials`, as a sibling of `config`: ```json theme={"system"} { "config": { "job_name": "private-image-job", "agents": [ { "name": "terminus-2", "model_name": "openai/gpt-4o", "secrets": [{"name": "OPENAI_API_KEY", "tag": "default", "as": "OPENAI_API_KEY"}] } ], "datasets": [ { "name": "my-org/private-image-dataset", "ref": "latest" } ] }, "registry_credentials": { "us-east1-docker.pkg.dev": "prod-puller" }, "job_secrets": { "OPENAI_API_KEY": "sk-..." } } ``` That mapping reads: for images on `us-east1-docker.pkg.dev`, use the stored credential named `prod-puller`. Keys have to be supported registry hosts, and you can send at most 20 entries. If exactly one active credential is available for a host you can leave `registry_credentials` out entirely. When several match, the launch has to pick one by display name, credential ID, or the owner-qualified display name Harbor shows. # Managing secrets Source: https://docs.harborframework.com/hosted-harbor/secrets Store, list, revoke, and preflight hosted secrets over the API `POST /secrets` stores a reusable hosted secret, such as a model API key or an environment variable a task requires. This is the API equivalent of [adding secrets](/hosted-harbor/web-ui#adding-secrets) through the Web UI. The examples below use `$BASE` and `$KEY`. Get a key from [Harbor Hub API key](/hosted-harbor/api-key). ```bash theme={"system"} export BASE=https://ofhuhcpkvzjlejydnvyd.supabase.co/functions/v1 export KEY=sk-harbor-... ``` ```json theme={"system"} { "scope": "user", "env_var": "OPENAI_API_KEY", "value": "sk-...", "provider": "openai" } ``` `scope` is `user` by default. Use `job` instead to scope a secret to a single job, which then requires a `job_id`; `job_id` is rejected when the scope is `user`. You can pass an `org_id` to place the secret in a specific organization, and an optional `provider` label of up to 64 characters. The response returns metadata only, never the value: ```json theme={"system"} { "id": "00000000-0000-0000-0000-000000000002", "scope": "user", "job_id": null, "org_id": "00000000-0000-0000-0000-00000000000a", "env_var": "OPENAI_API_KEY", "provider": "openai", "value_last4": "abcd", "status": "active", "created_at": "2026-08-13T14:30:00Z" } ``` ## Replacing a Secret Storing a secret whose `env_var` already has an active secret does not silently overwrite it. The request comes back as `409 replacement_required` along with the record you are about to replace, so you can see exactly what is being replaced: ```json theme={"system"} { "error": { "code": "replacement_required", "message": "An active secret ending in abcd already exists. Confirm that you want to supersede it.", "existing": { "id": "00000000-0000-0000-0000-000000000002", "scope": "user", "env_var": "OPENAI_API_KEY", "value_last4": "abcd", "created_at": "2026-08-13T14:30:00Z" } } } ``` Send the same request again with `"supersede_credential_id": ""` to confirm. If that ID no longer matches the active secret, because something changed in between, you get `409 replacement_stale` instead and should re-read before retrying. Superseding requires organization owner rights. The same pattern applies to registry secrets below. ## Listing and Revoking Secrets `GET /secrets` lists your secrets as metadata only. Filter with `scope`, `job_id`, and `status`, where `status` accepts `active` (the default), `revoked`, or `all`. ```bash theme={"system"} curl -sS "$BASE/secrets?scope=user&status=active" \ -H "Authorization: Bearer $KEY" ``` ```json theme={"system"} { "secrets": [ { "id": "...", "scope": "user", "job_id": null, "env_var": "OPENAI_API_KEY", "provider": "openai", "value_last4": "abcd", "status": "active", "created_at": "...", "last_used_at": null } ] } ``` `DELETE /secrets` revokes a secret by environment variable name. Set `purge` to `true` only when the stored record should be permanently deleted rather than marked revoked. ```json theme={"system"} { "scope": "user", "env_var": "OPENAI_API_KEY", "purge": false } ``` ## Checking Secrets Before Launching `POST /secrets/preflight` is an advisory check that reports whether each agent in a config will actually receive a credential its model can authenticate with. It never blocks a launch on its own. ```json theme={"system"} { "config": { "agents": [ { "name": "terminus-2", "model_name": "openai/gpt-5-mini", "secrets": [{"name": "OPENAI_API_KEY", "tag": "default", "as": "OPENAI_API_KEY"}] } ] }, "organization": "my-org", "declared_env_vars": ["OPENAI_API_KEY"] } ``` Because secrets are scoped per agent, the check is run against each agent's own selection rather than everything the organization stores: a name counts only when that agent's `secrets` lists it **and** it resolves, either to an active secret in the owning organization or to a name in `declared_env_vars`. Send `declared_env_vars` for the one-off keys you plan to pass as `job_secrets`, since preflight never sees their values. The response reports an overall `ok`, per-provider results under `providers`, per-agent detail under `agent_requirements` — each with its `model`, `provider`, `missing_env_vars`, and `configured` — and `task_requirements` listing the environment variables the resolved tasks hard-require. The older `agents` field is still returned for existing clients. A task requirement counts as met only when the secret is configured **and** `supplyable`. Reserved infrastructure names — `PATH`, `LD_PRELOAD`, anything starting with `MODAL_`, `SUPABASE_`, `HOSTED_HARBOR_`, or `GCP_`, and anything ending in `_PROXY` — are never exported into a trial's environment, so a task requiring one cannot be satisfied by supplying your own key. # Submitting jobs Source: https://docs.harborframework.com/hosted-harbor/submitting-jobs Launch a remote rollout with POST /job-submit and check its status `POST /job-submit` launches a remote rollout. The examples below use `$BASE` and `$KEY`. Get a key from [Harbor Hub API key](/hosted-harbor/api-key). ```bash theme={"system"} export BASE=https://ofhuhcpkvzjlejydnvyd.supabase.co/functions/v1 export KEY=sk-harbor-... ``` Request headers: ```http theme={"system"} Authorization: Bearer sk-harbor-... Content-Type: application/json Idempotency-Key: ``` The `Idempotency-Key` header is **required**. Requests without it are rejected, and the key may be at most 200 characters. Reusing a key returns the job that key already created instead of launching a second one, so generate a fresh key per launch and reuse it only when retrying that same launch. If `Idempotency-Key` is reused, the server will return the previous launch URL even if the config changes. The top level of the request body takes these fields: | Field | Required | Notes | | - | - | - | | `config` | yes | The job configuration | | `organization` | no | Name of the organization that will own the job. Defaults to your personal org | | `job_secrets` | no | One-off environment variable name to secret value. Added just for this job, and injected only into agents whose `secrets` sub-field name it | | `registry_credentials` | no | Registry host to stored credential name or ID `"us-east1-docker.pkg.dev": "registry-cred-stored-name"` | | `dry_run` | no | Validate and resolve everything without creating a job. Defaults to `false` | `job_secrets` and `registry_credentials` are siblings of `config`, not fields inside it. This is deliberate: it keeps plaintext secrets out of the job config that gets stored and replayed. Placing either one inside `config` is rejected. Upon submission these credentials are routed through an encryptor and decrypted only at runtime. Plaintext secrets are never stored on our platform. Here is a launch using a registry dataset and a built-in agent: ```json theme={"system"} { "config": { "job_name": "I-love-harbor", "agents": [ { "name": "terminus-2", "model_name": "openai/gpt-5.6-luna", "secrets": [{"name": "OPENAI_API_KEY", "tag": "default", "as": "OPENAI_API_KEY"}] } ], "datasets": [ { "name": "harbor/hello-world", "ref": "latest", "n_tasks": 5 } ], "n_attempts": 1, "n_concurrent_trials": 20 }, "job_secrets": { "OPENAI_API_KEY": "sk-..." }, "dry_run": false } ``` A successful launch returns the job and its viewer URL: ```json theme={"system"} { "job_id": "00000000-0000-0000-0000-000000000001", "job_name": "I-love-harbor", "viewer_url": "https://hub.harborframework.com/jobs/00000000-0000-0000-0000-000000000001", "status_url": "https://hub.harborframework.com/jobs/00000000-0000-0000-0000-000000000001", "n_trials": 1, "owner_org": { "id": "...", "name": "...", "max_running_trials": 1000 }, "agent_sources": [] } ``` `owner_org` reports which organization ended up owning the job, and `agent_sources` echoes any resolved custom agent sources including their pinned commits. On a dry run no job is created, so `job_id` comes back `null`, but every source is still resolved and validated. When present, `owner_org.max_running_trials` is the organization's effective concurrent-trial limit. It applies across the organization's jobs, independently of a job's requested `n_concurrent_trials`. To submit a request stored in `launch.json`: ```bash theme={"system"} BASE="https://ofhuhcpkvzjlejydnvyd.supabase.co/functions/v1" KEY="sk-harbor-..." curl -sS -X POST "$BASE/job-submit" \ -H "Authorization: Bearer $KEY" \ -H "Content-Type: application/json" \ -H "Idempotency-Key: $(uuidgen)" \ -d @launch.json ``` ## Job Config `config` mirrors the `JobConfig` the CLI sends, so unrecognized keys pass through untouched. The fields the API validates directly are: | Field | Required | Notes | | - | - | - | | `agents` | yes | At least one agent | | `tasks` | no | Individual tasks | | `datasets` | no | Registry or git repo datasets | | `job_name` | no | Defaults to a UTC timestamp such as `2026-08-13__14-30-00` (this timestamp can be super annoying to look through later. So seriously consider setting a name) | | `n_attempts` | no | Between 1 and 10. Defaults to 1 | | `n_concurrent_trials` | no | Between 1 and 1000. Defaults to 4 | | `credential_mode` | no | `direct` (default) injects selected decrypted credentials into the task sandbox. `gateway` opts into credential proxying for supported inference providers | | `retry` | no | `max_retries` (default `0`), plus `include_exceptions` and `exclude_exceptions` lists. See [Retry Settings](#retry-settings) | You need at least one of `tasks` or `datasets`, and together they must resolve to at least one task. The total number of trials is `n_attempts × tasks × agents`, and must land between 1 and 50,000. On each agent, `name` is the Harbor agent type, `model_name` is the model it uses, and `secrets` is the list of credentials that agent receives. Agent versions installed from a package manager are pinned when the job is submitted, so every trial in a job installs the same release even if the job sits queued across an upstream publish. ## Retry Settings `config.retry.max_retries` is the maximum number of additional executions for each trial after an eligible exception. It defaults to `0`, so retries are disabled unless you request them. A non-empty `include_exceptions` list limits retries to those exception names; an empty or `null` list allows any exception not excluded. `exclude_exceptions` takes precedence over the include list. Omitting it preserves the default exclusions. A retry requires both an eligible exception and remaining retry budget. A low score alone does not trigger a retry, and retries do not add scored samples. For example, `n_attempts: 4` with `retry.max_retries: 3` allows up to `4 × (1 + 3) = 16` executions per task per agent, while keeping 4 trial slots. A trial that exhausts its retries may finish with an error instead of a score. ## Agent Secrets Each agent selects its own credentials through `secrets`. Every selection requires three fields: | Field | Meaning | | - | - | | `name` | Source environment variable name, such as `OPENAI_API_KEY` | | `tag` | Exact stored variant, or `default` for the default credential | | `as` | Environment variable name delivered to the agent | ```json theme={"system"} { "name": "codex", "model_name": "openai/gpt-5", "model_api_key_name": "MODEL_KEY", "secrets": [ {"name": "OPENAI_API_KEY", "tag": "production", "as": "MODEL_KEY"}, {"name": "OPENAI_API_KEY", "tag": "judge", "as": "JUDGE_KEY"} ] } ``` This selects two variants of `OPENAI_API_KEY` under different delivered names. `model_api_key_name` explicitly tells Harbor which delivered credential the model uses; an alias alone does not set it. Delivery names must be unique within an agent, which can select up to 64 secrets. Use `"secrets": []` for an agent that needs no credentials, such as `oracle` or `nop`. For `tag: "default"`, a [job one-off](#job-secrets) with the source `name` takes precedence over the organization's stored default. Renaming happens afterward. Other tags select only that exact stored variant. The CLI shorthand is `--stored-secret NAME[@TAG][=AS]`. Omitting the tag selects `default`; omitting the alias keeps the source name. For example, `--stored-secret OPENAI_API_KEY` expands to `{"name": "OPENAI_API_KEY", "tag": "default", "as": "OPENAI_API_KEY"}`. Use `--api-key-name MODEL_KEY` for the CLI equivalent of `model_api_key_name`. Config files require all three fields; string entries are rejected. With `credential_mode: "direct"`, real secret values enter the task sandbox. In `gateway` mode, every selected secret arrives as a proxy handle instead. Keep secret values in [`job_secrets`](#job-secrets) or the organization's stored credentials. Agent `env` is for nonsensitive environment variables only. ## Tasks Use `tasks` for individual tasks. Each entry is either a registry task or a git task, never both. A registry task takes a `name` in `org/name` form and an optional `ref`, which is a version ref like `"latest"`, or a semantic version string. A git task takes a `git_url` and a `path`, where `path` is the task directory relative to the repository root and is **required**. Pin the revision with either `git_ref` (a branch, tag, or SHA) or `git_commit_id` (a resolved 40-character SHA), but not both. Git tasks use those fields rather than `ref`, and local filesystem paths cannot be used for remote rollouts. ```json theme={"system"} { "config": { "job_name": "individual-tasks", "agents": [ { "name": "terminus-2", "model_name": "openai/gpt-5-mini", "secrets": [{"name": "OPENAI_API_KEY", "tag": "default", "as": "OPENAI_API_KEY"}] } ], "tasks": [ { "git_url": "https://github.com/owner/private-tasks.git", "git_ref": "main", "path": "tasks/my-task" }, { "name": "terminal-bench/torch-tensor-parallelism", "ref": "latest" } ] }, "job_secrets": { "OPENAI_API_KEY": "sk-..." }, "dry_run": false } ``` Private GitHub repositories have to be connected or shared through the profile settings flow before they can be used as a task or agent source. TODO: add pics here. ## Datasets Use `datasets` for registry or git repo datasets. A registry dataset takes a `name` in `org/name` form and either `ref` or `version`, but never both. You can narrow it with `n_tasks` to cap how many tasks are drawn, and with the `task_names` and `exclude_task_names` glob patterns. A git repo dataset uses Harbor's `repo` source string, the same grammar as `harbor run --repo`. That accepts `org/name`, `github.com/org/name`, a full https or ssh URL, or a GitHub `/tree//` URL, each with an optional trailing `@`. The optional `path` is the tasks directory relative to the repository root, which Harbor defaults to `tasks`. ```json theme={"system"} { "datasets": [ { "repo": "my-org/my-tasks@main", "path": "tasks", "n_tasks": 5 } ] } ``` Git repo datasets pin their revision inside the repo string, so they do not take `ref` or `version`. They also do not accept `git_url`, `git_ref`, or `git_commit_id` — those belong to `tasks`. Whatever a `latest` or a tag resolves to is pinned into the stored config, so a saved job records the concrete version that actually ran rather than a moving reference. ## Job Secrets `job_secrets` is a flat map of environment variable name to value: ```json theme={"system"} { "OPENAI_API_KEY": "sk-..." } ``` Names must be uppercase and start with a letter, values must be non-empty and at most 16,384 characters, and you can send at most 50 entries. Values are encrypted before storage and never returned. Secret-looking environment variables found inside `config` are automatically moved into this encrypted channel before anything is saved, so plaintext never lands in a stored config. If the same name appears in both places, the explicit `job_secrets` entry wins. Sending a value here makes it available to the job. Select it in each agent's [`secrets`](#agent-secrets) using the matching source `name` and `tag: "default"`. To use a stored credential instead, leave its value out of `job_secrets`. ## Job Status `GET /job-status` returns trial counts for one or more jobs. ```bash theme={"system"} curl -sS "$BASE/job-status?job_id=" \ -H "Authorization: Bearer $KEY" ``` Pass `job_id` once per job to check several at a time, or a comma-separated `job_ids` list. Add `force_combined=true` to get the combined overview shape even for a single job. The same request works as a `POST` with a `{"job_ids": [...], "force_combined": false}` body. A single-job response reports `pending`, `running`, `completed`, `failed`, `canceled`, and `total`. # Web UI Source: https://docs.harborframework.com/hosted-harbor/web-ui Add secrets and launch a remote rollout from Harbor Hub ## Adding Secrets Unless you are running the `oracle` or `nop` agents which do not require API model inference, the first step will be adding your API secrets. On the Harbor Hub, everything is owned by organizations. This includes jobs, trials, packages, and secrets. When running remote rollouts, secrets will be selected from the organization chosen to own the job. To add secrets to your personal org on the Web UI, first go to [The Hub](https://hub.harborframework.com) Click on your profile in the top right corner: ![The Harbor Hub home page, listing published datasets](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/hub-home.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=f86605d6cc0529b7a5f16d339a442abb) Then click on your settings tab: ![Profile Page](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/hub-settings.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=5feff5526a2797eeb0bc015a7e7d1b31) Scroll down to the secrets section, and click "Add secret": ![Secrets Tab](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/add-secrets.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=96a8b20a0d141460ac1e6863a4ae6ecb) Add a registry secret or an environment variable secret: ![Secrets Modal](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/secret-modal.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=4acc892a2410a0d6e6b4bc32952bd49d) Environment secrets can be injected into the agent runtime during a rollout, registry secrets are never injected, and only used to resolve private image repositories referenced by tasks. ## Adding Secrets To Organizations To add a secret to an organization you own, click the "Organization" button on the top of the page: ![Org Button](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/org-button.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=1b850c3920a4aa30adf9aea2efdf8bb6) Select an organization that you own, or create a new one. Then select the settings tab of the organization to view the saved secrets there. Note that only organization owners may modify secrets. ![Add Org Secrets](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/org-settings.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=6cc0cb9ab529b75521d5d10511c02ebb) Finally, add a secret: ![Add Org Secrets](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/org-add-secret.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=d9ee70aa8882fcf365016930d7c32881) ## Launching a Job After adding your secrets, go to the [job launcher](https://hub.harborframework.com/jobs/launch). First, select the organization that should own this job. ![Select Organization](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/select-organization.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=7b05a41f0be5c45dcab5ef6f1e93a9cf) Then, select the dataset or task that you would like to evaluate. You can select tasks and datasets that have been uploaded to the hub, or to GitHub. For private GitHub tasks, you must first connect your private GitHub repositories from your profile settings. ![Select Sources](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/select-source.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=0974476e14df30752f26d9f8a2bb30db) ### Adding Agents Next, select the agent/model combinations that you would like to evaluate. Harbor Hub defaults to **direct credential mode**, with **Disable credential proxying** checked. This injects selected credentials into the task sandbox, where agent code can read them. Gateway policy and accounting do not apply in direct mode. To opt into **gateway mode**, uncheck **Disable credential proxying**. Supported inference provider keys are then replaced with scoped proxy credentials. Selected non-provider secrets still arrive with their real values; see [Agent Secrets](/hosted-harbor/submitting-jobs#agent-secrets) for provider support and credential handling. ![Select Agent](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/select-agent.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=d7c3215ec5994273accae1a1aae54966) Custom agents must be stored on GitHub and compatible with ACP. Read `HOSTED_INFERENCE_TOKEN` for the selected model credential. Gateway mode also sets `HOSTED_INFERENCE_URL`; direct mode leaves it unset, so use the provider's normal endpoint. See [Custom Agents](/hosted-harbor/custom-agents#inference-credentials) for the full contract. After selecting your agent, you may add additional environment variables that you would like set. THIS FIELD IS NOT FOR SECRETS. Environment variables placed in these fields are persisted plaintext in the job config. Open **Agent Configuration** to configure the selected agent's options. Agents with a declared options schema show typed controls and descriptions for their supported kwargs. You can also inspect a deployed agent's options with `harbor agent schema claude-code --hub`, replacing `claude-code` with the agent name. ### Choosing Secrets to Inject Once you have finished configuring the agents, choose which credentials each one receives. The `Secrets` section lists the names of every secret uploaded to the owning organization. You can select any number of them per agent, including more than one inference provider key. ![Select Secrets](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/select-secret-settings.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=ffffe47a6f479cdabe030cd84b46a9c7) Every selected secret is injected. One of them is also renamed: the key whose provider matches that agent's selected model arrives under the name the agent expects, so you do not have to store a second copy of it under a different name. Everything else you selected is injected under its own name. For example, running `claude-code` against `openrouter/zai/glm-5.2`, you would select your organization's `OPENROUTER_API_KEY`. It matches the model's `openrouter/` provider, and `claude-code` reads its credential from `ANTHROPIC_API_KEY`, so that is the name it is injected under. Any other secrets you selected, an `OPENAI_API_KEY`, a token a task needs, arrive unchanged. If none of the selected secrets match the model's provider, nothing is renamed and the agent starts without a credential, so the trial fails with a credential error. Selecting only `OPENAI_API_KEY` for that OpenRouter model does exactly this: the key is injected under its own name, but it is not the one the model needs. ### Overall Job Settings The overall job settings include the name, retries, attempts, concurrency, and timeout multiplier. ![Select Job Settings](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/select-job-settings.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=84c6150abc296067262566de98a176cf) **Name** Naming the job is recommended as the default timestamp can be difficult to identify later. **Retries** Retries set the maximum number of additional executions for each trial after an eligible exception. The default is `0`, which disables retries. Eligibility depends on the exception include/exclude settings and the remaining retry budget; a low score alone does not trigger a retry. See [Retry Settings](/hosted-harbor/submitting-jobs#retry-settings). **Attempts** Attempts per task set the number of independent trials for each task and agent combination. For example, 4 attempts with 3 retries allow up to `4 × (1 + 3) = 16` executions per task per agent: each of the 4 trials can run once and retry up to 3 times. Retries replace a failed execution; they do not add scored samples. There are still 4 trial slots, and a trial that exhausts its retries may finish with an error instead of a score. **Concurrent Trials** Concurrency can be set based on your api key rate limits. Harbor Hub will monitor concurrency and back off if rate limits are causing failures, but it is recommended to set concurrency such that rate limit failures do not occur. **Timeout Multiplier** Finally, the timeout multiplier refers to the time limit an agent has to complete a task. The time limit is declared in the task, but if you would like to modify this timeout without modifying the task, you can set the timeout multiplier to something other than `1.0`. e.g. `0.5` gives half of the time limit, `2.0` gives twice as much time. ### Advanced Job Settings ![Select Advanced Settings](https://mintcdn.com/harborframework/Gs5DwVkRMDXhj7Hx/images/hosted-harbor/advanced-options.png?fit=max\&auto=format\&n=Gs5DwVkRMDXhj7Hx\&q=85\&s=f6302b5b17990472135b21f05050e6ed) # Artifact collection Source: https://docs.harborframework.com/jobs/artifact-collection Preserve files produced during a trial. Harbor collects artifacts after the agent phase for two purposes: 1. saving files for local inspection 2. transferring agent-produced files into a separate verifier sandbox. ## Automatic artifact collection > [!WARNING] > > Automatic collection from `/logs/artifacts/` will be removed soon. Configure > artifacts explicitly for new tasks. Files written to `/logs/artifacts/` in the main sandbox are collected **automatically**. Harbor does not tell the agent to use this directory; specify it in the task instruction when the agent should produce the artifact. ```md instruction.md theme={"system"} Save the final report to `/logs/artifacts/report.json`. ``` They are saved under `/artifacts/logs/artifacts/` and shown in the viewer's [**Artifacts** tab](/results/view-job-results#trial-files). ## Configure artifact collection Use `--artifact` for a run, `artifacts` in `config.json`, or `artifacts` in the task's `task.toml`. > [!NOTE] > > Both forms below accept a file or directory. And you can specify multiple artifacts. ### Basic > [tab] CLI > > `--artifact` is repeatable. > > ```bash theme={"system"} > export OPENAI_API_KEY="..." > harbor run \ > -t hello-world/hello-world \ > -a codex -m openai/gpt-5.6-sol \ > --artifact /app/hello.txt > ``` > [tab] Run config > > ```json config.json theme={"system"} > { > "artifacts": ["/app/hello.txt"] > } > ``` > [tab] Task config > > ```toml task.toml theme={"system"} > artifacts = ["/app/hello.txt"] > ``` `/app/hello.txt` is saved as `/artifacts/app/hello.txt` on the host. Run-level artifacts are added to task-level artifacts. ### Advanced options Use the object form to change the saved path or exclude files from a directory. These options require a run or task config. Add multiple entries to collect files and directories together. > [tab] Run config > > ```json config.json theme={"system"} > { > "artifacts": [ > { > "source": "/workspace/output", > "destination": "output", > "exclude": ["*.tmp"] > }, > { > "source": "/app/report.json", > "destination": "report.json" > } > ] > } > ``` > [tab] Task config > > ```toml task.toml theme={"system"} > artifacts = [ > { source = "/workspace/output", destination = "output", exclude = ["*.tmp"] }, > { source = "/app/report.json", destination = "report.json" }, > ] > ``` On the host, these are saved as `/artifacts/output/` and `/artifacts/report.json`. | Field | Description | | - | - | | `source` | File or directory inside the sandbox. | | `destination` | Optional relative path under `/artifacts/`. | | `exclude` | Patterns excluded when collecting a directory. | | `service` | Compose service to collect from. Defaults to `main`. | ## Separate verifier The verifier runs in a new sandbox. From the agent sandbox, Harbor transfers only the declared artifacts and the automatic `/logs/artifacts/` directory. Use the same `artifacts` field; there is no separate artifact configuration. ```toml task.toml theme={"system"} artifacts = ["/app/report.json"] [verifier] environment_mode = "separate" ``` Harbor collects `/app/report.json` from the agent sandbox and places it at `/app/report.json` in the verifier sandbox. `destination` controls only where the artifact is saved on the host. Learn more about [separate verifiers](/tasks/separate-verifier). > [!WARNING] > > Separate verifiers do not inherit runtime mounts or `extra_docker_compose` > overlays. Install grading dependencies in the verifier image and transfer > agent outputs as artifacts. ## Collection manifest Harbor writes `/artifacts/manifest.json` as a collection report. Each entry records the artifact's source, host destination, service, file type, and status: `ok`, `empty`, `failed`, or `skipped`. Directory entries also record the `exclude` patterns used during collection, and regrade requires the updated declaration to use the same ones. ![The Harbor viewer displaying manifest.json with artifact sources, destinations, types, and statuses](https://mintcdn.com/harborframework/EOiRHkwCtHMj3USM/images/artifact-viewer-manifest.png?fit=max\&auto=format\&n=EOiRHkwCtHMj3USM\&q=85\&s=7a33740e66c21035004dfef2a58bdfef) manifest.json > [!NOTE] > > A collection failure is recorded in the manifest without failing the trial. If two entries would write to overlapping host paths, Harbor keeps the first and records the other as `skipped` instead of overwriting it. ## Sidecar artifacts For [multi-container tasks](/tasks/multi-container), set `service` to a Compose service. A `verifier.collect` hook can first write runtime state to a file for collection. ```toml task.toml theme={"system"} artifacts = [ { source = "/var/log/api/orders.log", service = "api" }, { source = "/tmp/stats.json", service = "api" }, ] [[verifier.collect]] service = "api" command = "curl -s http://localhost:8000/stats > /tmp/stats.json" timeout_sec = 30 ``` Sidecar artifacts and collection hooks require a Compose-capable sandbox. See the [working example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/sidecar-artifacts) and [provider capabilities](/sandboxes/pre-integrated-sandboxes#provider-capabilities). ## Multi-step tasks For [multi-step tasks](/tasks/multi-step), step-level artifacts are added to the task- and run-level artifacts. Harbor collects them before each step's verifier and stores them under `steps//artifacts/`. ## View artifacts Open a trial's [**Artifacts** tab](/results/view-job-results#trial-files) in the results viewer. ![The Harbor results viewer displaying a collected hello.txt artifact](https://mintcdn.com/harborframework/EOiRHkwCtHMj3USM/images/artifact-viewer-file.png?fit=max\&auto=format\&n=EOiRHkwCtHMj3USM\&q=85\&s=aa546d9e3eff1d1e9d9e2e44563cc594) Collected artifacts in viewer # Configs Source: https://docs.harborframework.com/jobs/configs Complete schema for configuring Harbor jobs. ```bash theme={"system"} harbor run -c "" ``` Job config files provide the same controls as `harbor run` flags while supporting multiple agents, datasets, and tasks in one reusable JSON or YAML file. Example: ```yaml config.yaml theme={"system"} job_name: my-first-job tasks: - path: "" agents: - name: codex model_name: openai/gpt-6-astra environment: type: docker ``` ## Creating a config You can use ```bash theme={"system"} harbor job init ``` to generate a config. It accepts the same flags as `harbor run`. To generate a config with all available fields: ```bash theme={"system"} harbor job init "" --full ``` Use `--print-config` to inspect the resolved config without running the job: ```bash theme={"system"} harbor run --config "" --print-config ``` Use `harbor job schema` to print the config JSON Schema: ```bash theme={"system"} harbor job schema ``` Use `--dry-run` to check the config, agent kwargs, credentials, and task sources without downloading tasks or running the job: ```bash theme={"system"} harbor run --dry-run --config "" ``` Add `--launch` to use Harbor Hub schemas and validation. > [!NOTE] > > All top-level fields are optional. Harbor applies the defaults shown below. Fields marked as required are required only when their containing object is present. ## Job **job\_name** `string` (default: current timestamp) Job name. When omitted, Harbor uses the current time in `YYYY-MM-DD__HH-MM-SS` format. **jobs\_dir** `string` (default: "jobs") Directory where Harbor stores job results. **n\_attempts** `integer` (default: 1) Number of attempts for every task and agent combination. **install\_only** `boolean` (default: false) Run agent setup only, skipping the agent phase and disabling verification. **timeout\_multiplier** `number` (default: 1.0) Multiplier applied to task timeouts unless a phase-specific multiplier overrides it. **agent\_timeout\_multiplier** `number | null` (default: null) Multiplier applied to the agent execution timeout. **verifier\_timeout\_multiplier** `number | null` (default: null) Multiplier applied to the verifier timeout. **agent\_setup\_timeout\_multiplier** `number | null` (default: null) Multiplier applied to the agent setup timeout. **environment\_build\_timeout\_multiplier** `number | null` (default: null) Multiplier applied to the environment build timeout. **debug** `boolean` (default: false) Enable debug logging. **n\_concurrent\_trials** `integer` (default: 4) Maximum number of concurrent trials. Must be at least 1. Per-agent concurrency limits cannot exceed this value. **quiet** `boolean` (default: false) Suppress individual trial progress displays. **retry** `RetryConfig` (default: \{}) Retry and exponential-backoff configuration. **override\_error\_policy** `dict[string, ErrorPolicyOverride]` (default: \{}) Override `should_retry`, `should_grade`, or `has_valid_reward` by exception type. Omitted fields keep their defaults. See [Error classification](/jobs/error-classification#overriding-the-policy). **environment** `EnvironmentConfig` (default: \{}) Shared environment-provider configuration applied to every trial. **verifier** `VerifierConfig` (default: \{}) Shared verifier configuration applied to every trial. **metrics** `list[MetricConfig]` (default: \[]) Job-level metrics appended to each dataset's metrics. **agents** `list[AgentConfig]` (default: \[\{"name":"oracle"}]) Agents evaluated by the job. **user\_agent** `UserAgentConfig | null` (default: null) Optional simulated-user agent and bridge applied to every trial. **datasets** `list[DatasetConfig]` (default: \[]) Dataset sources expanded into tasks. **tasks** `list[TaskConfig]` (default: \[]) Individual task sources. **artifacts** `list[string | ArtifactConfig]` (default: \[]) Environment paths collected after each trial. A string is shorthand for an artifact with only `source` set. **extra\_instruction\_paths** `list[string]` (default: \[]) Files appended to each task instruction, before `extra_instructions`. **extra\_instructions** `list[string]` (default: \[]) Inline text appended to each task instruction after `extra_instruction_paths`. **source\_jobs** `list[SourceJobConfig]` (default: \[]) Source jobs used for regrading. When set, Harbor derives one new trial from each matching source trial instead of expanding tasks, agents, and attempts normally. ## Retry **retry.max\_retries** `integer` (default: 0) Maximum retry attempts. Must be at least 0. **retry.include\_exceptions** `set[string] | null` (default: null) Exception class names eligible for retries. `null` includes every exception not excluded below. **retry.exclude\_exceptions** `set[string] | null` (default: built-in non-retryable exceptions) Exception class names that are never retried. Exclusions take precedence over inclusions. The defaults are the non-retryable types in [Error classification](/jobs/error-classification). **retry.wait\_multiplier** `number` (default: 1.0) Multiplier for exponential-backoff wait times. **retry.min\_wait\_sec** `number` (default: 1.0) Minimum delay between retries in seconds. **retry.max\_wait\_sec** `number` (default: 60.0) Maximum delay between retries in seconds. ## Agents **agents\[].name** `string | null` (default: "oracle") Pre-integrated agent name. Use `import_path` for a custom agent. **agents\[].import\_path** `string | null` (default: null) Custom agent import path in `module.path:ClassName` format. **agents\[].model\_name** `string | null` (default: null) Model identifier passed to the agent. **agents\[].n\_concurrent** `integer | null` (default: null) Per-agent limit on concurrent `agent.run()` phases. Must be at least 1 and cannot exceed `n_concurrent_trials`. **agents\[].concurrency\_group** `string | null` (default: null) Shared concurrency-pool name. Agents in the same group must set the same `n_concurrent` value. **agents\[].skills** `list[string]` (default: \[]) Local skill directories, Git URLs, or `org/name[@ref]` skill sources. **agents\[].override\_timeout\_sec** `number | null` (default: null) Replace the task's agent timeout with this value in seconds. **agents\[].override\_setup\_timeout\_sec** `number | null` (default: null) Replace the agent setup timeout with this value in seconds. **agents\[].max\_timeout\_sec** `number | null` (default: null) Upper bound for the effective agent timeout in seconds. **agents\[].resume\_trajectory** `boolean` (default: false) Resume the agent's native session between steps of a multi-step task. Requires agent resume support. **agents\[].load\_trajectory** `string | null` (default: null) Load a native `.jsonl` or ATIF `.json` trajectory before the first step. Requires the corresponding agent capability. **agents\[].extra\_allowed\_hosts** `list[string]` (default: \[]) Hostnames, IP addresses, or CIDR ranges added to the allowlist during `agent.run()` only. **agents\[].include\_logs** `list[string]` (default: \[]) Glob patterns selecting agent log files to download. **agents\[].exclude\_logs** `list[string]` (default: \[]) Glob patterns excluded from downloaded agent logs after applying `include_logs`. **agents\[].kwargs** `object` (default: \{}) Integration-specific keyword arguments passed to the agent constructor. **agents\[].env** `object[string, string]` (default: \{}) Environment variables exposed only during the agent phase. **agents\[].mcp\_servers** `list[MCPServerConfig]` (default: \[]) MCP servers made available to the agent. See [Pre-integrated agents](/agents/pre-integrated-agents), [Custom agents](/agents/custom-agents), [Skills](/jobs/skills), and [Loading trajectories](/jobs/loading-trajectories). ### MCP servers **agents\[].mcp\_servers\[].name** `string` Required server name. **agents\[].mcp\_servers\[].transport** `"stdio" | "sse" | "streamable-http"` (default: "sse") MCP transport. The legacy value `http` is normalized to `streamable-http`. **agents\[].mcp\_servers\[].url** `string | null` (default: null) Server URL. Required for `sse` and `streamable-http` transports. **agents\[].mcp\_servers\[].headers** `object[string, string]` (default: \{}) HTTP request headers for `sse` and `streamable-http` servers. Supported by `claude-code` and `codex`. Values support embedded `${VAR}` and `${VAR:-default}` references resolved before the agent is set up. Credential headers must use `${VAR}` references. Other agents reject configurations with headers. See [MCPs](/tasks/environment#mcps). **agents\[].mcp\_servers\[].command** `string | null` (default: null) Executable command. Required for the `stdio` transport. **agents\[].mcp\_servers\[].args** `list[string]` (default: \[]) Arguments passed to a `stdio` server command. ## Simulated user `user_agent` supports every field in `agents[]`, plus the fields below. The `bridge` field is required when `user_agent` is configured. **user\_agent.user\_persona\_path** `string | null` (default: null) Path to a file defining the simulated user's persona. **user\_agent.user\_prompt\_template\_path** `string | null` (default: null) Path to the Jinja2 prompt template used by the simulated user. **user\_agent.bridge** `BridgeConfig` Required bridge connecting the simulated user to the primary agent. **user\_agent.bridge.kind** `"acp"` Required bridge implementation. Currently only `acp` is supported. **user\_agent.bridge.prompt\_path** `string | null` (default: null) Optional replacement for the bridge instructions. **user\_agent.bridge.kwargs** `object` (default: \{}) Bridge-specific keyword arguments. See [Simulate a user](/jobs/simulate-a-user). ## Environment **environment.type** `EnvironmentType | null` (default: "docker") Pre-integrated environment provider: `docker`, `podman`, `daytona`, `e2b`, `modal`, `runloop`, `langsmith`, `ec2`, `gke`, `ack`, `openshift`, `novita`, `apple-container`, `singularity`, `islo`, `tensorlake`, `cwsandbox`, `use-computer`, `cua-cloud`, `blaxel`, `opensandbox`, `beam`, `skypilot`, `hf-sandbox`, `hyperbrowser`, `vercel`, `sail`, `superserve`, or `sbx`. See [Pre-integrated sandboxes](/sandboxes/pre-integrated-sandboxes). **environment.import\_path** `string | null` (default: null) Custom environment import path in `module.path:ClassName` format. **environment.force\_build** `boolean` (default: false) Rebuild the environment even when a cached build exists. **environment.delete** `boolean` (default: true) Delete the environment after the trial finishes. **environment.cpu\_enforcement\_policy** `"auto" | "limit" | "request" | "guarantee" | "ignore"` (default: "auto") How the provider enforces the task's CPU value. **environment.memory\_enforcement\_policy** `"auto" | "limit" | "request" | "guarantee" | "ignore"` (default: "auto") How the provider enforces the task's memory value. **environment.override\_cpus** `number | null` (default: null) Replace the task's CPU value at runtime. Fractional values require [provider support](/tasks/resources#provider-support). **environment.override\_memory\_mb** `integer | null` (default: null) Replace the task's memory value in MB. **environment.override\_storage\_mb** `integer | null` (default: null) Replace the task's storage value in MB. **environment.override\_gpus** `integer | null` (default: null) Replace the task's GPU count. **environment.override\_tpu** `TpuSpec | null` (default: null) Replace the task's TPU specification. **environment.suppress\_override\_warnings** `boolean` (default: false) Deprecated. This field is accepted but has no effect and is excluded when serializing configs. **environment.mounts** `list[ServiceVolumeConfig] | null` (default: null) Docker Compose long-syntax volume mounts for the agent environment only. **environment.extra\_docker\_compose** `list[string]` (default: \[]) Additional Docker Compose overlay files for the agent environment only. **environment.env** `object[string, string]` (default: \{}) Baseline environment variables exposed inside the sandbox. **environment.kwargs** `object` (default: \{}) Provider-specific keyword arguments passed to the environment constructor. **environment.extra\_allowed\_hosts** `list[string]` (default: \[]) Hostnames, IP addresses, or CIDR ranges added to the environment network baseline. See [Resources](/tasks/resources), [Network policies](/tasks/network-policies), and [Custom sandboxes](/sandboxes/custom-sandboxes). ### TPU override **environment.override\_tpu.type** `string` Required TPU alias or canonical GKE accelerator label, such as `v6e` or `tpu-v6e-slice`. **environment.override\_tpu.topology** `string` Required topology in `NxM` or `NxMxK` format, such as `2x4`. ### Mounts **environment.mounts\[].type** `"bind" | "volume" | "image"` Required mount type. **environment.mounts\[].source** `string` Required host path, named volume, or image source. **environment.mounts\[].target** `string` Required target path inside the container. **environment.mounts\[].read\_only** `true` (default: omitted) Set to `true` for a read-only mount. **environment.mounts\[].bind.create\_host\_path** `false` (default: omitted) Set to `false` to prevent Docker Compose from creating a missing bind source path. **environment.mounts\[].bind.selinux** `"z" | "Z"` (default: omitted) Optional SELinux relabeling mode for a bind mount. **environment.mounts\[].volume.subpath** `string` (default: omitted) Optional subpath within a named volume. **environment.mounts\[].image.subpath** `string` (default: omitted) Optional subpath within an image mount. ## Verifier **verifier.override\_timeout\_sec** `number | null` (default: null) Replace the task's verifier timeout with this value in seconds. **verifier.max\_timeout\_sec** `number | null` (default: null) Upper bound for the effective verifier timeout in seconds. **verifier.include\_logs** `list[string]` (default: \[]) Glob patterns selecting verifier log files to download. The reward file is always downloaded. **verifier.exclude\_logs** `list[string]` (default: \[]) Glob patterns excluded from verifier logs after applying `include_logs`. **verifier.env** `object[string, string]` (default: \{}) Environment variables exposed only during the verifier phase. **verifier.import\_path** `string | null` (default: null) Custom verifier import path in `module.path:ClassName` format. **verifier.kwargs** `object` (default: \{}) Keyword arguments passed to the custom verifier. **verifier.disable** `boolean` (default: false) Skip verification. Automatically set to `true` when `install_only` is enabled. **verifier.extra\_allowed\_hosts** `list[string]` (default: \[]) Hostnames, IP addresses, or CIDR ranges added to the allowlist during `verify()`, and from startup in a separate verifier environment. See [Custom verifiers](/jobs/custom-verifiers) and [Environment variables](/jobs/environment-variables). ## Datasets **datasets\[].path** `string | null` (default: null) Local dataset directory. With `repo`, this selects a repo-relative implicit dataset directory. **datasets\[].name** `string | null` (default: null) Harbor Hub dataset in `org/name` format, or a bare dataset name for a custom or Git-repository registry. **datasets\[].version** `string | null` (default: null) Version selected from a JSON registry or a named Git-repository registry. **datasets\[].ref** `string | null` (default: null) Tag, revision, or digest selected for a Harbor Hub dataset. **datasets\[].registry\_url** `string | null` (default: null) URL of a custom `registry.json` file. **datasets\[].registry\_path** `string | null` (default: null) Path to a custom `registry.json`. With `repo`, this path is relative to the repository. **datasets\[].repo** `string | null` (default: null) Git repository shorthand or URL, optionally pinned with `@ref`. **datasets\[].overwrite** `boolean` (default: false) Overwrite cached remote tasks. **datasets\[].download\_dir** `string | null` (default: null) Directory used to cache downloaded tasks. **datasets\[].task\_names** `list[string] | null` (default: null) Glob patterns selecting tasks by name. **datasets\[].exclude\_task\_names** `list[string] | null` (default: null) Glob patterns excluding tasks after applying `task_names`. **datasets\[].n\_tasks** `integer | null` (default: null) Maximum number of tasks after inclusion and exclusion filters are applied. Each dataset must select exactly one source shape. Without `repo`, set either `path` or `name`, but not both. With `repo`, `path` selects an implicit dataset while `name` selects a named registry dataset. `version` and `ref` cannot both be set. See [Datasets](/datasets/datasets), [Registries](/datasets/registries), and [Git repos](/datasets/git-repos). ## Tasks **tasks\[].path** `string | null` (default: null) Local task directory, or the path within a Git repository when `git_url` is set. **tasks\[].git\_url** `string | null` (default: null) Git repository containing the task. **tasks\[].git\_commit\_id** `string | null` (default: null) Git commit containing the task. Requires `git_url`. **tasks\[].name** `string | null` (default: null) Harbor Hub task name in `org/name` format. **tasks\[].ref** `string | null` (default: null) Harbor Hub task tag, revision, or digest. Requires `name`. **tasks\[].overwrite** `boolean` (default: false) Overwrite the cached remote task. **tasks\[].download\_dir** `string | null` (default: null) Directory used to cache the downloaded task. **tasks\[].source** `string | null` (default: null) Optional source label used when grouping tasks and metrics. Every task must set either `path` or `name`, but not both. A Git task uses `path` with `git_url`; a Harbor Hub task uses `name` with an optional `ref`. See [Tasks → Overview](/tasks/overview). ## Metrics **metrics\[].type** `"sum" | "min" | "max" | "mean" | "uv-script"` (default: "mean") Metric implementation used to aggregate task rewards. **metrics\[].kwargs** `object` (default: \{}) Keyword arguments passed to the metric implementation. `uv-script` requires `script_path`. See [Metrics](/datasets/metrics). ## Artifacts **artifacts\[].source** `string` Required environment path to collect. It cannot contain `..` path components. **artifacts\[].destination** `string | null` (default: null) Optional path under the trial's artifact directory. Harbor derives it from `source` when omitted. **artifacts\[].exclude** `list[string]` (default: \[]) Patterns excluded when downloading a directory artifact. **artifacts\[].service** `string | null` (default: null) Docker Compose service to collect from. `null` and `main` target the agent container. See [Artifact collection](/jobs/artifact-collection). ## Regrade sources **source\_jobs\[].action** `"regrade"` Required derivation action. Currently only `regrade` is supported. **source\_jobs\[].type** `"local" | "hub"` Required source location. **source\_jobs\[].job\_id** `string | null` (default: null) Source job UUID. Required for a Hub source and optional for a local source. **source\_jobs\[].path** `string | null` (default: null) Source job directory. Required for a local source and invalid for a Hub source. Regrading cannot be combined with `install_only`. See [Regrade](/jobs/regrade). # Custom verifiers Source: https://docs.harborframework.com/jobs/custom-verifiers Customize the job verification process. After the agent runs, the default `Verifier` executes `/tests/test.sh` in the verifier sandbox. Harbor uploads `tests/` unless the [verifier image](/tasks/separate-verifier#image-selection) already bundles it. The `Verifier` object is the default implementation of the `BaseVerifier`. If a user wants to orchestrate verification differently, or run some of the verifier logic on the host machine, they can implement a custom `BaseVerifier`. | | `tests/` w/default `Verifier` | Custom `BaseVerifier` | | - | - | - | | Logic | Task files, typically `tests/test.sh` | An importable Python class | | Execution | Inside the verifier sandbox | `verify()` runs in the Harbor process and can call sandbox operations through `self.environment` | | Harbor handles | Uploading tests when needed, running the script, downloading verifier logs, and parsing reward files | Constructing the verifier and calling `verify()` | | Reward output | `/logs/verifier/reward.txt` or `/logs/verifier/reward.json` | A returned `VerifierResult` | | Configuration | Included with the task | `verifier.import_path` and optional `verifier.kwargs` in the job config | | Best for | Portable, task-specific verification | Custom orchestration or host-side checks | > [!NOTE] > > A custom verifier replaces the default workflow. It must perform any required uploads, commands, and reward calculation itself. For example, this verifier checks whether the agent created a required file in the sandbox: ```python title="custom_verifier.py" theme={"system"} from typing import Any from harbor.models.verifier.result import VerifierResult from harbor.verifier.base import BaseVerifier class OutputVerifier(BaseVerifier): def __init__( self, *, required_path: str = "/app/output.json", **kwargs: Any ) -> None: super().__init__(**kwargs) self.required_path = required_path async def verify(self) -> VerifierResult: exists = await self.environment.is_file(self.required_path) return VerifierResult(rewards={"reward": int(exists)}) ``` The file must be importable by the Harbor process. Select the class with `verifier.import_path`; values in `verifier.kwargs` are passed to its constructor. > [tab] CLI > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" \ > --verifier custom_verifier:OutputVerifier \ > --verifier-kwarg required_path=/app/output.json > ``` > [tab] Config > > ```yaml theme={"system"} > verifier: > import_path: custom_verifier:OutputVerifier > kwargs: > required_path: /app/output.json > ``` See [Configs](/jobs/configs) for the complete verifier configuration schema. # Environment variables Source: https://docs.harborframework.com/jobs/environment-variables Control which environment variables reach Harbor, sandboxes, agents, and verifiers. Harbor separates variables by where they are needed: the Harbor process, the sandbox, the agent phase, or the verifier phase. > [!WARNING] > > Keep sandbox-provider credentials such as `DAYTONA_API_KEY` in the Harbor > process. Passing them through `environment.env`, `--agent-env`, or > `--verifier-env` unnecessarily exposes them inside the sandbox and is **not > recommended**. > [!NOTE] > > `export` and `--env-file` do not copy every variable into the sandbox. To pass > a host variable such as `DATABASE_URL`, set `environment.env.DATABASE_URL` to > `${DATABASE_URL}` explicitly. > [tab] Shared verifier > > The agent and verifier run in the same sandbox. > > ![Matrix showing which variables reach the Harbor process, agent phase, verifier phase, and lifecycle commands](https://mintcdn.com/harborframework/XHi-ZTogIM2NSVlh/images/environment-variable-reach.png?fit=max\&auto=format\&n=XHi-ZTogIM2NSVlh\&q=85\&s=d6366aabc26d2bf45404a82980ebd484) > > Environment variable scope for shared verifier > > Lifecycle commands include health checks, step setup, and collection hooks. > They run around the agent and verifier phases and receive sandbox variables only. > > | Scope and availability | Shell or CLI | `config.json` | `task.toml` | Example | > | - | - | - | - | - | > | **Harbor process** and environment provider | `export`, `--env-file` | — | — | `DAYTONA_API_KEY` | > | **Shared sandbox:** agent, verifier, and lifecycle commands | — | `environment.env` | `[environment.env]` | `DATABASE_URL` | > | **Agent phase only** | `--agent-env` (`--ae`) | `agents[].env` | — | `OPENAI_API_KEY` | > | **Verifier phase only** | `--verifier-env` (`--ve`) | `verifier.env` | `[verifier.env]` | `REWARDKIT_MODEL` | > > ![Harbor process managing a shared sandbox with agent, verifier, and lifecycle command scopes](https://mintcdn.com/harborframework/XHi-ZTogIM2NSVlh/images/shared-sandbox-variables.png?fit=max\&auto=format\&n=XHi-ZTogIM2NSVlh\&q=85\&s=803471b2ac60d1db928eb879452e0c65) > > Environment variable architecture for shared verifier > > The agent, verifier, and lifecycle commands share one sandbox. Phase > variables are added only while their phase runs and override sandbox > variables with the same name. > [tab] Separate verifier (default) > > A [separate verifier](/tasks/separate-verifier) runs in a > second sandbox. Agent-phase variables do not reach it; only > [collected artifacts](/jobs/artifact-collection) cross from > the agent sandbox. > > ![Matrix showing which variables reach the Harbor process, agent sandbox, verifier sandbox, phases, and lifecycle commands](https://mintcdn.com/harborframework/PxOk-gLJgMnxNtMy/images/separate-verifier-environment-variable-reach.png?fit=max\&auto=format\&n=PxOk-gLJgMnxNtMy\&q=85\&s=da3f9bc79c00d4d974fe1b00da04d5b8) > > Environment variable scope for separate verifier > > `verifier.environment.env` sets baseline variables for the verifier sandbox, > including its lifecycle commands. `verifier.env` adds variables only during > the verifier phase. > > | Scope and availability | Shell or CLI | `config.json` | `task.toml` | Example | > | - | - | - | - | - | > | **Harbor process** and environment provider | `export`, `--env-file` | — | — | `DAYTONA_API_KEY` | > | **Sandbox baseline** | — | `environment.env` (both sandboxes) | `[environment.env]` (agent sandbox) | `DATABASE_URL` | > | **Agent phase only** | `--agent-env` (`--ae`) | `agents[].env` | — | `OPENAI_API_KEY` | > | **Verifier phase only** | `--verifier-env` (`--ve`) | `verifier.env` | `[verifier.env]` | `REWARDKIT_MODEL` | > > ![Harbor process managing separate agent and verifier sandboxes with their phase and lifecycle command scopes](https://mintcdn.com/harborframework/PxOk-gLJgMnxNtMy/images/separate-verifier-sandbox-variables.png?fit=max\&auto=format\&n=PxOk-gLJgMnxNtMy\&q=85\&s=534a6821e7445bb80f092871ecd8f392) > > Environment variable architecture for separate verifier > > > [!NOTE] > > > > If separate mode is enabled without `[verifier.environment]`, Harbor > > copies the top-level `[environment]`. Its `[environment.env]` variables > > therefore become the verifier sandbox baseline as well. > > Verifier-phase variables override verifier-sandbox variables with the same > name. Agent-phase variables follow the same rule in the agent sandbox. ## Automatic agent credential forwarding Some [built-in agents](/agents/pre-integrated-agents) recognize selected host variables automatically. See [agent auth resolution](/agents/agent-auth-resolution#automatic-secret-collection) for more details # Error classification Source: https://docs.harborframework.com/jobs/error-classification The single reference for how Harbor treats every trial error: retry, grade, and whether the reward counts. [`error_policy.py`](https://github.com/harbor-framework/harbor/blob/main/src/harbor/models/trial/error_policy.py) is the **single source of truth** for trial errors. Each exception type maps directly to an `ErrorPolicy` with three independent fields: `should_retry`, `should_grade`, and `has_valid_reward`. ![Decision tree: when verification runs and whether its reward is valid](https://mintcdn.com/harborframework/M26tNatDkzs-cxdi/images/error-classification.png?fit=max\&auto=format\&n=M26tNatDkzs-cxdi\&q=85\&s=4d79707fce542663aa638547e1d5929f) Policy fields include any `override_error_policy`. **Retries are decided after the attempt finishes:** retry settings determine whether to start another attempt through the same flow. **Disabling retries does not disable grading.** `result.reward_valid` tells you whether the trial's reward can count in **benchmarks or RL training**. Once the verifier returns a reward: * **No errors:** `result.reward_valid=True`. * **Errors occurred:** `result.reward_valid=True` only if `policy.has_valid_reward=True`. > [!NOTE] > > **Both 0 and 1 can be valid reward signals.** `reward_valid` indicates whether a reward can be used for RL and job reward aggregation, not whether the task succeeded. Invalid rewards contribute to **neither the numerator nor the denominator** of the mean. For example, rewards `0` (valid), `1` (valid), and `1` (invalid) produce `(0 + 1) / 2 = 0.5`. If verification is skipped or returns no reward, `result.reward_valid=False`. Running the verifier alone does not guarantee reward validity. ## Exception types Defaults from `_POLICY_GROUPS`. Unlisted exception types use `should_retry=True`, `should_grade=True`, `has_valid_reward=True`. | Retry | Grade | Reward valid | Exception types | | - | - | - | - | | No | Yes | Yes | `NonZeroAgentExitCodeError`, `AgentTimeoutError`, `ContextWindowExceededError`, `OutputTokenExceededError`, `ContextLengthExceededError`, `OutputLengthExceededError`, `AgentSafetyRefusalError`, `ContentPolicyViolationError` | | Yes | No | No | `EnvironmentStartTimeoutError`, `SandboxBuildFailedError`, `AgentSetupTimeoutError`, `HealthcheckError`, `SandboxLikelyOutOfMemoryError`, `MemoryLimitExceededError`, `SSHAccessError`, `GKEExecStreamClosedError`, `GKEPodNotFoundError`, `RuntimeRequestError`, `AddTestsDirError`, `DownloadVerifierDirError` | | Yes | Yes | No | `ApiError`, `ApiRateLimitError`, `ApiInternalServerError`, `ApiOverloadedError`, `ApiConnectionClosedError`, `ApiResponseStalledError`, `UnknownApiError`, `NetworkConnectionError`, `ApiConnectionError`, `ApiUsageLimitError`, `RateLimitError`, `InternalServerError`, `ServiceUnavailableError`, `APIConnectionError`, `APIError`, `Timeout` | | No | Yes | No | `UnsupportedModelParametersError`, `BadRequestError`, `UnprocessableEntityError`, `UnsupportedParamsError`, `APIResponseValidationError`, `BudgetExceededError`, `VerifierTimeoutError`, `RewardFileNotFoundError`, `RewardFileEmptyError`, `VerifierOutputParseError` | | No | No | No | `AgentAuthenticationError`, `ModelNotFoundError`, `ApiProviderResourceNotFoundError`, `AuthenticationError`, `PermissionDeniedError`, `NotFoundError`, `ServiceOperationsUnsupportedError`, `VercelScopeError`, `DspyImportError`, `MissingExtraError`, `RegradeError`, `CancelledError` | ## Overriding the policy Set `override_error_policy` in `JobConfig` (applied to its trials) or `TrialConfig`. Keys are exact exception type names; omitted fields keep their defaults. For example, add this to a job config: ```yaml theme={"system"} retry: max_retries: 2 override_error_policy: NonZeroAgentExitCodeError: should_retry: true ApiRateLimitError: should_retry: false should_grade: true has_valid_reward: false ``` [Retry settings](/jobs/configs#retry) still apply: explicit retry filters take precedence over `policy.should_retry`, with exclusions winning over inclusions. Set `retry.max_retries: 0` (the default) to disable automatic retries, for example when the training loop owns them. ## Reading the classification ```python theme={"system"} result = TrialResult.model_validate_json(path.read_text()) error = result.exception_info # ApiRateLimitError with no overrides. print(error.exception_type) # "ApiRateLimitError" print(error.policy.should_retry) # True print(error.policy.should_grade) # True print(error.policy.has_valid_reward) # False print(result.reward_valid) # False ``` `ExceptionInfo.policy` and `TrialResult.reward_valid` are computed and included in serialized JSON. Each exception stores its applicable `policy_override`, so overrides survive saving and loading results. # Handoff Source: https://docs.harborframework.com/jobs/handoff Resume a completed trial in your local agent CLI. `harbor trial handoff` copies a completed trial's native session to your local agent CLI and resumes it in the current directory. Use it to continue the conversation or ask the agent about its work. ```bash theme={"system"} # Local trial directory harbor trial handoff "jobs//" # Harbor Hub trial ID harbor trial handoff 594025f3-7d65-4655-8576-4bee95002eae ``` Trial handoff to Claude Code For a Hub trial ID, Harbor downloads the trial first. For `claude-code`, handoff copies the session to the local Claude Code store and runs `claude --resume `. ## Requirements * The agent supports `capabilities.handoff`. Currently, only `claude-code` does. * The agent CLI is installed locally. For `claude-code`, `claude` must be on `PATH`. * The trial contains one session. Multi-session trials are not supported. ## What is restored Handoff restores the native session history, not files from the trial sandbox. See [Loading trajectories](/jobs/loading-trajectories) to seed a new Harbor run instead. # Loading trajectories Source: https://docs.harborframework.com/jobs/loading-trajectories Load a previous trajectory into an agent session. | Level | Configuration | Formats | Agents | | - | - | - | - | | Task | `trajectory.json` in the instruction directory | ATIF | `claude-code`, `codex` | | Run (job or trial) | `--load-trajectory` or `agents[].load_trajectory` | ATIF, native | `claude-code`, `codex` | ## Task-level loading ### ATIF trajectories Place an ATIF file named `trajectory.json` in the same directory as `instruction.md`. For a multi-step task, place it in the first step's directory. Harbor loads it when the agent supports ATIF loading. [Task-level ATIF example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/hello-load-atif-trajectory-task-level) ```bash theme={"system"} harbor run \ -p examples/tasks/hello-load-atif-trajectory-task-level \ -a codex -m openai/gpt-5.6-sol -e daytona ``` ## Run-level loading Run-level loading overrides task-level loading. `.json` selects ATIF. Other suffixes select the agent's native loader. The `claude-code` and `codex` native loaders expect `.jsonl` and validate filenames. `load_trajectory` cannot be combined with a simulated `user_agent`. ### Native trajectories Native trajectories are agent-specific `.jsonl` session files. Loading one is lossless and requires the same agent. Harbor stores them under `agent/sessions/`: [Run-level native example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/hello-load-native-trajectory) ```bash theme={"system"} harbor run \ -p examples/tasks/hello-load-native-trajectory \ -a claude-code -m opus -e daytona \ --load-trajectory examples/tasks/hello-load-native-trajectory/environment/d7d4e19e-608d-44ef-b166-cd050ef274ba.jsonl ``` | Agent | Native trajectory file | | - | - | | `claude-code` | `agent/sessions/projects/-app/.jsonl` | | `codex` | `agent/sessions///
/rollout-*.jsonl` | Keep the filename when moving the file; the agent uses it to identify the session. ### ATIF trajectories Harbor stores [ATIF](/agents/atif) output at `agent/trajectory.json`. ATIF is portable: Harbor converts it to the loading agent's native format, allowing one agent's trajectory to seed another. [Run-level ATIF example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/hello-load-atif-trajectory-run-level) ```bash theme={"system"} harbor run \ -p examples/tasks/hello-load-atif-trajectory-run-level \ -a codex -m openai/gpt-5.6-sol -e daytona \ --load-trajectory examples/tasks/hello-load-atif-trajectory-run-level/environment/trajectory.json ``` Conversion preserves supported messages, tool calls, and tool results. It may omit agent-specific details, system messages, and non-text content. Agents declare support for each format with `capabilities.load_native_trajectory` and `capabilities.load_atif_trajectory`. Unsupported formats, missing files, invalid ATIF, and invalid native filenames fail before startup. Invalid native contents may fail during resume. The examples above use the CLI. To use a job config instead: ```json theme={"system"} { "agents": [ { "name": "codex", "load_trajectory": "path/to/trajectory.json" } ] } ``` ## What is restored Native loading restores the native session. ATIF loading restores portable conversation content. Neither restores sandbox files. For [multi-step tasks](/tasks/multi-step), loading occurs before the first step. With `--resume-trajectory`, sessions are `(load, resume, resume, ...)`; otherwise, `(load, fresh, fresh, ...)`. # Regrade Source: https://docs.harborframework.com/jobs/regrade Run an updated verifier against recorded outputs without rerunning the agent. > [!NOTE] > > Regrade is recommended when only the verifier changes and the task uses a > separate verifier. The agent phase is not rerun. ## Regrade a job ```bash theme={"system"} harbor job regrade "jobs/" -p path/to/updated-task -e modal ``` `-p` accepts a task directory or a directory of tasks. Harbor matches tasks to source trials by task name. Repeat `-p` to provide multiple locations. ## Regrade a trial ```bash theme={"system"} harbor trial regrade "jobs//" -p path/to/updated-task -e modal ``` The updated task must have the same name as the source trial's task. ## Regrade from Harbor Hub Use a Hub job or trial UUID instead of a local path. ```bash theme={"system"} harbor job regrade deeac1d1-9588-422f-8d8a-d504ec9fae14 -p path/to/updated-task harbor trial regrade 8f3c2a9e-1b4d-4c6f-9e2a-7d5b8c1f0a3e -p path/to/updated-task ``` ## Requirements * The source is a completed trial with readable `result.json` and `artifacts/manifest.json` files. * The updated task uses a [separate verifier](/tasks/separate-verifier). * Every artifact required by the updated verifier was collected by the source trial and still exists. Using a separate verifier for the source task is a good practice because it already grades from recorded artifacts. It is not required: a shared-verifier source works if it recorded every input needed by the updated verifier. Multi-step trials are regraded step by step and must keep the same steps as the updated task. Legacy artifact manifests do not record exclusion filters. When the updated task declares exclusions, Harbor warns and continues regrading these records. Changes to explicitly recorded filters still prevent regrading. ## How it works For each source trial, Harbor: 1. Copies the recorded outputs into a new trial. 2. Builds the updated verifier environment. 3. Runs verification and writes a new result. No agent environment is started, so regrading needs no agent credentials and incurs no new agent cost. ## Options | Flag | Description | | - | - | | `-p, --task-path` | Local verifier task. Repeatable for jobs. | | `-t, --task` | Registry verifier task for jobs. Repeatable. | | `-d, --dataset` | Dataset of verifier tasks for jobs. Repeatable. | | `-e, --env` | Verifier environment provider. Defaults to `docker`. | | `--ve, --verifier-env` | Verifier environment variable. Repeatable. | | `--verifier` | Custom verifier import path. | | `--verifier-kwarg` | Custom verifier argument. Repeatable. | | `-o` | Output parent directory. | Job regrades also support `-n, --n-concurrent` and `--job-name`. Trial regrades support `--trial-name`. # Run a job Source: https://docs.harborframework.com/jobs/run-a-job Run a job in Harbor. A job is a collection of trials. A trial is an agent's attempt at completing a task. To run a job in Harbor, use the `harbor run` command. > [tab] Local dataset > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" > ``` > [tab] Local task > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" > ``` > [tab] Hub dataset > > ```bash theme={"system"} > harbor run -d "@" -a "" -m "" > ``` > [tab] Hub task > > ```bash theme={"system"} > harbor run -t "@" -a "" -m "" > ``` > [tab] Custom registry > > ```bash theme={"system"} > harbor run -d "@" \ > --registry-path "" \ > -a "" -m "" > ``` > > ```bash theme={"system"} > harbor run -d "@" \ > --registry-url "" \ > -a "" -m "" > ``` > > See [Registries](/datasets/registries). > [tab] Git repository > > ```bash theme={"system"} > harbor run --repo "" -p "" \ > -a "" -m "" > ``` > > See [Git repos](/datasets/git-repos). ## Configuring a job Harbor exposes CLI flags for configuring jobs. > [tab] Output > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" \ > -o "" --job-name "" > ``` > [tab] Concurrency and retries > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" \ > -n "" -k "" -r "" > ``` > [tab] Task filters > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" \ > -l "" -i "" -x "" > ``` > [tab] Sandbox > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" \ > -e "" --allow-agent-host "" --override-memory-mb "" > ``` > > See [Pre-integrated sandboxes](/sandboxes/pre-integrated-sandboxes), [Resources](/tasks/resources), and [Network policies](/tasks/network-policies). > [tab] Simulated user > > ```bash theme={"system"} > harbor run -p "" -a "" -m "" \ > --user-agent "" --user-model "" > ``` > > See [Simulate a user](/jobs/simulate-a-user). Run `harbor run --help` to see all available flags. ## Agents Harbor has pre-integrated agents and support for custom agents. Run `harbor run --help` to see the available agents. Set reasoning effort with `--effort`, other agent options with `--ak`, and the model with `--model` (`-m`). See [Model name parsing](/agents/agent-auth-resolution#model-name-parsing) to look up how LiteLLM parses a model name. ```bash theme={"system"} harbor run -a "" -m "" --effort high ``` See [Pre-integrated agents](/agents/pre-integrated-agents) or [Custom agents](/agents/custom-agents) to learn more. ## Config files Under the hood, configuring a job with CLI flags builds a `JobConfig` object and passes it to the runner. You can see the config when you run `harbor run` with the `--print-config` flag, or by inspecting the `/config.json` file after you run `harbor run`. You can also use `harbor job init` to create and save a config instead of running the job. For frequent setups, we recommend creating and version controlling your configs. > [!NOTE] > > You can pair a config with CLI flags to override values in the original config. An example config is shown below. ```json theme={"system"} { "n_attempts": 5, "n_concurrent_trials": 100, "retry": { "max_retries": 3 }, "agents": [ { "name": "", "model_name": "" } ], "datasets": [ { "path": "" } ] } ``` See [Configs](/jobs/configs) for the complete job config schema. ## Run on Harbor Hub You can run your jobs on Harbor Hub by including the `--launch` flag. Harbor Hub * Orchestrates your trials in the cloud * Enforces per-provider concurrency limits * Pauses on cascading failures (e.g. usage limits) * Backs off on rate limits * Can be accessed using the UI or CLI to debug, trigger retries, share results, or monitor progress First, sign in. ```bash theme={"system"} harbor auth login ``` Then, run your job with the `--launch` flag. ```bash theme={"system"} harbor run -d "" -a "" -m "" \ -n "" --one-off-secret "=" --launch ``` See [Hosted jobs](/harbor-hub/hosted-jobs) for more information about evaluating custom agents and Git-based tasks and datasets. # Simulate a user Source: https://docs.harborframework.com/jobs/simulate-a-user Evaluate an agent through a multi-turn conversation with a simulated user. A simulated-user trial pairs a user agent with the target agent under test. The user agent receives the task instruction. The target starts without it and learns the task through conversation. Harbor runs the verifier afterward. ![Diagram showing a user agent sending prompts through acpx to a target agent while both share a task workspace](https://mintcdn.com/harborframework/l9c_ohETpnOqpDv2/images/acp-simulated-user.png?fit=max\&auto=format\&n=l9c_ohETpnOqpDv2\&q=85\&s=8fb08316424c12dbc718b398db9b6189) Simulated user architecture diagram ## Examples ### Hello world ```bash theme={"system"} harbor run \ -t hello-world/hello-world \ --agent claude-code --model anthropic/claude-sonnet-5 \ --user-agent claude-code --user-model anthropic/claude-sonnet-5 \ --bridge acp ``` ### One example from [SWE-Interact](https://arxiv.org/pdf/2606.30573) ```bash theme={"system"} harbor run \ -p examples/tasks/deepswe_tomlkit-toml-table-converters \ --agent claude-code --model anthropic/claude-sonnet-5 \ --user-agent claude-code --user-model anthropic/claude-sonnet-5 \ --user-persona-path examples/tasks/deepswe_tomlkit-toml-table-converters/persona.md \ --bridge acp ``` > [!NOTE] > > Simulated-user trials can run for a long time. This example takes about 50 > minutes. simulated user in viewer ## Bridge `--bridge acp` installs [acpx](https://github.com/openclaw/acpx) in the task environment and connects the user agent to the target. The user sends each message with `acpx prompt`. The ACP bridge supports `claude-code`, `gemini-cli`, `codex`, and `opencode` as **target agents**. The remaining [ACP Registry Agents](https://agentclientprotocol.com/get-started/registry) are not wired into Harbor yet. The **user agent** can be **any** Harbor agent. ## User prompt Harbor builds the user agent's prompt in this [order](https://github.com/harbor-framework/harbor/blob/main/src/harbor/trial/simulated_user.py#L19-L24): | Part | Default | Override | | - | - | - | | Persona | [Default persona](https://github.com/harbor-framework/harbor/blob/main/src/harbor/trial/simulated_user.py#L14-L17) | `--user-persona-path` | | Bridge instructions | [Default ACP instructions](https://github.com/harbor-framework/harbor/blob/main/src/harbor/bridges/acp.py#L26-L38) | `--bridge-prompt-path` | | Task instruction | `instruction.md` | — | `--user-prompt-template-path` replaces this layout with a Jinja2 template. The template must include `{{ bridge_instructions }}` and `{{ instruction }}`; `{{ persona }}` is optional. # Skills Source: https://docs.harborframework.com/jobs/skills Inject reusable instructions from local directories or git repositories Skills let you inject context files, prompts, rules, and reference documentation into agent trials. A skill is a directory containing a `SKILL.md` file. ## How skills reach the agent For each trial, Harbor: 1. Resolves local and Git skill sources on the host into individual skill directories. 2. Uploads each directory to `/runtime/skills/` in the agent sandbox. If the task declares [`environment.skills_dir`](/tasks/skills), Harbor uses that directory instead. 3. Passes the sandbox skills directory to the agent integration as `skills_dir` before agent setup. 4. Lets the integration register the skills in its native location or pass the directory directly to the agent runtime. For example, the Codex integration copies them into `$HOME/.agents/skills`, while Claude Code uses `$CLAUDE_CONFIG_DIR/skills`. Custom agents receive the same `skills_dir` constructor argument and should register its contents during `setup()` or `run()`. Job-provided skills are uploaded after the environment healthcheck and before agent setup. When multiple supplied skills have the same directory name, the last one wins. See [Tasks → Skills](/tasks/skills) to bundle skills directly into a task environment. ## Local skills Pass a local directory path: ```bash theme={"system"} harbor run -d -a \ --skill ``` The path can identify one skill containing `SKILL.md`, or a root whose immediate child directories each contain `SKILL.md`. ## Git skills Instead of checking skills into every project, you can reference a git repository. Harbor clones the repo, resolves a commit SHA, and caches the result locally. ### Shorthand syntax ```bash theme={"system"} # Default branch, reading skills from repo/skills/ harbor run --skill -a -d # Tag or branch, reading skills from repo/skills/ harbor run --skill @ -a -d ``` Shorthand always resolves to `github.com` and uses the repository's `skills/` directory. ### Full URL syntax ```bash theme={"system"} # Default branch, reading skills from repo/skills/ harbor run --skill https://github.com// -a -d # Subdirectory within a repo (uses /tree/ref/path format) harbor run --skill https://github.com///tree// \ -a -d ``` Plain repository URLs use the repository's `skills/` directory. The `/tree//` format lets you point at a specific subdirectory of a monorepo. ### Multiple skills Use `--skill` multiple times to inject several skills. If two skills share the same directory name, the last one wins: ```bash theme={"system"} harbor run \ --skill \ --skill \ -a -d ``` ## Caching Git skills are cached locally at `~/.cache/harbor/skills/////`. Once a commit is cached, subsequent runs skip the clone. Different subdirectories from the same repository and commit are handled automatically. To clear the cache: ```bash theme={"system"} rm -rf ~/.cache/harbor/skills ``` ## Reproducibility When a job runs, Harbor records each skill's provenance in the job lock file: * **`name`** -- the skill directory name * **`source`** -- local path used during the run * **`digest`** -- SHA-256 content hash of all files in the skill * **`git_url`** -- the source repository (for git skills) * **`git_commit_id`** -- the resolved commit SHA (for git skills) This ensures that job results are fully traceable back to the exact skill content that was used, even if the branch has since moved. # Stream Source: https://docs.harborframework.com/jobs/stream Follow agent actions and explore sandbox files while a job runs. See what the agent is doing and inspect its work while a job runs: 1. **Stream agent logs.** Follow agent actions, commands, and results in the **Trajectory** tab as new steps arrive. 2. **Watch the agent's directory.** Open the **Stream** tab to browse sandbox files and generated artifacts in real time. It connects automatically after sandbox is ready. Add `--stream` to your run. Currently supports Claude Code and Codex on Daytona, Modal, Smol Machines, Tensorlake, or local Docker: ```bash theme={"system"} harbor run -t terminal-bench/build-cython-ext \ -a claude-code -m anthropic/claude-sonnet-5 -e docker --stream ``` In another terminal: ```bash theme={"system"} harbor view jobs ``` Run the browser and viewer on the same machine. For Daytona, make credentials available to both Harbor **and the viewer**. Add `--no-delete` to keep the sandbox available after the run. **This is also useful for debugging.** Don't forget to delete later. # News Source: https://docs.harborframework.com/news **November 9, 2026** ## Terminal-Bench 4.1 Terminal-Bench 4.1 updates task verifiers to resist reward hacking, reduce false negatives, and improve reproducibility. [Read more.](https://x.com/ryan_marten/status/2119845004940378276) **November 9, 2026** ## Error classification Harbor classifies trial errors with three fields: `should_retry`, `should_grade`, and `has_valid_reward`. [Read more.](https://x.com/kobe0938/status/2119830625448312906) **November 7, 2026** ## Happy birthday, Harbor! Thanks to everyone building, using, and contributing to Harbor. [Read more.](https://x.com/alexgshaw/status/2119280203562422625) **October 28, 2026** ## Cracking down on reward hacking Infrastructure hardening, best practices, and tools to mitigate reward hacking in Harbor tasks. [Read more.](/news/reward-hacking) **September 23, 2026** ## Terminal-Bench Meetup @ Laude Lab The team covered the state of terminal bench and harbor, the process behind Terminal-Bench-Science, and how to keep pace as models get better, faster: continuous benchmarks, real-world evals, and long-horizon multi-agent challenges [Read more.](https://x.com/LaudeInstitute/status/2102984476330737841) **September 16, 2026** ## New Harbor docs Harbor docs now cover previously undocumented features such as simulated users, streaming, and regrading, and expose an MCP for coding agents. [Read more.](https://x.com/alexgshaw/status/2100296774955237438) **September 14, 2026** ## Streaming Harbor streams the agent’s trajectory and sandbox files while a trial is in progress. [Read more.](https://x.com/kobe0938/status/2099537332462596436) **August 29, 2026** ## Terminal-Bench 4.0 Terminal-Bench 4.0 calibrates task resources, applies task fixes, and removes saturated tasks on Harbor Hub. [Read more.](https://x.com/ryan_marten/status/2093523335972036657) **August 27, 2026** ## Terminal-Bench-Science A Stanford-led Harbor benchmark for scientific research workflows: 70 tasks across life, physical, mathematical, earth, and engineering sciences, with Opus 5 at about 30%. [Read more.](https://x.com/StevenDillmann/status/2093041660615852448) **August 25, 2026** ## Simulated users A user agent can role-play a human and drive the target agent through a multi-turn conversation over ACP. [Read more.](https://x.com/kobe0938/status/2092298110391472430) **August 13, 2026** ## Regrade without rerunning the agent `harbor regrade` runs a new grader on recorded trials so you can iterate on verifiers without paying for another agent session. [Read more.](https://x.com/kobe0938/status/2087941751470170411) **August 11, 2026** ## Load a previous trajectory into a new eval `--load-trajectory` seeds a Harbor run with a prior Claude Code, Codex, or ATIF session so context moves into the next trial. [Read more.](https://x.com/kobe0938/status/2087273674818920768) **August 10, 2026** ## Interview an agent after the eval `harbor trial handoff` pulls a finished trial into local Claude Code so you can inspect the work and ask follow-up questions. [Read more.](https://x.com/kobe0938/status/2086905724295422008) **July 23, 2026** ## Terminal-Bench 3.0 (formerly Frontier-Bench) A living 74-task benchmark from the Harbor team where the best agents scored about 34%, runnable from the Harbor CLI and Hub. [Read more.](https://x.com/ryan_marten/status/2080322620248281252) ## Continuous Benchmarks Benchmarks are not static artifacts. They are software and we should maintain them like software. [Read more.](https://x.com/ryan_marten/status/2080321791361527843) **July 9, 2026** ## Hosted leaderboards on Harbor Hub Publish dataset leaderboards on Harbor Hub, including reward-hacking detection on Terminal-Bench 2.1. [Read more.](https://x.com/alexgshaw/status/2075273684424790516) **July 8, 2026** ## Harbor-Index Compose the hardest Harbor tasks into an 82-task meta-benchmark that no agent cleared above 30% at launch. [Read more.](https://x.com/LinShi592021/status/2074722423568736717) **July 3, 2026** ## Introducing harbor exec Run an agentic map-reduce over sandboxes to analyze traces, mine sessions, and search across completed jobs. [Read more.](https://x.com/alexgshaw/status/2073086868565196946) **June 18, 2026** ## Sidecar environments Collect artifacts from sidecars, run verification in a sidecar, and execute pre-verification commands in any service. [Read more.](https://x.com/harborframework/status/2067656083825373652) **June 17, 2026** ## Evaluate ACP agents natively Harbor can run ACP registry agents with `harbor run --agent acp:junie`, adding 36 agents now and every future ACP agent when it lands in the registry. [Read more.](https://x.com/harborframework/status/2067314067803701255) **May 27, 2026** ## Stop zipping your job results Upload and share Harbor job results on Harbor Hub instead of zipping and sending them manually. [Read more.](/news/job-result-sharing) **May 15, 2026** ## Verify Harbor tasks in a separate sandbox Run task verification in a sandbox separate from the agent, with explicit artifact handoff between the two environments. [Read more.](/news/separate-verifier-sandboxes) **April 23, 2026** ## Multi-step tasks The first major addition to the Harbor task format: tasks split into sequential steps, each with its own instruction and verifier. [Read more.](/news/multi-step-tasks) **March 27, 2026** ## Explore the Harbor cookbook Recipes for building Harbor tasks and optimization loops. [Read more.](/news/harbor-cookbook) ## The Harbor registry is getting an upgrade A new way to package and distribute Harbor tasks and datasets. [Read more.](/news/harbor-registry) # Explore the Harbor cookbook Source: https://docs.harborframework.com/news/harbor-cookbook Introducing the Harbor cookbook: recipes for building Harbor tasks and optimization loops [← All news](/news) March 27, 2026 · The Harbor Team If you've built a Harbor task before, you've probably spent time figuring out the same things everyone else does: multi-container setups, simulated users, adding MCP tools, implementing computer use environments, and more. We built Harbor to make agent evals simple. That’s why we’re releasing the [Harbor Cookbook](https://github.com/harbor-framework/harbor-cookbook). It contains a collection of realistic, ready-to-run examples of how to build evals and optimize agents with Harbor. **What’s inside** We recommend you give your coding agent context on the one closest to what you're building and adapt from there. | Recipe | What it does | | :- | :- | | [simple-task](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/simple-task) | Minimal single-container task | | [multi-container](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/multi-container) | Docker Compose task where the agent interacts with a locally hosted REST API | | [mcp-tools](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/mcp-tools) | Giving the agent custom tools via a locally hosted FastMCP server | | [skills](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/skills) | Recipes for including skills in a Harbor task | | [multi-reward](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/multi-reward) | Multiple independent verifiers each producing their own score | | [simulated-user](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/simulated-user) | Agent discovers requirements by talking to a simulated user | | [computer-use-ubuntu](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/computer-use-ubuntu) | Computer use reference implementation on an Ubuntu virtual desktop | | [computer-use-windows](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/computer-use-windows) | Computer use reference implementation on a remote Windows desktop (Daytona) | | [dns-blacklisting](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/recipes/dns-blacklisting) | Network-level hostname blacklisting with exact, wildcard, and regex rules | **Beyond evals: optimizing agents** Harbor tasks produce a reward, which means the same datasets you use for evals can also serve as training environments. The cookbook includes two recipes that demonstrate this: one example pairs Harbor with [GEPA](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/gepa) to optimize an agent harness on MedAgentBench. The other is the Harbor integration contributed by [Thinking Machines](https://github.com/harbor-framework/harbor-cookbook/tree/main/harbor_cookbook/tinker_rl), which uses Harbor tasks as RL environments through the Tinker SDK. We welcome feedback on which examples to build next and how to improve Harbor. We’re actively developing the Harbor framework to improve its ability to integrate into optimization loops. **Get started** Clone the cookbook and then run: ```bash tab="uv" theme={"system"} uv tool install harbor ``` ```bash tab="pip" theme={"system"} pip install harbor ``` ```bash theme={"system"} harbor run -p harbor_cookbook/recipes/simple-task -a "" -m "" ``` We welcome community contributions and will keep adding examples of interesting use cases for Harbor. Our goal is to make this the starting point for all things Harbor. [GitHub →](https://github.com/harbor-framework/harbor-cookbook) # The Harbor registry is getting an upgrade Source: https://docs.harborframework.com/news/harbor-registry Introducing a new way to package and distribute Harbor tasks and datasets. [← All news](/news) March 27, 2026 · The Harbor Team One of Harbor's core principles is that environments should be portable and easily flow between parties. We designed the Harbor task format, and released the open-source package to make it easy for users to create environments and run rollouts. We created the Harbor registry to simplify distributing Harbor tasks and datasets. Today we're announcing our next step on that journey: a self-service Harbor registry. The Harbor registry makes distributing Harbor tasks and datasets simple. Using the Harbor CLI, you can now publish your data and share it with anyone. Similar to all other Harbor features, the task is the atomic unit of the registry. Datasets are collection of tasks at specific versions. Registered data can be private or public. Publishing a task or dataset is a simple three-step process: For a full walkthrough, see [Publishing a dataset](/harbor-hub/publish). ## Create a task or dataset To create a task, run ```bash theme={"system"} harbor init --task hello/task ``` You can then edit the task files to implement your task. You can then initialize a dataset in the same directory by running ```bash theme={"system"} harbor init --dataset hello/dataset ``` which creates a `dataset.toml` manifest and automatically adds any tasks from the directory to the manifest. You can add other tasks from the registry or locally by running ```bash theme={"system"} harbor dataset add org/task --to "" # or harbor dataset add "" ``` ## Publish to the registry First, log in or create an account using ```bash theme={"system"} harbor auth login ``` Then publish the task using ```bash theme={"system"} harbor publish "" # optionally add --public to make it public ``` Harbor automatically publishes tasks and datasets at the path. ## Run the task or dataset Once your task is published, anyone in your org (or if it's public, any Harbor user) can run ```bash theme={"system"} harbor run -d hello/dataset ``` or ```bash theme={"system"} harbor run -t hello/world ``` to run the dataset or task. We encourage Harbor users to distribute benchmarks and datasets through the Harbor registry. We don't anticipate that task development itself happens in the registry, but rather on existing version control platforms and then published to the registry, similar to how Docker or PyPI work. Every published task or dataset is versioned by its digest, a revision number, and optional tags. This maximizes reproducibility and emphasizes registered data as snapshots or tasks and datasets to be distributed, rather than a development platform. We welcome feedback on the registry and will continue to develop tools to maximize the usability, portability, and creation of environments. # Stop zipping your job results Source: https://docs.harborframework.com/news/job-result-sharing Upload and share Harbor job results on Harbor Hub instead of zipping and sending them manually. [← All news](/news) May 27, 2026 · The Harbor Team Stop zipping your job results. Harbor Hub now supports job result sharing — the quickest way to share results from a run with team members or customers. Upload an existing job directory: ```bash theme={"system"} harbor upload jobs/my-job ``` Or stream results while a run is in progress: ```bash theme={"system"} harbor run -d "my-org/my-dataset@latest" -a "" -m "" --upload ``` Job results are private by default, but can be shared with other users or organizations, or made public: ```bash theme={"system"} harbor upload jobs/my-job --public harbor upload jobs/my-job --share my-org --share-user alice ``` As an example, we used Harbor Hub job uploads to build the [Terminal-Bench 2.1 leaderboard](https://www.tbench.ai/leaderboard/terminal-bench/2.1). Read the [job sharing documentation](/harbor-hub/sharing) for more info. # Multi-step tasks Source: https://docs.harborframework.com/news/multi-step-tasks The first major addition to the Harbor task format: tasks split into sequential steps, each with its own instruction and verifier. [← All news](/news) April 23, 2026 · The Harbor Team We're releasing the first major addition to the Harbor task format: multi-step tasks. A multi-step task runs an agent through a sequence of ordered steps against a single, shared environment. Each step has its own instruction and verifier. Multi-step tasks are helpful when implementing long-horizon tasks with early stopping conditions, testing continual learning methods like memory, and observing an agent's ability to build on its prior work. ```text theme={"system"} task.toml environment/ Dockerfile steps/ step-one/ instruction.md workdir/ setup.sh ... tests/ test.sh solution/ solve.sh step-two/ instruction.md ... tests/ test.sh ``` Install Harbor 0.5.0 or newer to use multi-step tasks: ```bash tab="uv" theme={"system"} uv tool install "harbor>=0.5.0" ``` ```bash tab="pip" theme={"system"} pip install "harbor>=0.5.0" ``` Learn more in the [multi-step tasks documentation](/tasks/multi-step), or have your coding agent guide you through the process of creating a multi-step task by downloading our `create-task` skill: ```bash theme={"system"} npx skills add harbor-framework/harbor --skill create-task ``` We're excited to see the multi-step tasks Harbor users build! # Cracking down on reward hacking Source: https://docs.harborframework.com/news/reward-hacking Infrastructure hardening, best practices, and tools to mitigate reward hacking in Harbor tasks. [← All news](/news) October 28, 2026 · The Harbor Team The world is transitioning from *hand-crafted* software to *learned* software. As the development lifecycle moves away from design & implementation and towards evaluation & optimization, the role of humans increasingly becomes reward shaping. Those rewards dictate the optimization loops that will eventually power all digital technology development. However, designing rewards is difficult. Accurately measuring outcomes requires actively protecting against unexpected, undesired, and adversarial behavior. Preventing reward hacking is necessary to ensure that the evaluation & optimization loop is "hill-climbing" the right hill. This new development paradigm requires new tools and best practices. We're shipping a batch of new features to mitigate reward hacking. Harbor is built to make *minimal* assumptions for *maximal* expressiveness, so some of these features are built into Harbor, some are opt-in tools, and some are example tasks. ## What counts as a reward hack Reward hacking occurs when an agent receives a reward that doesn't reflect the intended completion of the task, by exploiting the environment, verifier, or underlying infrastructure. Three types of reward hacks in Harbor are: | Kind | What the agent does | Example | | - | - | - | | Tampering | Interferes with and subverts the grading process | Plants code that patches the grader, or a symlink that points it at the reference solution | | Cheating | Gets the answer from somewhere it shouldn't | Looks up the benchmark's solution online | | Loopholes | Satisfies the tests without solving the problem | Hard-codes outputs for cases the tests happen to check | Mitigating these reward hacks requires robust infrastructure and tasks. There is no silver bullet, but the features below increase infra guarantees, enable better task creation, and improve reward-hacking-detection tooling. ## Three chances to mitigate reward hacking We've addressed reward hacking in three stages: when a task is written, while it runs, and after it finishes. Before the run [harbor initnew task defaults](#separate-verifiers-by-default) [harbor lintstatic checks](#catch-weak-spots-with-harbor-lint) [harbor checkrubric review](#review-the-whole-task-with-harbor-check) [.harborignoreunit test verifiers](#support-dev-files-during-task-development) [Multiple solutionsavoid overfitting](#ship-multiple-reference-solutions) [Non-root agentmanage permissions](#run-the-agent-as-a-non-root-user) During the run Agent sandbox [Network allowlistinference host auto-added](#simplifying-network-restrictions) [Web search offwhen network is restricted](#simplifying-network-restrictions) [Reduce eval awarenessneutral, unbranded names](#minimizing-eval-awareness) [No verifier mount/logs/verifier not exposed](#no-automatic-output-mounts) Verifier sandbox [Separate verifier sandboxuncontaminated environment](#separate-verifiers-by-default) [Reward files resetdeleted before tests run](#clear-stale-reward-files) [Low-trust code execRewardkit](#grade-untrusted-code-as-an-untrusted-user) [Sanitized artifactssymlinks, FIFOs dropped](#sanitize-artifacts-before-the-verifier-reads-them) After the run [harbor viewtrajectory viewer](#browse-trajectories-with-harbor-view) [harbor uploadshare on Hub](#share-trajectories-on-harbor-hub) [harbor analyzeauto-flag hacks](#flag-suspicious-trials-with-harbor-analyze) [harbor run --diffupdate results](#update-tasks--results-often) ## Before the run ### Separate verifiers by default Tasks created with `harbor init` now use a separate verifier. In shared mode, the verifier runs in the same container as the agent. In separate mode, Harbor copies task-specified artifacts into a fresh verifier sandbox, so the agent never touches the tests or the reward output. Existing tasks retain their current behavior. ```toml theme={"system"} # task.toml artifacts = ["/app/output"] # copied into the verifier sandbox [verifier] environment_mode = "separate" ``` > [!NOTE] > > Separate verifiers have a limitation: agent performance must be embedded into stored artifacts, so in-memory state like running processes has to be materialized to files before the verifier can test it (see the [separate verifier conversion guide](https://github.com/harbor-framework/terminal-bench/blob/main/docs/SEPARATE_VERIFIER_CONVERSION.md)). Shared environments are still available for verifiers that need live state. ### Catch weak spots with `harbor lint` Reward hacking opportunities often appear due to dependency drift or poorly configured tasks. `harbor lint` statically checks task configs and environment definitions for low-quality, unstable, or broken implementations. A few example rules: | Rule | What it catches | | - | - | | `agent-image-test-leak` | Agent Dockerfiles that copy in the solution or tests | | `shared-verifier` | Tasks that grade inside the agent's own container | | `compose-writable-bind-mount` | Host paths the agent can write through | | `compose-privileged` | Containers running with `privileged: true` | | `compose-additional-capabilities` | Services that add Linux capabilities with `cap_add` | | `verifier-network-download` | Separate verifiers whose tests download code at grading time | | `unpinned-image` | Images not pinned to a digest, which can change under you | ```bash theme={"system"} harbor lint "" ``` Most rules are on by default. Rules can be configured on a task or dataset level (Ruff-style): ```toml theme={"system"} # task.toml [metadata.harbor.lint] extend-select = ["root-agent", "unpinned-image"] ignore = ["compose-writable-bind-mount"] ``` ### Review the whole task with `harbor check` `harbor check` drops the agent into a sandbox containing the task source files and has the agent grade the task against a rubric. By default, an 11-point Terminal-Bench-inspired rubric is used, but task creators can override the rubric using `--rubric`. ```bash theme={"system"} harbor check "" --rubric "" ``` ### Support dev files during task development Tasks sometimes need development files, like data-generation scripts or unit tests for the verifier. Until now, anything in `tests/` or `solution/` was uploaded into the live sandbox during the corresponding phase, which disincentivized their usage. Verifier unit tests in particular are one of the best ways to catch a weak verifier before an agent does. We're introducing a new standard, `.harborignore`, so authors can version control dev files alongside the task while keeping them out of the sandbox and off Harbor Hub. Each ignore file keeps files out of a different place: | Keeps files out of… | `.gitignore` | `.dockerignore` | `.harborignore` | | - | - | - | - | | Version control | ✓ | | | | Publishing to Harbor Hub | ✓ | | ✓ | | The image build context | | ✓ | | | Uploads to a live environment | | | ✓ | ### Ship multiple reference solutions Oracle solutions are helpful when designing and debugging a verifier. However, a single solution can also lead to overfitting. We've provided an [example task](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/hello-world-multiple-solutions) to show how to ship several solutions, to ensure the verifier isn't overfit to one of them. ```bash theme={"system"} harbor run \ -p examples/tasks/hello-world-multiple-solutions \ -a oracle \ --ae SOLUTION=2 ``` ### Run the agent as a non-root user [`hello-world-non-root-user`](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/reward-hacking/hello-world-non-root-user) shows a task where the agent runs as an unprivileged user, so it can't touch root-owned grading files. Harbor does not initialize new tasks with an agent user because managing user permissions varies widely across tasks and should be opted into. ```toml theme={"system"} # task.toml [agent] user = "agent" ``` ## During the run ### Grade untrusted code as an untrusted user Many verifiers grade a submission by running the agent's code, and if that code runs inside the grader's process, it can tamper with the grader or write its own reward. The Harbor team maintains an optional package `harbor-rewardkit` that simplifies verifier creation. Rewardkit's new `Worker` runs submitted code as an unprivileged user that can't read the tests or write the reward. `Worker` also kills every process the code started before returning the output. See the [`secure-python-worker` example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/secure-python-worker) for a complete task. ### Clear stale reward files In some cases, an agent using a shared environment could simply write a `/logs/verifier/reward.json` or `reward.txt` that isn't overwritten by the verifier. Harbor now deletes `reward.txt` and `reward.json` at the start of verification. ### Sanitize artifacts before the verifier reads them With a separate verifier, artifacts are the only thing that crosses from the agent's sandbox to the verifier's. Harbor now: * Drops symlinks that point outside the artifact, so the agent can't link its output to the reference solution * Skips FIFOs, sockets and device files, which could hang the grader * Clears setuid and setgid bits, so the agent can't plant a privileged program ### No automatic output mounts Local environments like Docker used to bind-mount log and artifact directories to the host automatically, including `/logs/verifier` in the agent's container, so the agent could still write a reward file the verifier would read ([#3741](https://github.com/harbor-framework/harbor/issues/3741)). Those mounts are now opt-in, and logs and artifacts are collected without them. ```bash theme={"system"} harbor run -p "" --ek auto_mounting=true # opt back in ``` ### Simplifying network restrictions Agents sometimes cheat when given unrestricted internet access. Tasks and users can configure network restrictions, but allowlisting agent-specific endpoints (e.g. `api.openai.com`) historically required manual per-job configuration. Agents can now declare default inference endpoints per provider. When a task is restricted, Harbor automatically allows those hosts, or the `base_url` you configured. > [!NOTE] > > When the agent's network is restricted, Harbor also turns off built-in web search for agents that have it, such as Claude Code, Codex, Gemini CLI and OpenCode. ### Minimizing eval awareness An agent that can tell it's in an eval harness may behave differently. Harbor-branded paths, environment variables, generated agent instructions and identities, and tool directories now use neutral names. > [!NOTE] > > A smart model will probably be able to tell it's being evaluated either way, but it's good regardless to minimize the production-to-evaluation gap. ## After the run ### Browse trajectories with `harbor view` `harbor view` starts a local web viewer for your jobs directory. Open any trial to step through its trajectory alongside its reward, cost and timing, and compare results across a job. ```bash theme={"system"} harbor view "" ``` ### Share trajectories on Harbor Hub Hacks are easier to catch with more eyes on them (as we've seen with the recent increase in attention on Terminal-Bench 🙂). Users can upload job results to Harbor Hub to share with others. ```bash theme={"system"} harbor run --upload # upload at runtime harbor upload "" # private by default harbor upload "" --share "" # to share harbor upload "" --public # to make public ``` Jobs are private by default. Trust us, it's better than sharing zips on Slack. ### Flag suspicious trials with `harbor analyze` Reading every trajectory doesn't scale to thousands of trials. `harbor analyze` puts an agent into a sandbox with the task's source files, the trial's logs and its trajectory, and has it classify the trial along two dimensions: * **Reward hacking:** did the agent earn its reward by solving the problem, or by gaming the verifier? * **Task specification:** was the instruction clear enough that a failure is the agent's fault? Users can also specify their own rubrics. ```bash theme={"system"} harbor analyze "" \ --rubric "" \ --agent codex \ --model openai/gpt-6-luna ``` ### Publish leaderboards backed by trajectories Leaderboards should be *auditable* and *reproducible*. You can create leaderboards on Harbor Hub, where each row can link to the trials behind it, so anyone reading the leaderboard can view the corresponding trajectories (and the exact config that produced the trial). ```bash theme={"system"} harbor hub leaderboard --help ``` Leaderboards are displayed on the dataset's Harbor Hub page and are readable through the Hub API, so you can render them on your own site (e.g. click a row on [Terminal-Bench](https://tbench.ai)). Leaderboards can be public or private. ### Update tasks & results often No task is perfect. When `harbor analyze` or the community surfaces a hack, the task should be fixed, and that's just as important as designing it well the first time. Benchmarks should be [continuously developed and maintained](https://www.tbench.ai/news/continuous-benchmarks). But benchmarks exist for comparison, and changing a dataset means reconciling existing results with the new tasks, which can be costly. Harbor makes this cheap with semantic versioning: bump a task's patch version and existing trials are reused, bump the minor version to regrade them against the new verifier, and bump the major version to rerun them. ```bash theme={"system"} harbor run \ -d "@" \ -a "" \ --diff "" ``` ## Building robust environments We believe all digital technology development will move towards an ML lifecycle, where the human role increasingly becomes eval builder and reward shaper. This new development lifecycle demands new tools. Harbor is our attempt at building these tools. If you find a new hack vector, let us know on [Discord](https://discord.gg/QVvyhRw5UQ) or [open an issue](https://github.com/harbor-framework/harbor/issues) :) (or post on X, that works too 😉) # Verify Harbor tasks in a separate sandbox Source: https://docs.harborframework.com/news/separate-verifier-sandboxes Run task verification in a sandbox separate from the agent, with explicit artifact handoff between the two environments. [← All news](/news) May 15, 2026 · The Harbor Team Starting today, you can verify Harbor tasks in a separate sandbox from the one used by the agent. In `task.toml`, you can specify artifacts to copy between the agent sandbox and verifier sandbox. Verifying in a separate sandbox: * enables different resource configurations or dependencies than the agent sandbox * lets users pre-bake dependencies into a verifier image to avoid flaky package installation * provides an additional security boundary between the agent and the verification process It also introduces constraints: * verification is limited to copied artifacts, not full container state such as running processes * tasks must explicitly write anything the verifier needs to an artifact path Separate verification works for both single-step and multi-step tasks. Multi-step tasks can opt into a separate verifier sandbox per step. To start using this feature, update the `create-task` skill: ```bash theme={"system"} npx skills add harbor-framework/harbor --skill create-task ``` Or add the following sections to your `task.toml`: ```toml theme={"system"} artifacts = ["/tmp/answer.json"] [verifier] environment_mode = "separate" ``` You can also configure the verifier sandbox: ```toml theme={"system"} artifacts = ["/tmp/answer.json"] [verifier] environment_mode = "separate" [verifier.environment] network_mode = "no-network" # baseline; [verifier].network_mode is an optional phase override cpus = 2 memory_mb = 4096 ``` Per-step verifier config uses `[steps.verifier]` and `[steps.verifier.environment]` with the same rules. Opting in treats the `tests/` directory as an environment directory, similar to `environment/`. As usual, we're excited to see what you build and welcome feedback! # Custom plugins Source: https://docs.harborframework.com/plugins/custom-plugins Run custom logic around Harbor jobs and trials. Harbor uses the plugin interface internally for [Harbor Hub](https://hub.harborframework.com). Its [upload plugin](https://github.com/harbor-framework/harbor/blob/main/src/harbor/cli/plugins/harbor_hub.py) streams completed trials and finalizes jobs. Custom plugins use the same interface for local or private integrations. They run in the Harbor process, react to job and trial events, and are passed at runtime instead of stored in `config.json`. ## Lifecycle | Method | When it runs | | - | - | | `on_job_start(job)` | Before the job runs. Initialize clients or register trial callbacks here. | | `on_job_end(job_result)` | After the job finishes. Flush, upload, or close resources here. | Available trial callbacks include `on_trial_started`, `on_environment_started`, `on_agent_started`, `on_agent_ended`, `on_verification_started`, `on_trial_ended`, and `on_trial_cancelled`. ## Implement a plugin Extend [`BaseJobPlugin`](https://github.com/harbor-framework/harbor/blob/main/src/harbor/models/job/plugin.py) and implement its two lifecycle methods. Register trial callbacks from `on_job_start` when the plugin needs per-trial events. ```python trial_logger.py theme={"system"} from harbor.job import Job from harbor.models.job.plugin import BaseJobPlugin from harbor.models.job.result import JobResult from harbor.trial.hooks import TrialHookEvent class TrialLoggerPlugin(BaseJobPlugin): def __init__(self, prefix: str = "trial") -> None: self.prefix = prefix async def on_job_start(self, job: Job) -> None: job.on_trial_ended(self._on_trial_ended) async def _on_trial_ended(self, event: TrialHookEvent) -> None: print(f"{self.prefix}: {event.trial_name}") async def on_job_end(self, job_result: JobResult) -> None: print(f"job finished: {len(job_result.trial_results)} trials") ``` > [!NOTE] > > Plugins run outside the sandbox. Install the plugin and its dependencies in > the same Python environment as Harbor. See > [Environment variables](/jobs/environment-variables) for the > difference between Harbor-process and sandbox variables. ## Run a custom plugin Custom plugins do not need a registered name. Pass `module.path:ClassName` to `--plugin`. For `TrialLoggerPlugin` in `trial_logger.py`, use `trial_logger:TrialLoggerPlugin`. ```bash theme={"system"} export OPENAI_API_KEY="..." harbor run \ -t hello-world/hello-world \ -a codex -m openai/gpt-5.6-sol \ --plugin trial_logger:TrialLoggerPlugin \ --plugin-kwarg prefix=completed ``` `--plugin-kwarg` (`--pk`) passes constructor options to the plugin. Both `--plugin` and `--pk` are repeatable. See [Use multiple plugins](/plugins/existing-plugins#use-multiple-plugins) for the multi-plugin syntax. ## Examples See Harbor's [plugin packages](https://github.com/harbor-framework/harbor/tree/main/packages) for more implementations. For a third-party integration guide, see [Braintrust](https://www.braintrust.dev/docs/integrations/sdk-integrations/harbor). # Existing plugins Source: https://docs.harborframework.com/plugins/existing-plugins Connect Harbor jobs to observability platforms. Job plugins run in the Harbor process and react to job and trial events. Pass them at runtime with `--plugin`; plugins are not stored in `config.json`. > [!NOTE] > > Install a plugin in the same Python environment as Harbor. Plugin credentials > are [Harbor process variables](/jobs/environment-variables), not > agent environment variables. ## Discover plugins Installed packages register a short plugin name. List them with: ```bash theme={"system"} harbor plugins list ``` Harbor provides two official plugins: `langsmith` and `atif2otel`. `harbor plugins list` shows the plugins installed in the environment running Harbor. A source checkout may already include both as editable workspace packages; PyPI installations must add the desired plugin package. You can also pass a full `module:Class` import path to `--plugin`. ## LangSmith The [LangSmith](https://www.langchain.com/langsmith/observability) plugin syncs Harbor tasks to a LangSmith dataset and records each job as an experiment. ```bash theme={"system"} uv tool install "harbor[langsmith]" ``` ```bash theme={"system"} export OPENAI_API_KEY="..." export LANGSMITH_API_KEY="..." harbor run \ -t hello-world/hello-world \ -a codex -m openai/gpt-5.6-sol \ --plugin langsmith \ --pk dataset_name=harbor-evals \ --pk experiment_name=codex-baseline ``` ![LangSmith showing Harbor experiments with reward, latency, token, and error metrics](https://mintcdn.com/harborframework/8T-R9LwwMcmGz1Hx/images/langsmith-experiments.jpeg?fit=max\&auto=format\&n=8T-R9LwwMcmGz1Hx\&q=85\&s=ee89234657b7a62a1acd8c07a9a662ce) Harbor experiments in LangSmith > [accordion] LangSmith options > > | Option | Environment variable | > | - | - | > | `dataset_name` | `HARBOR_LANGSMITH_DATASET` | > | `experiment_name` | `HARBOR_LANGSMITH_EXPERIMENT` | > | `experiment_id` | `HARBOR_LANGSMITH_EXPERIMENT_ID` | > | `endpoint` | `LANGSMITH_ENDPOINT` | > | `workspace_id` | `LANGSMITH_WORKSPACE_ID` | > | `sync_dataset` | `HARBOR_LANGSMITH_SYNC_DATASET` | > | `fail_fast` | `HARBOR_LANGSMITH_FAIL_FAST` | > > `api_key` is also accepted, but `LANGSMITH_API_KEY` is recommended for > credentials. See the [LangSmith docs](https://docs.langchain.com/langsmith/harbor-integrations) and [launch post](https://x.com/LangChain/status/2071972238128005278). ## ATIF to OpenTelemetry The ATIF-to-OpenTelemetry plugin converts each agent's [ATIF **trajectory**](/agents/atif) into [OpenTelemetry](https://opentelemetry.io/) spans. It converts `agent/trajectory.json` into spans for model calls, tool calls, and subagents. ```bash theme={"system"} uv tool install --with harbor-atif2otel harbor ``` > [tab] Write files > > Export all trials after the job finishes: > > ```bash theme={"system"} > export OPENAI_API_KEY="..." > > harbor run \ > -t hello-world/hello-world \ > -a codex -m openai/gpt-5.6-sol \ > --plugin atif2otel \ > --pk output_dir=./otel-traces \ > --pk encoding=json > ``` > [tab] Stream to MLflow > > The built-in uploader exports each trial to an MLflow server when it > finishes: > > ```bash theme={"system"} > export OPENAI_API_KEY="..." > export MLFLOW_TRACKING_TOKEN="..." > > harbor run \ > -t hello-world/hello-world \ > -a codex -m openai/gpt-5.6-sol \ > --plugin atif2otel \ > --pk endpoint=https://mlflow.example.com \ > --pk experiment_name=harbor-evals > ``` > [accordion] ATIF-to-OpenTelemetry options > > | Option | Environment variable | Default | > | - | - | - | > | `endpoint` | `OTEL_EXPORTER_OTLP_ENDPOINT` | — | > | `output_dir` | `HARBOR_OTEL_OUTPUT_DIR` | — | > | `experiment_name` | `MLFLOW_EXPERIMENT_NAME` | Job name | > | `token` | `MLFLOW_TRACKING_TOKEN` | `""` | > | `workspace` | — | `default` | > | `encoding` | — | `json` | > | `mode` | — | `auto` | > > `mode=auto` streams when `endpoint` is set and writes files when `output_dir` > is set. Set both to enable both outputs. See the [plugin source](https://github.com/harbor-framework/harbor/tree/main/packages/harbor-atif2otel). ## Use multiple plugins `--plugin` and `--plugin-kwarg` are repeatable. Prefix each kwarg with its plugin name when using more than one plugin: ```bash theme={"system"} harbor run ... \ --plugin langsmith \ --plugin atif2otel \ --pk langsmith.experiment_name=codex-baseline \ --pk atif2otel.output_dir=./otel-traces ``` When running from a job config, keep plugin flags on the command line: ```bash theme={"system"} harbor run --config config.json --plugin langsmith ``` To build another integration, see [Custom plugins](/plugins/custom-plugins). # Handoff Source: https://docs.harborframework.com/results/handoff Interview an agent after a completed trial. Use handoff to resume a completed trial in the local agent CLI and **interview** the agent directly. Ask it to explain its approach, decisions, or failures. We found it **more convenient** than looking at trajectory, particularly if it is long. See [Jobs → Handoff](/jobs/handoff) for commands and requirements. # View job results Source: https://docs.harborframework.com/results/view-job-results Browse jobs, inspect trials, and compare results locally. Harbor includes a local web viewer for job/trial results. ## Start the viewer Point it at your jobs directory: ```bash theme={"system"} harbor view jobs ``` Harbor opens the first available port from `8080` to `8089` and prints the viewer URL. The default is `http://127.0.0.1:8080`. Use another result directory or port when needed: ```bash theme={"system"} harbor view /path/to/jobs --port 9000 ``` > [!NOTE] > > Keep the command running while the viewer is open. Landing page is a job list. ![Harbor Viewer job list with search, filters, and result columns](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-jobs.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=4074e55192ae1244150c8f534563a84d) Browse jobs You may click into a job to see its trial details. ![Trial view showing reward, cost, tokens, timing, and trajectory](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-trial-overview.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=01fd557bf7e1b00a6f3f4c0e872db59d) Inspect a trial's trajectory, reward, cost, and timing ## Keyboard shortcuts | View | Keys | | - | - | | Job and task lists | `j` / `k` to navigate, `Enter` to open, `Esc` to go back | | Trial | `←` / `→` to switch trials | | Trial | `Shift` + `←` / `→` to switch jobs | | Trial | `Alt` (`Option` on macOS) + `←` / `→` to switch tabs | ### Trial files Files generated by the agent, verifier, and artifact collection are available in the trial viewer. The viewer shows the file tree and a preview of text files. You may download any file. > [tab] Agent > > ![Agent files and trajectory JSON in the trial viewer](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-agent-files.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=5d5b2ad2a1d84037ae84cac9759f1d56) > > Agent output > [tab] Verifier > > ![Verifier files and test output in the trial viewer](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-verifier-files.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=5084051d9f6d5ebf760283ea531d443c) > > Verifier output > [tab] Artifacts > > ![Artifact files and collection manifest in the trial viewer](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-artifacts.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=fdd9c3412ccdbfe5909fa7b68c8a357b) > > Collected artifacts > [tab] Config > > ![Resolved trial configuration in the trial viewer](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-trial-config.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=110605cd1639b23287925fa7d149db33) > > Trial configuration > [tab] Lock > > ![Replayable trial lock in the trial viewer](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-trial-lock.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=b69b3c99aacdf249448c79289744b0eb) > > Trial lock ## Run from the viewer Click **New run** on top left to configure and launch a job without writing a CLI command. Or access [http://127.0.0.1:8080/run](http://127.0.0.1:8080/run) directly. Use `←`, `→` to load the previous or next job configuration. ![Harbor Viewer form for configuring and launching a new run](https://mintcdn.com/harborframework/dDpeGWFOBtpL8lye/images/viewer-new-run.png?fit=max\&auto=format\&n=dDpeGWFOBtpL8lye\&q=85\&s=9c446eda1c0bcb51e3d00b9adad53c51) Configure a new run # Built-in criteria Source: https://docs.harborframework.com/rewardkit/built-in-criteria Reference for all built-in criterion functions. Rewardkit ships with built-in criteria for common rubrics. Use them from any Python file in your tests directory: ```python theme={"system"} import rewardkit as rk rk.file_exists("output.txt") rk.command_succeeds("python main.py", weight=2.0) ``` All criteria accept optional `weight` (default `1.0`) and `isolated` (default `false`) parameters in addition to the ones listed below. ## File criteria | Criterion | Parameters | Description | | - | - | - | | `file_exists` | `path` | File exists in workspace | | `file_not_exists` | `path` | File does not exist | | `file_contains` | `path, text` | File contains a substring | | `file_contains_regex` | `path, pattern` | File content matches a regex pattern | | `file_matches` | `path, expected` | File content equals expected text (whitespace-stripped) | | `files_equal` | `path1, path2` | Two files have identical content | | `diff_ratio` | `path, expected` | Similarity ratio between file content and expected text (returns 0.0–1.0) | ## Command criteria | Criterion | Parameters | Description | | - | - | - | | `command_succeeds` | `cmd, cwd?, timeout?` | Command exits with code 0 | | `command_output_contains` | `cmd, text, cwd?, timeout?` | Command stdout contains text | | `command_output_matches` | `cmd, expected, cwd?, timeout?` | Command stdout equals expected (stripped) | | `command_output_matches_regex` | `cmd, pattern, cwd?, timeout?` | Command stdout matches a regex | The default timeout is 30 seconds. The `cwd` parameter is relative to the workspace. ## Data format criteria | Criterion | Parameters | Description | | - | - | - | | `json_key_equals` | `path, key, expected` | Top-level JSON key equals a value | | `json_path_equals` | `path, json_path, expected` | Dot-separated path into JSON equals a value | | `csv_cell_equals` | `path, row, col, expected` | CSV cell at row/col equals a value | | `xlsx_cell_equals` | `path, cell, expected, sheet?` | Excel cell equals a value | | `sqlite_query_equals` | `db_path, query, expected` | SQL query result equals a value | > [!NOTE] > > `xlsx_cell_equals` requires the `documents` extra: `uv tool install harbor-rewardkit[documents]` > [!NOTE] > > For `csv_cell_equals`, row numbering depends on the column type. When `col` is an **integer**, a raw CSV reader is used and row 0 is the header row. When `col` is a **string** (column name), row 0 is the first data row after the header. ## HTTP criteria | Criterion | Parameters | Description | | - | - | - | | `http_status_equals` | `url, status?, timeout?` | HTTP response has the expected status code (default 200) | | `http_response_contains` | `url, text, timeout?` | HTTP response body contains text | The default timeout is 10 seconds. ## Image criteria | Criterion | Parameters | Description | | - | - | - | | `image_similarity` | `path1, path2` | Pixel-level similarity ratio (returns 0.0–1.0) | | `image_size_equals` | `path, width, height` | Image has the expected dimensions | > [!NOTE] > > Image criteria require the `image` extra: `uv tool install harbor-rewardkit[image]` ## Trajectory criteria These criteria inspect the agent's ATIF trajectory file (default path: `/logs/agent/trajectory.json`). | Criterion | Parameters | Description | | - | - | - | | `trajectory_tool_used` | `tool_name, min_count?, path?` | Agent used a specific tool at least `min_count` times (default 1) | | `trajectory_tool_not_used` | `tool_name, path?` | Agent did not use a specific tool | | `trajectory_turn_count` | `max_turns, path?` | Penalizes exceeding a turn budget: returns 1.0 at `max_turns`, linearly decays to 0.0 at double | ## Optional extras | Extra | Criteria | Install | | - | - | - | | `documents` | `xlsx_cell_equals` | `uv tool install harbor-rewardkit[documents]` | | `image` | `image_similarity`, `image_size_equals` | `uv tool install harbor-rewardkit[image]` | | `all` | All of the above | `uv tool install harbor-rewardkit[all]` | # Judge criteria Source: https://docs.harborframework.com/rewardkit/judge-criteria Grade tasks with LLM or agent judges configured in TOML. Judge criteria let you use an LLM or agent judge to grade a task. They are configured with TOML files. This makes it easy to reuse and share rubrics between tasks. ## LLM judge ```toml title="tests/quality.toml" theme={"system"} [judge] judge = "anthropic/claude-opus-5-5" files = ["/app/main.py", "/app/utils.py"] [[criterion]] description = "Is the code correct?" type = "binary" [[criterion]] description = "How readable is the code?" type = "likert" points = 5 weight = 2.0 [[criterion]] description = "Rate the test coverage on a scale from 0 to 100" type = "numeric" min = 0 max = 100 ``` The `judge` field accepts any [LiteLLM model string](https://docs.litellm.ai/docs/providers). It can be overridden at invocation time without editing the rubric. See [Provider routing](#provider-routing). ## Agent judge Agent judges can explore the filesystem and run commands to grade the task. ```toml title="tests/review.toml" theme={"system"} [judge] judge = "claude-code" model = "anthropic/claude-opus-5-5" isolated = true [[criterion]] description = "Does the solution handle edge cases?" type = "binary" ``` ### MCP servers Each `[[judge.mcp_servers]]` entry matches a Harbor task's `[[environment.mcp_servers]]`. Per-server `allowed_tools` lists the tools the judge may call; omit it to allow all of the server's tools. ```toml title="tests/review.toml" theme={"system"} [judge] judge = "claude-code" [[judge.mcp_servers]] name = "playwright" transport = "stdio" command = "npx" args = ["@playwright/mcp@latest", "--headless", "--isolated"] allowed_tools = ["navigate", "click"] [[criterion]] description = "Does the rendered page match the spec?" type = "binary" ``` > [!NOTE] > > Codex does not support `sse` servers. ## Individual mode Set `mode = "individual"` to grade one criterion per call instead of batching them all into one. LLM judges make one request per criterion; agent judges run one turn per criterion, sequentially. For LLM judges, each criterion can also scope its own `files`: ```toml title="tests/quality.toml" theme={"system"} [judge] judge = "anthropic/claude-opus-5-5" mode = "individual" [[criterion]] description = "Is the analysis correct?" files = ["/app/analysis.pdf"] [[criterion]] description = "Is the spreadsheet well-structured?" files = ["/app/data.xlsx"] ``` Criteria without `files` fall back to `[judge].files`. If a judge call times out, Rewardkit records the affected criteria as `0.0` with an error and warning in `reward-details.json`. ## Sampling the judge Set `samples` to run the judge several times and score each criterion with its median sample. `reward-details.json` lists every sample's answer, how many of them produced a valid score, and an `agreement` between 0 and 1. A sample that timed out or kept answering invalidly is not counted. ```toml title="tests/quality.toml" theme={"system"} [judge] judge = "anthropic/claude-opus-5-5" samples = 5 ``` An agent judge with several samples must be [isolated](/rewardkit/quick-start#isolation). Pass `--yolo` to run without isolation. ## Guarding the judge `guard` protects the judge from prompt injection: an agent writing instructions for the judge into the files being graded. The judge is told not to follow instructions in the graded files and reports whether it found any under `guard` in `reward-details.json`. `flag` only reports it; `penalize` also scores a flagged submission 0. ```toml title="tests/quality.toml" theme={"system"} [judge] judge = "anthropic/claude-opus-5-5" guard = "penalize" ``` ## Provider routing Judges call LiteLLM, which reads credentials from environment variables. You can change providers at invocation time without editing the rubric: * `--je KEY=VALUE` sets an environment variable for the run and can be repeated. * `--judge MODEL_OR_AGENT` overrides `[judge].judge`. The equivalent environment variable is `REWARDKIT_JUDGE`. * `--model MODEL` overrides `[judge].model` for an agent judge. The equivalent environment variable is `REWARDKIT_MODEL`. * `--reasoning-effort LEVEL` (or `--effort`) overrides `[judge].reasoning_effort`. The equivalent environment variable is `REWARDKIT_REASONING_EFFORT`. The level must be valid for every LLM and agent judge in the run. Harbor users can pass the same environment variables with `--ve`. ```bash theme={"system"} rewardkit /tests \ --judge bedrock/anthropic.claude-3-5-sonnet-20240620-v1:0 \ --je AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \ --je AWS_REGION_NAME=us-east-1 rewardkit /tests \ --judge claude-code \ --model anthropic/claude-opus-5-5 \ --reasoning-effort high ``` The [LiteLLM provider docs](https://docs.litellm.ai/docs/providers) list the environment variables used by each provider. ### Subscription authentication For Anthropic LLM judges, Rewardkit uses a Claude subscription token when it is the only Anthropic credential present. Create one with `claude setup-token` and set `CLAUDE_CODE_OAUTH_TOKEN`. If `ANTHROPIC_API_KEY` is also set, the API key has priority. Set `REWARDKIT_FORCE_SUBSCRIPTION=1` to require the subscription token. For the `codex` agent judge, set `OPENAI_API_KEY` or pass the contents of a ChatGPT-authenticated Codex `auth.json` as `CODEX_AUTH_JSON`. The API key has priority unless `REWARDKIT_FORCE_SUBSCRIPTION=1` is set. ## Configuration reference Judge TOMLs are validated when the tests directory is scanned, before any judge runs. Unknown keys and unknown values raise an error. ### `[judge]` section **judge** `string` (default: "anthropic/claude-opus-5-5") LiteLLM model name (e.g. `"anthropic/claude-opus-5-5"`), agent judge name (`"claude-code"`, `"codex"`, `"fx"`), or `"jev"`. **model** `string | null` (default: null) For agent judges, the LLM the agent should use. For the JEV judge, the JEV model. **files** `list[string]` (default: \[]) Workspace file paths to include in the judge prompt. **mode** `"batched" | "individual"` (default: "batched") Whether to grade all criteria in one call (`batched`) or one call per criterion (`individual`). **timeout** `integer` (default: 300) Seconds to wait for the judge response. **reasoning\_effort** `"auto" | "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max"` (default: null) Effort level for the judge. LLM judges accept the levels LiteLLM supports (default `medium`); agent judges accept their CLI's levels; `jev` accepts none. A given model may not support all of them. **isolated** `boolean` (default: false) For agent judges, mount the workspace as read-only via overlayfs. **cwd** `string | null` (default: null) For agent judges, the working directory the agent runs in. With `isolated`, it must be inside the workspace. **mcp\_servers** `list[table]` (default: \[]) For agent judges, MCP servers to configure before running. Each entry matches a Harbor task's `[[environment.mcp_servers]]`, plus a per-server `allowed_tools` allowlist. Codex does not support `sse` servers. **reference** `string | null` (default: null) Path to a reference solution file for comparison. **atif-trajectory** `string | null` (default: null) Path to an ATIF trajectory JSON to include in the prompt. **weight** `number` (default: 1.0) Weight of this judge's score when combined with the other scores in the same directory. **prompt\_template** `string | null` (default: null) Custom prompt template (`.md` or `.txt`). Must contain a `{criteria}` placeholder. **samples** `integer` (default: 1) Number of times to run the judge. **guard** `"off" | "flag" | "penalize"` (default: "off") Protect the judge from instructions the agent wrote into the graded files. `penalize` also scores a flagged submission 0. **on-error** `"fail" | "drop"` (default: "fail") What happens when a judge sample produces no valid score because it timed out, its reply was still invalid after retries, or the agent failed. `fail` stops the run without writing a reward once a criterion has no valid sample, so the verifier reports a failure instead of a score. `drop` ignores the sample and scores a criterion with no valid sample 0. **response-format** `"json-schema" | "json-object" | "none"` (default: "json-schema") For LLM judges, how the response is constrained: a strict JSON schema, JSON mode for endpoints that support only that, or no constraint beyond the prompt. Responses are parsed and retried the same way in every setting. A score that doesn't fit the criterion, such as a rubric `1.5` or a binary `"maybe"`, is retried. ### `[[criterion]]` entries **description** `string` *required* What to grade. This text is sent to the judge. **type** `"binary" | "likert" | "numeric" | "rubric"` (default: "binary") Output format. **name** `string | null` (default: null) Identifier for this criterion. Auto-generated from `description` if omitted. **id** `string | null` (default: null) Stable rubric identifier carried through to `reward-details.json` for provenance (e.g. `"1.1"`, `"2.3"`). Independent of `name`; survives rewording the description. **points** `integer` (default: 5) Scale size for the `likert` type. **min** `number` (default: 0.0) Minimum value for the `numeric` type. **max** `number` (default: 1.0) Maximum value for the `numeric` type. **levels** `list[string]` (default: \[]) Level descriptions for the `rubric` type, ordered from lowest to highest. 2 to 10 entries. **weight** `number` (default: 1.0) Importance multiplier for score aggregation. Negative weights support penalty criteria and require `aggregation = "weighted-sum"`. **files** `list[string]` (default: \[]) Files scoped to this criterion. Requires `[judge].mode = "individual"`. Falls back to `[judge].files` when omitted. **negate** `boolean` (default: false) Invert the normalized score. Use for a criterion describing behavior the answer should not exhibit. See [Negated criteria](#negated-criteria). **optional** `boolean` (default: false) Exempt this criterion from gating under `aggregation = "required-pass"`. ### `[scoring]` section Controls how the judge's criteria are aggregated into a single score. This only affects criteria within this TOML file. It does not change how programmatic and judge scores are combined across the directory. ```toml theme={"system"} [scoring] aggregation = "all-pass" # weighted-mean | weighted-sum | all-pass | any-pass | threshold | required-pass threshold = 0.7 # only used with "threshold" aggregation ``` `all-pass`, `any-pass`, and `required-pass` count a criterion as passing only when its score is `1.0`, so a Likert answer needs the top point. See [How scores are combined](/rewardkit/quick-start#how-scores-are-combined) for all modes. `required-pass` returns `1.0` only when every non-`optional` criterion passes; `optional` criteria never gate. With no non-optional criteria it warns and scores `0.0`. `weighted-sum` computes `sum(value × weight)` without normalization. It is the only aggregation that accepts negative weights, and its result may fall outside `[0, 1]`. ## Score normalization * **Binary**: yes/true/1 → 1.0, anything else → 0.0 * **Likert**: normalized to \[0, 1] as `(raw - 1) / (points - 1)` * **Numeric**: normalized to \[0, 1] as `(raw - min) / (max - min)` * **Rubric**: levels are numbered from 0, normalized to \[0, 1] as `raw / (levels - 1)` A Likert, numeric, or rubric score outside its range is an invalid reply: the judge is rerun, and a sample that stays invalid is handled by `on-error`. ## Negated criteria Set `negate = true` for a criterion describing behavior the answer should **not** exhibit. The judge scores the criteria as usual, then the score is inverted (`value → 1 - value`): present → 0.0, absent → 1.0. The raw judge answer is kept in `reward-details.json` so the flip is auditable. ```toml theme={"system"} [[criterion]] description = "States there is no task execution history tracking in the database" type = "binary" negate = true # the answer should NOT make this (false) claim ``` ## Trajectory evaluation To grade the agent's process rather than just its output, point the judge at the trajectory file: ```toml theme={"system"} [judge] judge = "anthropic/claude-opus-5-5" atif-trajectory = "/logs/agent/trajectory.json" files = ["/app/main.py"] [[criterion]] description = "Did the agent take an efficient approach?" type = "likert" points = 5 ``` The trajectory content is truncated proportionally to fit within the model's context window while preserving all steps. ## Custom prompt templates You can provide your own prompt instead of the built-in one: ```toml theme={"system"} [judge] judge = "anthropic/claude-opus-5-5" prompt_template = "my_prompt.md" ``` The template must contain a `{criteria}` placeholder where criterion descriptions get injected. ## JEV judge [JEV](https://docs.typesafe.ai) is a new type of language model from TypeSafe. It returns a probability or a rubric score per criterion and no reasoning, so it is fast and cheap. It requires the `jev` extra (`uv tool install harbor-rewardkit[jev]`) and a `TYPESAFE_API_KEY`: ```toml title="tests/quality.toml" theme={"system"} [judge] judge = "jev" files = ["/app/answer.md"] [[criterion]] description = "Does the answer address the requested task?" type = "binary" [[criterion]] description = "How complete is the answer?" type = "rubric" levels = [ "Omits the requested information", "Provides some requested information but misses important details", "Provides all requested information", ] ``` Binary criteria score 1.0 at a probability of 0.5 or higher. Rubric `levels` must run from worst to best, because the position in the list sets the score. The raw probability or score is kept in `reward-details.json`. JEV grades text files only and supports `binary` and `rubric` criteria. `atif-trajectory` and `prompt_template` are not supported. The files and the longest criterion must fit in 32k tokens, and the task image needs CA certificates (`ca-certificates` on Debian and Ubuntu). To route through a LiteLLM proxy or Vercel AI Gateway, set `TYPESAFE_BASE_URL` to the gateway's TypeSafe endpoint and `TYPESAFE_API_KEY` to the gateway key. Vercel also needs `model = "typesafe-ai/jev"`. # Motivation & design Source: https://docs.harborframework.com/rewardkit/motivation-and-design Why Rewardkit exists and the principles behind its design. ## Motivation When creating new tasks for Harbor, writing the verifier is often the most tedious part. We looked at verifier implementations across popular benchmarks and found that they are often complicated scripts that are hard to read, extend, and reuse across tasks. This leads to copy-and-pasting of boilerplate code between tasks, which causes subtle errors in verifiers during evals. **Rewardkit** solves this. It packages common patterns into reusable components that can be shared and reused across tasks. Rewardkit gets rid of boilerplate code by enabling LLM- and agent-as-a-judge evaluation and partial credit. Because independent reward components are defined through the directory structure, verifiers are easy to understand at a glance even without reading the code. Evaluating multiple criteria in parallel and in isolation is natively supported in Rewardkit. ## Design principles * **Simplicity:** Verifiers are defined by directory structure, making them easy to read at a glance. Common criteria are one-liners. Custom logic is a decorated function. Judges are reusable TOML files. * **Reuse and sharing:** Reward criteria are plain files in a directory. Share them across tasks and version them in git. * **Zero boilerplate:** 20+ built-in criteria for files, commands, JSON, CSV, HTTP, images, and trajectories. LLM- and agent-as-a-judge are supported natively. * **Isolation:** Criteria can run in isolated filesystem snapshots so they cannot interfere with each other or corrupt the agent's workspace. * **Security:** The agent's code never has to run inside the grader. A criterion can run it as a separate unprivileged user and score only what it prints, so a submission cannot read the tests, patch the grader, or write the reward. # Quick start Source: https://docs.harborframework.com/rewardkit/quick-start Define and run verifiers that produce reward scores. Rewardkit lets you define verifiers against an agent's workspace and trajectory. It runs criteria in parallel and writes their scores to JSON. Criteria can be: * **Programmatic:** Python functions that inspect files, run commands, or evaluate outputs * **Judge-based:** LLM or agent judges configured with reusable TOML files > [!NOTE] > > Rewardkit is a self-contained Python package. It is most powerful when you use > it with Harbor but it works just fine on its own. ## Installation ```bash theme={"system"} uv tool install harbor-rewardkit ``` For criteria or judges that read images or common document files such as PDF, DOCX, PPTX, and XLSX, install the extras: ```bash theme={"system"} uv tool install harbor-rewardkit[all] ``` ## Using with Harbor Harbor copies a task's `tests/` directory to `/tests` and runs `test.sh`. Put your criteria files alongside it: ```bash theme={"system"} tests/ ├── files.py ├── quality.toml └── test.sh ``` Programmatic criteria are implemented in Python files, and judges are specified in `.toml` files. Rewardkit picks up both from the tests directory. ```bash title="tests/test.sh" theme={"system"} #!/bin/bash uvx --python '>=3.12,<3.14' --from 'harbor-rewardkit==0.2.*' rewardkit /tests ``` Rewardkit discovers the criteria in `/tests`, runs them against the workspace at `/app`, and writes the result to `/logs/verifier/reward.json`: ```json title="/logs/verifier/reward.json" theme={"system"} { "reward": 0.75 } ``` All defaults match Harbor's conventions. > [card] [Working example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/reward-kit-example) > > A complete task that uses Rewardkit, available as a starting point. > [!NOTE] > > Want your coding agent to help design verifiers with Rewardkit? Install the `rewardkit` skill: > > ```bash theme={"system"} > npx skills add harbor-framework/harbor --skill rewardkit > ``` ## Programmatic criteria ### Built-in criteria Rewardkit includes common criteria used across popular benchmarks. Call them from any Python file in the tests directory: ```python title="tests/files.py" theme={"system"} import rewardkit as rk rk.file_exists("output.txt") rk.file_contains("output.txt", "hello") rk.command_succeeds("python main.py") ``` There are 20+ built-in criteria for files, commands, JSON, CSV, HTTP, images, and agent trajectories. See [Built-in criteria](/rewardkit/built-in-criteria) for the full list. ### Custom criteria When you need logic specific to your task, define a function with the `@criterion` decorator. The first parameter is always `workspace: Path`, and the function returns a `bool`, a `float`, or a dict with a `score`: ```python title="tests/output.py" theme={"system"} from pathlib import Path from rewardkit import criterion @criterion def has_valid_output(workspace: Path) -> bool: output = (workspace / "output.txt").read_text() return len(output.splitlines()) >= 10 ``` A criterion with no arguments besides `workspace` is called automatically. Criteria with additional arguments must be called through `rewardkit`: ```python title="tests/output.py" theme={"system"} from pathlib import Path import rewardkit as rk from rewardkit import criterion @criterion(description="output has at least {n} lines") def has_n_lines(workspace: Path, n: int) -> bool: output = (workspace / "output.txt").read_text() return len(output.splitlines()) >= n rk.has_n_lines(10, weight=2.0) rk.has_n_lines(50, weight=1.0) ``` A criterion can also return a dict. `reasoning`, `confidence`, and `model` are optional and are written to `reward-details.json`: ```python title="tests/output.py" theme={"system"} @criterion def report_is_relevant(workspace: Path) -> dict: probability = classify((workspace / "report.md").read_text()) return { "score": probability >= 0.5, "reasoning": "classified as on-topic", "confidence": max(probability, 1 - probability), "model": "relevance-classifier-v1", } ``` ## Judge criteria Some things are easier to grade with an LLM, such as code quality, edge-case handling, or readability. Define these criteria in a TOML file: ```toml title="tests/quality.toml" theme={"system"} [judge] judge = "anthropic/claude-opus-5-5" files = ["/app/main.py"] [[criterion]] description = "Is the code correct?" type = "binary" [[criterion]] description = "How readable is the code?" type = "likert" points = 5 ``` Python criteria and judge TOMLs can live in the same directory. See [Judge criteria](/rewardkit/judge-criteria) for agent judges, individual evaluation, MCP servers, and the complete TOML reference. Judges need API keys. In a Harbor task, pass them through `[verifier.env]` in `task.toml`: ```toml title="task.toml" theme={"system"} [verifier] timeout_sec = 300.0 [verifier.env] ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}" ``` See [Provider routing](/rewardkit/judge-criteria#provider-routing) to swap judge providers without editing a rubric. ## How scores are combined Every criterion accepts an optional `weight`; the default is `1.0`: ```python theme={"system"} rk.file_exists("output.txt", weight=3.0) rk.file_exists("readme.md", weight=1.0) ``` Each Python file that registers criteria produces one score, and so does each judge TOML. The name is the filename without `.py` or `.toml`: `files.py` becomes `files`, and `quality.toml` becomes `quality`. Files that only contain imports or shared criterion definitions and register no criteria are ignored. When the verifier files live directly under `tests/`, their scores are combined with equal weight into `reward`. To change either level, add `reward.toml` beside the criteria files: ```toml title="tests/reward.toml" theme={"system"} # Require every criterion registered by files.py to pass. [scoring.files] aggregation = "all-pass" # Give files.py twice the weight of quality.toml. [[reward]] name = "reward" aggregation = "weighted-mean" weights = { files = 2.0, quality = 1.0 } ``` `[scoring.files]` controls how criteria from `files.py` are combined. The named `[[reward]]` table controls how `files`, `quality`, and any other scores in the directory are combined. Without this table, and only when the verifier files live directly under `tests/`, Rewardkit creates `reward` using a weighted average, where a judge's share comes from `weight` in its `[judge]` section. The available aggregation modes are `weighted-mean`, `weighted-sum`, `all-pass`, `any-pass`, `threshold`, and `required-pass`. `all-pass`, `any-pass`, and `required-pass` count a score as passing only when it is at least `1.0`; for programmatic criteria, `required-pass` is the same as `all-pass`. `threshold` passes when the weighted mean reaches `threshold` in the same table (default `0.5`). `weighted-sum` computes `sum(value × weight)` without normalization. It is the only mode that accepts negative weights, and its result may fall outside `[0, 1]`. Judge TOMLs use their own `[scoring]` section to combine criteria within that judge. ## Multi-reward tasks When you want separate scores for dimensions such as correctness, structure, and quality, organize criteria into subdirectories. Each subdirectory becomes one reward: ```bash theme={"system"} tests/ ├── test.sh ├── correctness/ │ ├── files.py │ └── behavior.py ├── structure/ │ └── files.py └── quality/ └── judge.toml ``` This produces separate scores: ```json title="/logs/verifier/reward.json" theme={"system"} { "correctness": 0.75, "structure": 1.0, "quality": 0.6 } ``` Within a dimension, Python files, judge TOMLs, and subdirectories are combined with equal weight. Add a `reward.toml` inside the dimension to change that behavior: ```toml title="tests/correctness/reward.toml" theme={"system"} [[reward]] aggregation = "weighted-mean" weights = { files = 2.0, behavior = 1.0 } ``` Python files and judge TOMLs are referenced by filename stem and subdirectories by directory name. Inputs left out of `weights` keep their own weight. Omit `name`, because the directory name defines the score's name. Python files and judge TOMLs placed directly under `tests/` next to the dimension directories become top-level rewards named after their filename stems. Files that only define shared criteria, described below, produce no score. ### Nested groups Subdirectories can be nested to group related criteria within a dimension: ```bash theme={"system"} tests/ └── correctness/ ├── reward.toml ├── files.py └── behavior/ ├── runtime.py └── edge_cases.py ``` `behavior/` combines its criteria into an internal `behavior` score. Its parent can reference that score by directory name: ```toml title="tests/correctness/reward.toml" theme={"system"} [[reward]] weights = { files = 1.0, behavior = 2.0 } ``` The weights inside `behavior/` never leak into its parent. Each directory exports one score. To add a main reward to the output across the existing dimensions, create a root-level `tests/reward.toml` with a named `[[reward]]` table: ```toml title="tests/reward.toml" theme={"system"} [[reward]] name = "reward" aggregation = "weighted-mean" weights = { correctness = 2.0, structure = 1.0, quality = 1.0 } ``` ```json title="/logs/verifier/reward.json" theme={"system"} { "correctness": 0.75, "structure": 1.0, "quality": 0.6, "reward": 0.775 } ``` The dimension scores remain in the output. Without a root aggregation, a multi-reward task has no implicit `reward`. Harbor reads the `reward` key as the task's main score. Additional named `[[reward]]` tables can add other aggregate scores; a name may not collide with a dimension. To reuse custom criteria across dimensions, define them at the tests root with `shared=True`: ```python title="tests/shared.py" theme={"system"} from pathlib import Path from rewardkit import criterion @criterion(shared=True) def word_count_correct(workspace: Path) -> float: # Criterion logic ... return score ``` ```python title="tests/correctness/behavior.py" theme={"system"} import rewardkit as rk rk.word_count_correct(weight=3.0) ``` ## Isolation Some criteria run commands that modify the workspace. To prevent one criterion from affecting another, run it in isolation. Rewardkit mounts the workspace as read-only with overlayfs and discards that criterion's changes after it finishes. For programmatic criteria, pass `isolated=True`: ```python theme={"system"} rk.command_succeeds("python main.py", isolated=True) ``` For agent judges, set `isolated = true` in the `[judge]` section: ```toml theme={"system"} [judge] judge = "claude-code" isolated = true ``` Agent judges share the workspace, so Rewardkit raises when a task makes more than one agent run (several agent judges, several samples, or individual mode with several criteria) unless each agent judge sets `isolated = true`. ### Isolation in a Harbor task Mounting needs more privileges than a default container has. Give them to a [separate verifier environment](/tasks/separate-verifier), never to the agent environment. The verifier image installs `fuse-overlayfs`: ```dockerfile title="tests/Dockerfile" theme={"system"} FROM ubuntu:24.04 RUN apt-get update \ && apt-get install -y fuse-overlayfs \ && rm -rf /var/lib/apt/lists/* COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ COPY . /tests/ ``` A compose file lets the verifier container mount filesystems: ```yaml title="tests/docker-compose.yaml" theme={"system"} services: main: cap_add: - SYS_ADMIN devices: - /dev/fuse security_opt: - apparmor:unconfined ``` `task.toml` turns on the separate verifier and lists the files to grade as artifacts: ```toml title="task.toml" theme={"system"} artifacts = ["/app/main.py"] [verifier] environment_mode = "separate" ``` This works on the Docker environment. Other sandbox providers differ in whether they allow mounts. ## Running submitted code If a criterion runs the agent's code inside the verifier process, the agent can cheat instead of solving the task. Its code can write the reward file, patch the grader, read the expected answers, or leave a process behind to do so later. `Worker` runs the submission as a separate unprivileged user and returns only what it printed. The expected answers and the comparison stay in your criterion: ```python title="tests/check.py" theme={"system"} import json from pathlib import Path from rewardkit import Worker, WorkerError, criterion @criterion def correct_sums(workspace: Path) -> bool: rows = [[1, 2], [], [-3, 1]] try: result = Worker().run( "python3 solution.py", files=[workspace / "solution.py"], stdin=json.dumps(rows).encode(), ) except WorkerError: # timed out, or solution.py could not be copied in return False try: observed = json.loads(result.stdout) except ValueError: return False return result.returncode == 0 and observed == [sum(row) for row in rows] ``` `run` takes a shell script, the submitted files to copy in next to it, and stdin. It returns the exit status, stdout, the tail of stderr, and any files you list in `outputs`. Adapt the script to the submission: call a function with `python3 -c`, build a project first, or copy in a driver of your own. Each call runs as a fresh UID with no account. It cannot read `/tests` or write `/logs/verifier`, and every process it started is killed before `run` returns. Treat the result as data. A nonzero exit is returned, not raised. A timeout raises `WorkerError`, which you score as a failure. If the boundary itself cannot be set up, `run` raises `WorkerSetupError`; let it propagate so that no reward is written. ### Worker in a Harbor task The worker needs root in a disposable Linux verifier container, so use a [separate verifier environment](/tasks/separate-verifier) and leave the verifier user unset. Install Rewardkit system-wide in the verifier image: the worker starts through Rewardkit's interpreter, and `uvx` would put it under `/root`. ```dockerfile title="tests/Dockerfile" theme={"system"} FROM python:3.12-slim RUN pip install --no-cache-dir 'harbor-rewardkit>=0.2.4' COPY . /tests/ ``` ```bash title="tests/test.sh" theme={"system"} #!/bin/sh exec python -m rewardkit /tests ``` ```toml title="task.toml" theme={"system"} artifacts = ["/app/solution.py"] [verifier] environment_mode = "separate" ``` The worker protects the reward, not the machine. Use the task's network mode and the container's resource limits to bound what a submission can do. Docker Desktop ignores permission bits on bind mounts, so run these tasks on a Linux Docker engine or a cloud sandbox. > [card] [Working example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/secure-python-worker) > > A complete task graded through the worker. ## Output Rewardkit writes two files side by side: * `reward.json`: the reward scores * `reward-details.json`: individual criterion scores, judge reasoning, errors, and warnings `harbor view` renders the details under **Verifier Logs → Rewards** as a collapsible tree. Agent judge details also include normalized token `usage`, paths to copied native JSONL `judge_logs`, and text logs with stdout and stderr for failed Codex attempts. ## Comparing verifiers Pass multiple test directories to compare verifier designs side by side: ```bash theme={"system"} rewardkit /tests/v1 /tests/v2 ``` Rewardkit runs each directory independently, prints a comparison table for matching reward names, and writes namespaced keys such as `v1/correctness` and `v2/correctness` to `reward.json`. ## CLI ```bash theme={"system"} rewardkit \ --workspace /app \ --output /logs/verifier/reward.json \ --max-concurrent-programmatic 8 \ --max-concurrent-llm 8 \ --max-concurrent-agent 2 ``` All flags are optional. Passing multiple test directories runs each one independently and prints a comparison. ## Python API ```python theme={"system"} import rewardkit as rk # Run and get scores scores = rk.run("/tests", workspace="/app") # Inspect discovered rewards without running them rewards = rk.discover("/tests", workspace="/app") ``` # ASP Source: https://docs.harborframework.com/sandboxes/asp Agent Sandbox Protocol: run any agent harness's tools in a remote sandbox over SSH. > [!WARNING] > > This page is an RFC draft. Comments are welcome on > [PR #3023](https://github.com/harbor-framework/harbor/pull/3023). ![ASP is the harness-to-sandbox edge of the managed-agents architecture](https://mintcdn.com/harborframework/WYOkng7EqHA2lqCH/images/asp-managed-agents-edge.png?fit=max\&auto=format\&n=WYOkng7EqHA2lqCH\&q=85\&s=118e9dcca3c66ff02173672a412433b7) Initially proposed by and codesigned with [@alexgshaw](https://github.com/alexgshaw) ## TL;DR * ASP lets any agent harness execute its tools in a remote sandbox through .asp.json; **SSH** is the first transport because it already provides command execution, file transfer, and authentication that every sandbox can expose. * An agent implementing ASP **does not realize** it operates on a remote machine: all of its tools execute in the sandbox, so the sandbox is the only environment it can observe. * Agent tools have two layers, a model-facing policy layer (schemas, truncation, pagination) and a mechanism layer doing raw I/O; ASP swaps only the mechanism from local I/O to I/O over the network, and the policy layer remains unchanged. * To support ASP, an existing agent only needs two additions: detect `.asp.json`, and route its tools' raw I/O (read, write, exec) through the configured transport instead of the local machine. ![alt text](https://mintcdn.com/harborframework/vzYWOwnch5t54m5e/images/asp-architecture-terse-labels.svg?fit=max\&auto=format\&n=vzYWOwnch5t54m5e\&q=85\&s=fdb6b4c2aeb6be485d736c2c7b995fd8) ## Goal *Decouple the brain from the hands!* Standardize the interface between an agent harness (the **brain**: agent loop, LLM calls, credentials) and the sandbox where its tools execute (the **hands**: filesystem, shell). Any harness should drive any sandbox through one declarative config file and a standard transport, with no provider SDK in the harness. ## Background Coding agents are ubiquitous, and non-coding agents increasingly rely on execution environments too. Yet most agents run in the **same environment** they execute code in. In low-trust or cloud settings the two are better **separated**, as argued in [Vercel's post on security boundaries in agentic architectures](https://vercel.com/blog/security-boundaries-in-agentic-architectures): credentials and host information stay out of the agent's reach, the agent cannot OOM or kill its own runtime, and infrastructure can be tuned per side, for example disabling internet in the sandbox while the runtime keeps connectivity. ![current](https://mintcdn.com/harborframework/WYOkng7EqHA2lqCH/images/asp-current.png?fit=max\&auto=format\&n=WYOkng7EqHA2lqCH\&q=85\&s=ceb5c8c977ca0fb704573ae5c519725c) Today only an agent's own developers can make that split, by rewriting its execution tools to route into a sandbox. Everyone building on top of an existing agent (Claude Code, Codex, pi) inherits its tools and cannot decouple. Shared environments hurt reproducibility, and sandbox internet access is a major reward-hacking channel, yet cutting it is impossible while the agent runs inside the sandbox, so developers fall back to brittle allowlists of model endpoints. [Anthropic's managed agents](https://www.anthropic.com/engineering/managed-agents) decomposes an agent system into session, orchestration, harness, sandbox, resources, and tools, and achieves the split by installing an environment worker inside the sandbox, which couples the sandbox to that harness. Provider SDK integrations do the reverse and couple the harness to one provider. On the other hand, [SSH](https://en.wikipedia.org/wiki/Secure_Shell) already implements the primitives the missing interface needs. It can run commands, transfer files through SFTP, and handle authentication and host verification. Many sandbox providers are already reachable over SSH or can be configured that way. What’s missing is a shared convention for telling a harness to run its tools remotely and describing how to connect. **ASP provides that convention.** ## Scope Measured against the managed-agents component table, ASP is **deliberately niche**. It standardizes only the harness-to-sandbox edge, and within that component's interface only `execute(name, input) -> String`. The `provision({resources})` half is explicitly **out of scope**, provisioning is the orchestrator's job (e.g. [harbor](https://github.com/harbor-framework/harbor)), done before the agent starts by tooling such as [daytona\_setup.py](https://github.com/kobe0938/harbor/blob/asp/asp/daytona_setup.py) and [docker\_setup.py](https://github.com/kobe0938/harbor/blob/asp/asp/docker_setup.py), and the agent must not have the freedom to provision at runtime. Sessions, orchestration, resources, and tool definitions remain whatever the harness already does. ![Of the sandbox interface, ASP takes execute and rejects provision](https://mintcdn.com/harborframework/WYOkng7EqHA2lqCH/images/asp-managed-agents-interface.png?fit=max\&auto=format\&n=WYOkng7EqHA2lqCH\&q=85\&s=032809bbdd45ba7d0c10cc909b544fe8) *ASP adopts execute and deliberately excludes provision.* ## The contract: .asp.json Check full definition at [asp.schema.json](https://github.com/kobe0938/harbor/blob/asp/asp/asp.schema.json). Examples: [daytona](https://github.com/kobe0938/harbor/blob/asp/asp/examples/daytona/.asp.json) and [docker](https://github.com/kobe0938/harbor/blob/asp/asp/examples/docker/.asp.json). | Field | Meaning | | - | - | | `version` | `"0"` | | `transport` | `"ssh"` (the first supported transport; the field exists so more can be added) | | `connection.host`, `.port`, `.user` | SSH endpoint; providers may encode an access token as the username | | `connection.identity` | client private key, by env var name or file path; omitted when token auth suffices | | `connection.host_key` | pinned server public key; omitted means trust-on-first-use | | `workspace` | absolute sandbox path that relative tool paths resolve against | A harness that finds `.asp.json` (working directory, then parents) binds its tool I/O to the sandbox. Tool calls are **stateless**, fresh shell per command, persistent filesystem. The agent is **unaware** of any of this. It is not told about the transport, and it could not act on the knowledge anyway: all of its tools execute remotely, so it has no verb that reaches the harness machine and no way to inspect the environment the harness runs in. The only environment it can observe is the sandbox itself. The boundary is enforced by capability, not by policy or prompt. ### Architecture An agent's tools split into two layers. The policy layer is model-facing: the tool schema (path, offset, limit), truncation limits, pagination. The mechanism layer is a small seam of raw I/O functions underneath (read, write, exec). ASP swaps only the mechanism, local I/O becomes the same I/O over the transport; the policy layer runs unchanged in the harness, so the model sees identical tool behavior and existing prompts and evals carry over. ![ASP Diagram](https://mintcdn.com/harborframework/WYOkng7EqHA2lqCH/images/asp-diagram.png?fit=max\&auto=format\&n=WYOkng7EqHA2lqCH\&q=85\&s=ba8b77de56c7340491b13185e2a317a8) ## Two Agent ASP examples * [A vanilla Python agent](https://github.com/kobe0938/harbor/blob/asp/asp/agent.py) with the asyncssh SDK * [An extension](https://github.com/kobe0938/harbor/blob/asp/asp/pi-asp.ts) for a minimal harness called [pi](https://github.com/earendil-works/pi) ![Minimal Python agent running a task in a Daytona sandbox over ASP](https://mintcdn.com/harborframework/WYOkng7EqHA2lqCH/images/asp-agent-run.png?fit=max\&auto=format\&n=WYOkng7EqHA2lqCH\&q=85\&s=971f97ae172c23b57e113b0cc639d2fb) *The vanilla agent running in Daytona with ASP* ## Internet configurability ASP composes cleanly with sandboxes whose internet is turned off. SSH is ingress: a stateful firewall admits replies on connections the harness initiated while dropping every connection the sandbox starts, so tools keep working with all egress dead (verified on Daytona and Docker). ## Future steps Soon, we are planning to add terminus-slim, an ASP-based version of [Terminus](https://github.com/harbor-framework/terminal-bench-1/blob/main/terminal_bench/agents/terminus_1.py). ASP v0 begins with SSH, but the format can later support transports such as stdio and HTTP. In the future, a more opinionated version could define transport-independent operations and types for **generating SDKs**. This is a v0 draft so everything here, including the schema, is **subject to change** in v0.1 or v1. **Comments are welcome!**. ## Appendix for support matrix SSH SDKs | Language | Library | Notes | Verified in this MVP | | - | - | - | - | | Python | [asyncssh](https://github.com/ronf/asyncssh) | async, clean SFTP support | [yes](https://github.com/kobe0938/harbor/blob/asp/asp/agent.py) | | Python | [paramiko](https://github.com/paramiko/paramiko) | synchronous, mature | no | | TypeScript | [ssh2](https://github.com/mscdex/ssh2) | the standard Node library; [ssh2-sftp-client](https://github.com/theophilusx/ssh2-sftp-client) adds promise SFTP | no | | TypeScript | [node-ssh](https://github.com/steelbrain/node-ssh) | promise wrapper over ssh2 | no | | Go | [ssh](https://pkg.go.dev/golang.org/x/crypto/ssh) | official extended stdlib | no | | Rust | [russh](https://github.com/Eugeny/russh) | async (tokio), includes SFTP | no | | any | [OpenSSH client](https://www.openssh.com/) | no dependency; ControlMaster multiplexing | [yes](https://github.com/kobe0938/harbor/blob/asp/asp/pi-asp.ts) | Sandbox providers | Provider | Notes | Verified in this MVP | | - | - | - | | Docker | sshd in container, published port | [yes](https://github.com/kobe0938/harbor/blob/asp/asp/examples/docker/.asp.json), incl. egress block | | Apple Container | sshd in container, routable VM IP | yes | | Daytona | managed gateway, token as username | [yes](https://github.com/kobe0938/harbor/blob/asp/asp/examples/daytona/.asp.json), incl. SFTP and `network_block_all` | | E2B | documented, via websocat ProxyCommand over WSS, custom template | no; needs a `proxyCommand` field | | Modal | no native SSH endpoint; sshd plus Modal tunnel should work | no | | GKE | no native SSH endpoint; sshd in pod plus port-forward | no | ## References * [https://www.daytona.io/docs/en/guides/claude/claude-managed-agents/](https://www.daytona.io/docs/en/guides/claude/claude-managed-agents/) * [https://www.daytona.io/docs/en/guides/pi/pi-extension/](https://www.daytona.io/docs/en/guides/pi/pi-extension/) * [https://www.anthropic.com/engineering/managed-agents](https://www.anthropic.com/engineering/managed-agents) * [https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#how-it-differs-from-cloud-environments](https://platform.claude.com/docs/en/managed-agents/self-hosted-sandboxes#how-it-differs-from-cloud-environments) * [https://agentclientprotocol.com/protocol/v1/terminals#checking-support](https://agentclientprotocol.com/protocol/v1/terminals#checking-support) * [https://modelcontextprotocol.io/examples](https://modelcontextprotocol.io/examples) * [https://github.com/daytona/integrations/blob/main/packages/pi-extension/src/ops.ts](https://github.com/daytona/integrations/blob/main/packages/pi-extension/src/ops.ts) * [https://opencode.ai/docs/tools/](https://opencode.ai/docs/tools/) * [https://github.com/earendil-works/pi/blob/main/packages/coding-agent/examples/extensions/ssh.ts](https://github.com/earendil-works/pi/blob/main/packages/coding-agent/examples/extensions/ssh.ts) * [https://vercel.com/blog/security-boundaries-in-agentic-architectures](https://vercel.com/blog/security-boundaries-in-agentic-architectures) # Custom sandboxes Source: https://docs.harborframework.com/sandboxes/custom-sandboxes Integrate and run your own sandbox with Harbor. Custom sandboxes are provider integrations developed outside Harbor's [built-in registry](/sandboxes/pre-integrated-sandboxes). They may be local work in progress or private integrations not intended for upstream. Implement `BaseEnvironment` to add one. ## Run a custom sandbox Custom sandboxes are not registered by name, so pass `module.path:ClassName` to `--env` (`-e`). Harbor imports the custom sandbox on the host. Install its module and provider SDK in the same Python environment as Harbor. For a `MySandbox` class in `my_sandbox.py`, use `my_sandbox:MySandbox`. > [tab] CLI > > ```bash theme={"system"} > export OPENAI_API_KEY="..." > harbor run \ > -t hello-world/hello-world \ > -a codex -m openai/gpt-5.6-sol \ > -e my_sandbox:MySandbox > ``` > [tab] Config > > ```json config.json theme={"system"} > { > "environment": { > "import_path": "my_sandbox:MySandbox" > }, > "agents": [ > { > "name": "codex", > "model_name": "openai/gpt-5.6-sol" > } > ], > "tasks": [ > { > "name": "hello-world/hello-world" > } > ] > } > ``` > > ```bash theme={"system"} > export OPENAI_API_KEY="..." > harbor run --config config.json > ``` > [tab] Python > > ```python theme={"system"} > import asyncio > > from harbor.job import Job > from harbor.models.job.config import JobConfig > from harbor.models.trial.config import ( > AgentConfig, > EnvironmentConfig, > TaskConfig, > ) > > > async def main(): > job = await Job.create( > JobConfig( > environment=EnvironmentConfig( > import_path="my_sandbox:MySandbox", > ), > agents=[ > AgentConfig( > name="codex", > model_name="openai/gpt-5.6-sol", > ) > ], > tasks=[TaskConfig(name="hello-world/hello-world")], > ) > ) > await job.run() > > > asyncio.run(main()) > ``` Pass constructor options with `--environment-kwarg` (`--ek`) or `environment.kwargs`: ```bash theme={"system"} harbor run ... -e my_sandbox:MySandbox --ek region=us-west-2 ``` ## Declare sandbox options Set `options_model` to an `EnvironmentOptions` subclass to validate your sandbox's `--ek` values. Add the declaration to your existing sandbox implementation: ```python my_sandbox.py theme={"system"} from pydantic import Field from harbor.environments.base import BaseEnvironment from harbor.environments.options import EnvironmentOptions class MySandboxOptions(EnvironmentOptions): region: str = Field(default="us-west-2", description="Sandbox region.") class MySandbox(BaseEnvironment): options_model = MySandboxOptions # Keep your lifecycle, execution, and file-transfer methods here. ``` `BaseEnvironment.__init__()` binds runtime inputs, validates the remaining user kwargs, and stores the parsed model in `self.options`. If your sandbox needs constructor logic, forward the arguments to the base before reading options: ```python theme={"system"} class MySandbox(BaseEnvironment): options_model = MySandboxOptions options: MySandboxOptions def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self.region = self.options.region # Keep your lifecycle, execution, and file-transfer methods here. ``` No constructor override is needed if you only read options in lifecycle methods. If base validation depends on provider state that must be initialized earlier, declare runtime inputs explicitly and parse the remaining provider kwargs before calling `super().__init__()`. The base preserves already-parsed options. Harbor validates declared options before queueing trials and rejects unknown keys. Keep injected runtime inputs, such as paths, loggers, and task configuration, outside your options model. Custom environments without an `options_model` keep their existing kwargs behavior. Preflight overrides receive user-facing kwargs. Accept the argument and call `super().preflight(kwargs)` before checking provider credentials: ```python theme={"system"} from typing import Any @classmethod def preflight(cls, kwargs: dict[str, Any] | None = None) -> None: super().preflight(kwargs) # Check credentials required by your provider here. ``` No-argument `preflight(cls)` overrides must be updated to this signature. List built-in environments without starting a sandbox: ```bash theme={"system"} harbor environment list ``` ## Implement a custom sandbox Extend [`BaseEnvironment`](https://github.com/harbor-framework/harbor/blob/main/src/harbor/environments/base.py) and implement its lifecycle, command execution, and file-transfer methods. Harbor rejects custom classes that do not inherit from `BaseEnvironment`. Use `_validate_definition()` to reject tasks missing required files, such as [`environment/Dockerfile`](/tasks/environment). If no task files are required, it can be empty. > [accordion] BaseEnvironment interface > > ```python my_sandbox.py theme={"system"} > from pathlib import Path > > from harbor.environments.base import BaseEnvironment, ExecResult > from harbor.environments.capabilities import EnvironmentCapabilities > > > class MySandbox(BaseEnvironment): > @staticmethod > def type() -> str: > return "my-sandbox" > > @property > def capabilities(self) -> EnvironmentCapabilities: > return EnvironmentCapabilities() > > def _validate_definition(self) -> None: > # Validate the task's environment/ directory. > ... > > async def start(self, force_build: bool) -> None: > # Build or create the sandbox, then prepare prebuilt-image tasks. > ... > await self._upload_environment_dir_after_start() > > async def stop(self, delete: bool) -> None: > ... > > async def exec( > self, > command: str, > cwd: str | None = None, > env: dict[str, str] | None = None, > timeout_sec: int | None = None, > user: str | int | None = None, > ) -> ExecResult: > env = self._merge_env(env) > user = self._resolve_user(user) > # Execute through the provider and return stdout, stderr, and return code. > ... > > async def upload_file(self, source_path: Path | str, target_path: str) -> None: > ... > > async def upload_dir(self, source_dir: Path | str, target_dir: str) -> None: > ... > > async def download_file(self, source_path: str, target_path: Path | str) -> None: > ... > > async def download_dir(self, source_dir: str, target_dir: Path | str) -> None: > ... > ``` `_merge_env()` applies sandbox, agent-phase, and verifier-phase variables. `_resolve_user()` applies Harbor's default execution user. Use both in every `exec()` implementation. Declare only capabilities the provider enforces. If `docker_compose` is enabled, also implement the per-service execution and file-transfer methods used by [Compose tasks](/tasks/multi-container). > [!NOTE] > > Add `preflight()` to check provider credentials before trials are queued. Keep > provider credentials in the Harbor process; see > [Environment variables](/jobs/environment-variables). # Pre-integrated sandboxes Source: https://docs.harborframework.com/sandboxes/pre-integrated-sandboxes Run tasks with local or remote environments supported by Harbor. Harbor runs each trial in an isolated environment. Local runtimes are convenient for development; remote providers free local resources and support higher concurrency. > [!NOTE] > > Harbor calls sandboxes "**environments**" in the CLI (`--env`/`-e`) and job > configuration (`environment.type`). It's a bad name, we know. But it's too late to change now. ## Run with a cloud sandbox Sandboxes are not installed by default. Install one sandbox, such as [Daytona](https://www.daytona.io/): ```bash theme={"system"} uv tool install "harbor[daytona]" ``` Replace `daytona` with [all sandbox options](#available-sandboxes) to install that sandbox. To install **all** pre-integrated sandboxes, use: ```bash theme={"system"} uv tool install "harbor[cloud]" ``` Local runtimes (e.g. `docker`) do not require optional Harbor Python dependencies, but their runtime or CLI must still be installed. > [tab] CLI > > ```bash theme={"system"} > export DAYTONA_API_KEY="..." > harbor run \ > -d terminal-bench@2.0 \ > -a codex -m openai/gpt-5.6-sol \ > -e daytona \ > -n 32 > ``` > [tab] Config > > ```json config.json theme={"system"} > { > "n_concurrent_trials": 32, > "environment": { > "type": "daytona" > }, > "agents": [ > { > "name": "codex", > "model_name": "openai/gpt-5.6-sol" > } > ], > "datasets": [ > { > "name": "terminal-bench", > "version": "2.0" > } > ] > } > ``` > > ```bash theme={"system"} > export DAYTONA_API_KEY="..." > harbor run --config config.json > ``` > [accordion] Alternative: run Harbor from source > > When running Harbor from source, `--extra daytona` installs Daytona's > optional dependencies before running the command: > > ```bash theme={"system"} > export DAYTONA_API_KEY="..." > uv run --no-dev --extra daytona harbor run \ > -t hello-world/hello-world \ > -a codex -m openai/gpt-5.6-sol \ > -e daytona > ``` Harbor runs provider preflight checks when available. Otherwise, missing setup is reported when the provider starts. **Important**: See [Environment variables](/jobs/environment-variables) to configure provider credentials and control which variables enter the sandbox. ## Available sandboxes These categories describe where a trial runs; they are documentation groupings, not separate types in Harbor's API. * **Local runtimes** execute containers on the machine running Harbor. * **Remote sandboxes** run through a provider API or infrastructure that you configure. > [accordion] Sandbox names and install extras > > **Local runtimes:** `docker` (default), `podman`, `apple-container`, > `singularity`, `sbx` (Docker Sandboxes, with `target=local`) > > **Remote sandboxes:** > [`ack`](https://www.alibabacloud.com/en/product/kubernetes) (uses kubeconfig), > [`beam`](https://www.beam.cloud/), > [`blaxel`](https://blaxel.ai/sandbox), [`cua-cloud`](https://cua.ai/) > (`cua` extra), > [`cwsandbox`](https://docs.coreweave.com/products/sandboxes), > [`daytona`](https://www.daytona.io/), [`e2b`](https://e2b.dev/), > [`ec2`](https://aws.amazon.com/ec2/), > [`gke`](https://cloud.google.com/kubernetes-engine), > [`hf-sandbox`](https://huggingface.co/docs/huggingface_hub/main/guides/sandbox), > [`hyperbrowser`](https://www.hyperbrowser.ai/), [`islo`](https://islo.dev/), > [`langsmith`](https://www.langchain.com/langsmith/sandboxes), > [`modal`](https://modal.com/products/sandboxes), [`novita`](https://novita.ai/), > [`opensandbox`](https://www.opensandbox.ai/), > [`openshift`](https://www.redhat.com/en/technologies/cloud-computing/openshift) > (uses the `oc` CLI), [`runloop`](https://runloop.ai/), > [`skypilot`](https://skypilot.ai/) (early access), > [`tensorlake`](https://www.tensorlake.ai/), > [`use-computer`](https://use.computer/), [`vercel`](https://vercel.com/sandbox), > [`runta`](https://runta.com/docs/integrations/harbor/), > [`prime`](https://github.com/PrimeIntellect-ai/prime/tree/main/packages/prime-sandboxes), > [`mosaic`](https://sandbox.mosaicos.com/), > [`smol`](https://smolmachines.com/), > [`sail`](https://docs.sailresearch.com/harbor), > [`sbx`](https://docs.docker.com/ai/sandboxes/harbor/), > [`snowflake`](https://docs.snowflake.com/en/LIMITEDACCESS/developer-guide/cortex-sandboxes/overview), > [`boxd`](https://boxd.sh/), > [`superserve`](https://docs.superserve.ai/), > [`aca-sandbox`](https://learn.microsoft.com/azure/container-apps/sandboxes-overview) ## Common Sandbox cli options | Flag | Purpose | Default | | - | - | - | | `-e`, `--env` | Select a built-in sandbox or custom import path. | `docker` | | `--ek`, `--environment-kwarg` | Pass a provider-specific constructor option. Repeatable. | None | | `-n`, `--n-concurrent` | Limit concurrent trials. | `4` | | `--force-build`, `--no-force-build` | Rebuild or reuse the task environment. | `--no-force-build` | | `--delete`, `--no-delete` | Delete or retain the sandbox after the trial. | `--delete` | | `--cpus`, `--memory` | Choose `auto`, `limit`, `request`, `guarantee`, or `ignore`. | `auto` | | `--override-cpus`, `--override-memory-mb`, `--override-storage-mb`, `--override-gpus`, `--override-tpu` | Override task resources for this run. | Task configuration | | `--env-file` | Load host credentials and other environment variables. See [Environment variables](/jobs/environment-variables). | None | Provider lifetime rules can override `--no-delete`. Run `harbor run --help` for all environment options; each provider also defines its own `--environment-kwarg` values. ## Provider capabilities Capabilities vary by sandbox and can depend on the task mode or provider settings. > [accordion] Task and hardware capabilities > > | Capability | Supported environments | > | - | - | > | Docker Compose | `docker`, `podman`, `daytona`, `modal`, `ec2`, `gke`, `islo`, `langsmith`, `novita`, `blaxel`, `beam`, `hyperbrowser`, `vercel`, `runta`, `prime`, `sail`, `sbx`, `tensorlake`, `boxd`, `superserve` | > | GPUs | `daytona`, `modal`, `gke`, `beam`, `opensandbox`, `prime`, `docker` | > | TPUs | `gke` | > | Windows | `docker`, `daytona`, `cua-cloud`, `use-computer` | > | Host-mounted logs | `docker`, `podman`, `apple-container`, `singularity` | > | Stream over SSH | `daytona`, `docker`, `modal`, `tensorlake` | > > Modal GPU support depends on its runtime settings. GKE exposes GPUs and TPUs > only for single-container tasks. Prime GPUs are also single-container only. > `cua-cloud` and `use-computer` require their > Windows platform setting. > [accordion] Network capabilities > > | Capability | Supported environments | > | - | - | > | Disable internet | `docker`, `podman`, `daytona`, `e2b`, `modal`, `runloop`, `langsmith`, `ec2`, `gke`, `novita`, `islo`, `tensorlake`, `cwsandbox`, `blaxel`, `opensandbox`, `beam`, `skypilot`, `hyperbrowser`, `vercel`, `runta`, `prime`, `mosaic`, `smol`, `sail`, `sbx`, `boxd`, `superserve` | > | Exact hostnames | `docker`, `podman`, `daytona`, `e2b`, `modal`, `runloop`, `langsmith`, `novita`, `islo`, `tensorlake`, `blaxel`, `beam`, `hyperbrowser`, `vercel`, `runta`, `prime`, `mosaic`, `smol`, `sail`, `sbx`, `superserve` | > | Wildcard hostnames | `docker`, `podman`, `daytona`, `e2b`, `modal`, `runloop`, `langsmith`, `novita`, `blaxel`, `hyperbrowser`, `vercel`, `runta`, `prime`, `sail`, `superserve` | > | IPv4 addresses | `docker`, `podman`, `daytona`, `e2b`, `modal`, `novita`, `tensorlake`, `beam`, `hyperbrowser`, `prime`, `mosaic`, `smol`, `sail`, `superserve` | > | IPv6 addresses | `docker`, `podman`, `beam`, `smol` | > | IPv4 CIDRs | `docker`, `podman`, `daytona`, `modal`, `novita`, `tensorlake`, `beam`, `hyperbrowser`, `prime`, `mosaic`, `smol`, `sail`, `superserve` | > | IPv6 CIDRs | `docker`, `podman`, `beam`, `smol` | > | Runtime policy changes | `docker`, `podman`, `daytona`, `e2b`, `modal`, `novita`, `islo`, `beam`, `hyperbrowser`, `vercel`, `runta`, `prime`, `sail`, `sbx`, `superserve` | > > Docker and Podman require Harbor's egress-control support. Daytona, > Novita, Blaxel, and Vercel allowlists are single-container only. GKE can > disable internet only in Compose mode. Islo runtime changes require its > default gateway configuration. > Modal supports allowlists and runtime policy changes for single-container tasks > and Compose tasks. CPU-only Compose tasks default to VM; > GPU tasks retain gVisor. Use `--ek modal_vm_runtime=false` to opt out. > See [network policies](/tasks/network-policies#modal-compose). > `sbx` does not support hostname allowlists or runtime policy changes with > `target=local`. > > SBX image builds use the task's network restrictions, so required download > hosts must be allowed. > [accordion] CPU and memory capabilities > > | Capability | Supported environments | > | - | - | > | CPU limit | `docker`, `podman`, `apple-container`, `modal`, `gke`, `openshift`, `skypilot`, `cwsandbox`, `opensandbox`, `ec2`, `runta`, `prime`, `smol`, `sbx`, `boxd`, `superserve` | > | CPU request | `daytona`, `e2b`, `modal`, `runloop`, `gke`, `openshift`, `novita`, `islo`, `tensorlake`, `cwsandbox`, `beam`, `skypilot`, `hyperbrowser`, `vercel`, `runta`, `mosaic`, `sail`, `snowflake`, `superserve`, `aca-sandbox` | > | Memory limit | `docker`, `podman`, `apple-container`, `modal`, `gke`, `openshift`, `skypilot`, `cwsandbox`, `opensandbox`, `ec2`, `runta`, `prime`, `smol`, `sbx`, `boxd`, `superserve` | > | Memory request | `daytona`, `e2b`, `modal`, `runloop`, `gke`, `openshift`, `novita`, `islo`, `tensorlake`, `cwsandbox`, `blaxel`, `beam`, `skypilot`, `hyperbrowser`, `vercel`, `runta`, `mosaic`, `sail`, `snowflake`, `superserve`, `aca-sandbox` | > > A **limit** is a hard ceiling. A **request** reserves or selects capacity. > `guarantee` requires both. When a provider declares resource capabilities, > Harbor rejects unsupported policies before trials start. The task's [environment definition](/tasks/environment) remains the same when switching providers, subject to these capabilities. # Artifacts Source: https://docs.harborframework.com/tasks/artifacts Declare task outputs to preserve and pass to the verifier. Artifacts are files or directories collected from the sandbox after the agent runs. Declare them in `task.toml` to preserve outputs for inspection and transfer them to a [separate verifier](/tasks/separate-verifier). ## Configuration Set `artifacts` at the top level of `task.toml`, before any section headers: ```toml task.toml theme={"system"} artifacts = ["/app/report.json", "/app/output"] ``` Harbor saves these under `/artifacts/app/`. View them in the results viewer's [Artifacts tab](/results/view-job-results#trial-files). ### Advanced options Use an object to customize collection. Strings and objects can be mixed: ```toml task.toml theme={"system"} artifacts = [ "/app/report.json", { source = "/app/output", destination = "output", exclude = ["*.tmp"] }, ] ``` | Field | Description | | - | - | | `source` | File or directory inside the sandbox. Required. | | `destination` | Relative path under `/artifacts/`. Defaults to the source path without its root. | | `exclude` | Patterns to exclude when collecting a directory. | | `service` | Compose service to collect from. Defaults to `main`. | For sidecar outputs and pre-collection commands, see [Sidecar artifacts](/jobs/artifact-collection#sidecar-artifacts). ## Separate verifiers A [separate verifier](/tasks/separate-verifier) starts in a fresh sandbox, without the agent's filesystem changes. Declare every agent-produced file it needs as an artifact. Harbor collects these after the agent runs and copies them into the verifier before grading. ```toml task.toml theme={"system"} artifacts = ["/app/report.json"] [verifier] environment_mode = "separate" ``` The verifier can read the report at `/app/report.json`. Artifact paths are preserved; `destination` only changes the saved path on the host. No separate transfer configuration is needed. Undeclared outputs are not transferred, except for the currently automatic `/logs/artifacts/` directory. Dedicated verifier images bundle grading code; when reusing the agent environment, Harbor uploads `tests/`. See [Image selection](/tasks/separate-verifier#image-selection). Harbor sanitizes artifacts uploaded to a separate verifier, so an agent can't cheat with a setuid binary or a symlink to your reference solution. See [Sanitize artifacts](/tasks/separate-verifier#sanitize-artifacts). ## Multi-step tasks Add step-specific outputs under `[[steps]]`: ```toml task.toml theme={"system"} [[steps]] name = "report" artifacts = ["/app/report.json"] ``` These are added to task- and run-level artifacts, collected before the step's verifier, and saved under `steps//artifacts/`. See [Multi-step](/tasks/multi-step). > [!WARNING] > > Automatic collection from `/logs/artifacts/` will be removed soon. Declare artifacts explicitly for new tasks. For CLI/run-level additions and collection reports, see [Artifact collection](/jobs/artifact-collection). # Configuration Source: https://docs.harborframework.com/tasks/configuration Task configuration, metadata, and schema reference. The **`task.toml`** file specifies the task configuration and metadata. ```toml theme={"system"} schema_version = "1.4" [task] name = "apple/create-unix-os" authors = [{ name = "Steve Jobs", email = "steve@apple.com" }] [metadata] difficulty_explanation = "Trivial task for demonstration" category = "programming" [verifier] timeout_sec = 120.0 env = { API_KEY = "sk-test-123" } user = "root" # optional: run the verifier as this OS user [agent] timeout_sec = 120.0 user = "agent" # optional: run the agent as this OS user [solution] env = { API_KEY = "sk-test-123" } [environment] network_mode = "allowlist" # baseline; defaults to "public" when omitted allowed_hosts = ["pypi.org"] docker_image = "apple/unix-os:latest" cpus = 1 memory_mb = 2048 storage_mb = 10240 ``` ## `[environment]` vs. `environment/` By default, Harbor defers as much configuration as possible into the `environment/` spec rather than the `task.toml`. A lot of engineering effort has gone into designing `environment/` specs (like `Dockerfile`) and they provide conventions for common use cases. Only when absolutely necessary does Harbor require configuration in the `task.toml`. A few fields in `task.toml` are due to lack of convention or common pitfalls: | Field | Explanation | | - | - | | `environment.docker_image` | Specifies the Docker image to use for the environment. (If this is set, `environment/` can be omitted entirely) | | `environment.network_mode` | Sets the network isolation mode (e.g., `public`, `allowlist`). | | `environment.allowed_hosts` | Lists domains/IPs allowed for outbound network access when `network_mode` is `allowlist`. | | `environment.env` | Defines environment variables to inject into the environment. | | `environment.healthcheck` | Configuration for checking if the environment is healthy or ready. | | `environment.workdir` | Sets the working directory for commands run in the environment. This was added by popular demand to retroactively set a `workdir` without having to rebuild the image. | ## Field reference ### General **schema\_version** `string` (default: "1.4") Version of the task configuration format. **multi\_step\_reward\_strategy** `"mean" | "final" | null` (default: null) How to derive the trial-level reward from per-step verifier results. Only applies when `[[steps]]` is set; leave unset for single-step tasks (defaults to "mean" on multi-step). See [Multi-step](/tasks/multi-step). ### `[task]` **task** `PackageInfo | null` (default: null) Optional \[task] section for registry package metadata. When present, task.name is required. **task.name** `string` Package name in org/name format (e.g., "harbor/hello-world"). Required when \[task] is declared. **task.authors** `list[Author]` (default: \[]) List of task authors. Each entry has a required name and optional email (for example, `[{ name = "Jane", email = "jane@example.com" }]`). **task.description** `string` (default: "") Human-readable description of the task. **task.keywords** `list[string]` (default: \[]) Keywords for search and categorization. ### `[metadata]` **metadata** `object` Arbitrary metadata provided by the task author. ### `[verifier]` **verifier.timeout\_sec** `number` (default: 600) Timeout in seconds for the verifier. **verifier.network\_mode** `"no-network" | "public" | "allowlist" | null` (default: null (no override)) Optional override during verify(). Applied only when set and different from the verifier baseline. See [Network policies](/tasks/network-policies). **verifier.allowed\_hosts** `list[string] | null` (default: null) Allowlist hostnames when verifier.network\_mode is allowlist. **verifier.env** `object` (default: \{}) Environment variables to set when running the verifier. **verifier.user** `string | int | null` (default: null) Username or UID to run the verifier as. When set, the environment's default user is configured accordingly before verification. If not set, the environment's container default (typically root) is used. **verifier.environment\_mode** `"shared" | "separate" | null` (default: null) Where the verifier runs. "shared" (default when both this field and \[verifier.environment] are omitted) reuses the agent's container; "separate" launches a dedicated verifier container with its own image. Omitting this field while declaring \[verifier.environment] implies "separate". Declaring "shared" alongside \[verifier.environment] is a validation error. **verifier.environment** `EnvironmentConfig | null` (default: null) Optional verifier configuration, using the same schema as `[environment]`. Verifier images and `tests/` build definitions take precedence over the agent environment. Dedicated verifier images must bundle tests; falling back to the agent environment uploads them to `/tests/`. See [Image selection](/tasks/separate-verifier#image-selection). **verifier.environment.network\_mode** `"no-network" | "public" | "allowlist"` (default: "public") Separate verifier env baseline when \[verifier.environment] is set. Same modes as environment.network\_mode. **verifier.environment.allowed\_hosts** `list[string] | null` (default: null) Allowlist hostnames when verifier.environment.network\_mode is allowlist. ### `[agent]` **agent.timeout\_sec** `number | null` (default: null) Timeout in seconds for the agent. If not set, no timeout is enforced. **agent.network\_mode** `"no-network" | "public" | "allowlist" | null` (default: null (no override)) Optional override during agent.run(). Applied only when set and different from \[environment]. See [Network policies](/tasks/network-policies). **agent.allowed\_hosts** `list[string] | null` (default: null) Allowlist hostnames when agent.network\_mode is allowlist. **agent.user** `string | int | null` (default: null) Username or UID to run the agent as. When set, the environment's default user is configured accordingly before agent setup and execution. If not set, the environment's container default (typically root) is used. ### `[solution]` **solution.env** `object` (default: \{}) Environment variables to set when running the solution. ### `[environment]` **environment.build\_timeout\_sec** `number` (default: 600) Timeout in seconds for environment build. **environment.network\_mode** `"no-network" | "public" | "allowlist"` (default: "public") Agent env baseline. Also the shared verifier baseline when no separate verifier env overrides it. See [Network policies](/tasks/network-policies). **environment.allowed\_hosts** `list[string] | null` (default: null) Allowlist hostnames when environment.network\_mode is allowlist. **environment.docker\_image** `string | null` (default: null) A pre-built Docker image to use for the environment. When set, environment/Dockerfile is optional for supported environment types. **environment.os** `"linux" | "windows"` (default: "linux") Target operating system for the task container. "linux" (default) or "windows". When "windows", Harbor uses Windows-style paths, cmd.exe execution, tar-over-exec file transfer, and filters script discovery to .bat only. The Docker daemon mode and image OS are validated against this value at start; mismatches fail fast. **environment.cpus** `number | null` (default: null) Number of CPUs requested by the task. When omitted, Harbor leaves CPU sizing to the selected provider. Fractional values require [provider support](/tasks/resources#provider-support). **environment.memory\_mb** `integer | null` (default: null) Amount of RAM requested by the task in megabytes. When omitted, Harbor leaves memory sizing to the selected provider. **environment.storage\_mb** `integer | null` (default: null) Amount of storage requested by the task in megabytes. When omitted, Harbor leaves storage sizing to the selected provider. **environment.gpus** `integer | null` (default: null) Number of GPUs requested by the task. When omitted, Harbor does not request GPUs. **environment.gpu\_types** `list[string] | null` (default: null) List of acceptable GPU types (e.g., \['H100', 'A100', 'T4']). None means any GPU type is acceptable. **environment.tpu** `TpuSpec | null` (default: null) TPU slice specification (type + topology). When set, the environment requests a TPU node matching this spec; per-pod chip count is derived from the topology. Singular because a task allocates exactly one TPU slice per pod. Only supported on TPU-capable environments (currently GKE). **environment.tpu.type** `string` TPU accelerator type. Accepts either a user-friendly alias (e.g., 'v6e', 'trillium', 'v4') or a canonical GKE label (e.g., 'tpu-v6e-slice', 'tpu7x'). **environment.tpu.topology** `string` TPU topology as 'NxM' or 'NxMxK' (e.g., '2x4', '2x2x1'). Required — GKE's implicit default topology is not part of a stable contract, so omitting it would make Harbor runs non-reproducible across GKE versions. Per-pod TPU chip count is computed as the product of dimensions (e.g. '2x2x1' → 4 chips, '2x4' → 8 chips). Each dimension must be a positive integer (no leading zeros). **environment.allow\_internet** `boolean | null` (default: null) Deprecated compatibility field. Prefer \[environment].network\_mode. When set and \[environment].network\_mode is omitted, false maps to no-network and true maps to public. **environment.env** `object` (default: \{}) Environment variables required for the task, resolved from the host at runtime. Supports `${VAR}` and `${VAR:-default}` template syntax. **environment.mcp\_servers.name** `string` Unique name for each MCP server entry (declare servers as `[[environment.mcp_servers]]` in TOML). Compatible agents register them automatically. See [MCPs](/tasks/environment#mcps). **environment.mcp\_servers.transport** `"stdio" | "sse" | "streamable-http"` (default: "sse") How the agent connects to the server. "sse" and "streamable-http" require url; "stdio" requires command. Legacy value "http" is normalized to "streamable-http". **environment.mcp\_servers.url** `string | null` (default: null) Endpoint URL when transport is "sse" or "streamable-http" (e.g. [http://mcp-server:8000/mcp](http://mcp-server:8000/mcp) for a Compose sidecar). Required for those transports. **environment.mcp\_servers.headers** `object[string, string]` (default: \{}) HTTP request headers for "sse" and "streamable-http" servers. Values support embedded `${VAR}` and `${VAR:-default}` references resolved when the agent starts. Credential headers must use `${VAR}` references. Headers are invalid for "stdio" servers. See [MCPs](/tasks/environment#mcps). **environment.mcp\_servers.command** `string | null` (default: null) Executable to spawn when transport is "stdio". Required for stdio. **environment.mcp\_servers.args** `list[string]` (default: \[]) Arguments passed to command when transport is "stdio". **environment.skills\_dir** `string | null` (default: null) Path to a [skills directory](/tasks/skills) in the environment. Contents are registered with compatible agents. **environment.healthcheck** `HealthcheckConfig | null` (default: null) Optional healthcheck block run after environment start (omit the whole \[environment.healthcheck] section to disable). When set, command is required; other fields use the defaults below. **environment.healthcheck.command** `string` Shell command to run as a healthcheck after environment start. Exit 0 means healthy. Required when \[environment.healthcheck] is present. **environment.healthcheck.interval\_sec** `number` (default: 5) Time in seconds between healthcheck attempts. **environment.healthcheck.timeout\_sec** `number` (default: 30) Maximum time in seconds for a single healthcheck command. **environment.healthcheck.start\_period\_sec** `number` (default: 0) Grace period in seconds after environment start during which failures don't count. **environment.healthcheck.start\_interval\_sec** `number` (default: 5) Interval in seconds between checks during the start period. **environment.healthcheck.retries** `integer` (default: 3) Number of consecutive failures before the healthcheck is considered failed. **environment.workdir** `string | null` (default: null) Default working directory for command execution in the environment. Overrides the container WORKDIR when set. ### Artifacts **artifacts** `list[string | ArtifactConfig]` (default: \[]) Root-level paths to snapshot from the environment into the trial artifacts directory after the agent runs, before verification. For multi-step tasks, these paths are included in every step's collection pass, alongside `[[steps]].artifacts` — see [Multi-step](/tasks/multi-step). Each entry is a container path string or a table with source / destination / exclude. See [Artifacts](/tasks/artifacts) for examples. **artifacts.source** `string` Container path to download (file or directory). Required for table entries; a bare string in the artifacts list is shorthand for source only. **artifacts.destination** `string | null` (default: null) Relative path under the trial artifacts directory. When omitted, Harbor derives the host path from source. **artifacts.exclude** `list[string]` (default: \[]) Glob patterns to exclude when source is a directory (passed as tar --exclude flags). ### Provenance **source** `string | null` (default: null) Optional source string for task provenance. ## Multi-step configuration The field reference above covers single-step and shared task-root settings. Multi-step tasks add `[[steps]]` entries with per-step `agent`, `verifier`, `healthcheck`, `min_reward`, and `artifacts` overrides. Step fields, `workdir/setup.sh`, and trial-level reward rollup are documented on [multi-step tasks](/tasks/multi-step). ## TOML templates During task creation, you can pass a `--metadata-template` flag with a path to a TOML file to pre-populate `task.toml` with metadata fields and config defaults: ```bash theme={"system"} harbor task init [org]/[name] --metadata-template task-template.toml ``` Sections in the template override Harbor's built-in defaults. Newly scaffolded tasks set `verifier.environment_mode = "separate"` unless the template overrides it; other omitted settings use the defaults listed above. # Environment Source: https://docs.harborframework.com/tasks/environment The environment for a task. The `environment/` directory defines the environment the agent and verifier run in. Most often, this directory contains a `Dockerfile` or `docker-compose.yaml` file. ## What is an environment in Harbor? An environment in Harbor is a **`BaseEnvironment`** implementation, which defines the following methods: `exec`, `upload_file`, `upload_dir`, `download_file`, `download_dir`, `start`, `stop`. Typically, these are implemented for container runtimes like [Docker](https://www.docker.com/) or a cloud sandbox provider like [Daytona](https://www.daytona.io/) or [Modal](https://modal.com/). ## Prebuilt Docker images Users can prebuild a Docker image, host it on a container registry like Docker Hub or GitHub Packages, and reference it in the `task.toml` using `[environment].docker_image`. If present, most providers prefer the prebuilt image over building from the `environment/` directory due to speed and reproduciblity. > [!NOTE] > > If `[environment].docker_image` is set in the `task.toml`, the `environment/` directory may be omitted entirely. ## MCPs Harbor supports multi-container environments via `environment/docker-compose.yaml`. See [Multi-container](/tasks/multi-container) for more details. MCPs are commonly used to mock external services like databases or APIs and can be implemented as services in the `docker-compose.yaml` file. Available MCP servers should be declared in the `task.toml` using `[[environment.mcp_servers]]` so [compatible agents](/agents/pre-integrated-agents#agent-capabilities) (e.g. Claude Code, Codex) can register them automatically. ```toml title="task.toml" theme={"system"} [[environment.mcp_servers]] name = "mcp-server" transport = "streamable-http" url = "http://mcp-server:8000/mcp" headers = { Authorization = "Bearer ${MCP_TOKEN}" } ``` `headers` is supported by Claude Code and Codex. Codex requires streamable HTTP. Values support `${VAR}` and `${VAR:-default}`, using agent environment variables (including `--ae`) before the host environment. Harbor asks before task headers access host variables. Agent servers override task servers with the same name. Missing variables or unsupported headers fail before setup. Credentials must use variables without literal defaults, such as `Bearer ${TOKEN}` or `Basic ${USER}:${PASSWORD}`. For cookies, use `${COOKIE}` containing the complete cookie string. Saved configs retain these templates; resolved credentials are redacted from trial output. ## Skills Skills can be bundled into the environment and exposed to [compatible agents](/agents/pre-integrated-agents#agent-capabilities) using `[environment].skills_dir`. ```toml title="task.toml" theme={"system"} [environment] skills_dir = "/app/skills" ``` See [Tasks → Skills](/tasks/skills) for the required layout, image configuration, and how Harbor passes skills to agents. ## Tools Harbor considers tools to be a component of the agent, not the environment. If the environment does provide tools, it should do so in the form of MCPs, skills, APIs, or CLIs. In Harbor, agents can run inside or outside of the environment. If they run inside the environment, they can obviously use whichever tools they like. If they run outside the environment, their tools must be composed of the `BaseEnvironment` primitives defined above (which are close to sys-calls and therefore should be relatively unconstraining). ## What about external services? External services like databases or APIs should either be mocked or used directly. For example, if the task involves interacting with Stripe, you can either mock a small component of Stripe as a service in the `environment/docker-compose.yaml` file or use the real Stripe API directly. This works best with products like Stripe, which already provide a sandbox/dev mode. We recommend sandboxing your external services instead of using them directly as much as possible because it increases controlability and reproducibility. If you do choose to interface with production services directly, consider using `[agent].allowed_hosts` to restrict the agent's network access to that specific endpoint. ## What if my agent *and* environment are external services? It's not uncommon for production agents and environments to be tightly coupled products (e.g. a tool-calling agent tightly coupled to a product's APIs). In this case, you may be tempted to use the Harbor environment to ping your agent's API to perform the rollout and then ping your environment's API to verify the agent's output. If you find yourself doing this, Harbor may not be the right fit for your use case. Harbor shines when you want to evaluate coding/cowork agents that leverage code execution and a filesystem. That being said, we believe most agents are moving in this direction and we also believe all existing product companies should be evaluating how well coding agents can use their MCPs, APIs, and CLIs, or whether they can be used to power product features (e.g. extracting fields from a W2). ## Special paths Linux paths (Windows uses `C:` equivalents): | Path | Description | | - | - | | `/logs/verifier/` | Reward and verifier output | | `/logs/agent/` | Optional agent logging | | `/solution/` | Oracle copies [solution](/tasks/solution) here | | `/tests/` | Harness copies [tests](/tasks/verifier) here for shared verifier | `/logs/` is synced to the host after the trial for debugging. ## Resources Resources are declared in the `[environment]` section of `task.toml`. ```toml title="task.toml" theme={"system"} [environment] cpus = 2 memory_mb = 4096 storage_mb = 10240 gpus = 1 gpu_types = ["H100", "A100"] [environment.tpu] type = "v6e" topology = "2x4" ``` These fields are optional, and if omitted, Harbor will use the provider's default sizing. Harbor users can also choose how these resource declarations are applied by the provider using the `--cpus` and `--memory` flags. See [Resources](/tasks/resources) for more details. ## Operating system `[environment].os` is `"linux"` (default) or `"windows"`. Check [Agent capabilities](/agents/pre-integrated-agents#agent-capabilities) for Windows support. # Instruction Source: https://docs.harborframework.com/tasks/instruction Defining the objective of the task for the agent. The **`instruction.md`** file is markdown passed to the agent at the start of a trial. It defines the task the agent is to complete in the environment. ## Location | Task type | Path | | - | - | | Single-step | `instruction.md` at the task root | | Multi-step | `steps//instruction.md` per step — see [Multi-step](/tasks/multi-step) | ## Writing effective instructions What makes a good instruction depends on the intended use case of the task. However, in most cases, we recommend concise instructions that define clear outcomes. * **Outcomes** — What success looks like (files created, commands run, metrics hit). * **Paths and schemas** — Use absolute environment paths (`/app/out.json` not `out.json`) and define schemas for the output so instructions and tests agree. ## Preventing contamination Harbor automatically removes leading markdown comments at the top of the `instruction.md` file, which enables adding canary strings to the instruction to prevent contamination. ```markdown title="instruction.md" theme={"system"} This is an instruction. ``` ## Prompt vs. instruction Agents and tasks should be decoupled and handled independently. Often, users are tempted to modify their agent's prompt by modifying the `instruction.md` file, which breaks the separation of concerns between agents and tasks. If prompt customization is needed, the task instruction should be treated as an input to the agent's prompt, which may transform or scaffold it. For example, many integrated agents in Harbor accept a `prompt_template_path` parameter that expects an `{instruction}` placeholder. ## Example Instruction ```markdown title="instruction.md" theme={"system"} Create a new ssh key pair in the files `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`. ``` ## How agents receive the instruction Integrating an agent into Harbor involves defining the following method: ```python theme={"system"} @abstractmethod async def run( self, instruction: str, environment: BaseEnvironment, context: AgentContext, ) -> None: ... ``` For an agent like Claude Code, the implementation might look like: ```python theme={"system"} environment.exec(command=f"claude -p {shlex.quote(instruction)}") ``` Note that the instruction is *not* passed to the agent as a file in the environment. # Lint Source: https://docs.harborframework.com/tasks/lint Check task configuration, files, and common security risks without running a sandbox. `harbor lint` checks task configuration, files, and common security risks without running a sandbox. ```bash theme={"system"} harbor lint ./task-one ./task-two harbor lint --json ./task-one harbor lint --ignore shared-verifier ./task-one harbor lint --select shared-verifier --select unpinned-python-dependency ./task-one harbor lint --extend-select root-agent --extend-select unpinned-image ./task-one harbor lint --extend-select ALL ./task-one ``` All rules except `root-agent` and `unpinned-image` run by default. Without file configuration: * `--select A` → **A only** * `--extend-select A` → **defaults + A** * `--ignore A` → **defaults − A** Repeat these options to specify multiple exact rule names. `--select` and `--extend-select` also accept `ALL`, including rules added in future versions. Rule selection is inspired by [Ruff](https://docs.astral.sh/ruff/linter/#__tabbed_3_1). Configure the same options in `task.toml` or `dataset.toml`: ```toml theme={"system"} [metadata.harbor.lint] extend-select = ["root-agent"] ignore = ["shared-verifier"] ``` Precedence: **CLI flags > task.toml > dataset.toml > defaults**. ## Task checks | Rule | Default | Reports | | - | - | - | | `invalid-task-config` | ✓ | Invalid task or Compose configuration. | | `unknown-config-field` | ✓ | Unknown configuration fields, with spelling suggestions. | | `invalid-task-files` | ✓ | Missing or excluded required files, empty instructions, unsafe input paths, or invalid active `.harborignore` files. | | `unused-harborignore` | ✓ | `.harborignore` files outside `tests/` or `solution/`, including their step equivalents. | | `root-agent` | — | An omitted or root agent user, including step overrides. | | `shared-verifier` | ✓ | A verifier sharing the agent sandbox. | | `overlapping-artifacts` | ✓ | Artifact output collisions that can skip requested content, including across services and within steps. | | `artifact-log-overlap` | ✓ | Artifacts overlapping a separate verifier's protected agent or verifier log paths. | | `unpinned-image` | — | External images without a SHA-256 digest in task configuration, Dockerfile `FROM` instructions, or Compose. | | `unpinned-python-dependency` | ✓ | Direct `pip install`, `uv pip/tool install`, and `uvx --with` dependencies without exact versions or immutable references. | | `verifier-runtime-install` | ✓ | Separate verifiers installing pytest or pytest-json-ctrf at trial time, unless explicitly offline. | | `verifier-network-download` | ✓ | Separate verifiers cloning external repositories, saving external downloads, or piping downloads into a shell. | | `agent-image-test-leak` | ✓ | Explicit `COPY`/`ADD` references to `tests/test.sh`, `tests/test_*.py`, or `solution/solve.sh` in agent Dockerfiles. | ## Compose checks Requires the **Docker CLI**. Tasks without Compose files do not run these checks. Harbor runtime variables use placeholder values; runtime host mounts are flagged as potentially external. Compose interpolation uses the applicable agent or verifier environment configuration; task values override shell values. | Rule | Default | Reports | | - | - | - | | `compose-privileged` | ✓ | Privileged services or lifecycle hooks. | | `compose-additional-capabilities` | ✓ | Capabilities requested through `cap_add`. | | `compose-writable-bind-mount` | ✓ | Host bind mounts with write access. | | `compose-external-bind-mount` | ✓ | Bind sources that resolve outside the task directory. | | `compose-symlink-bind-mount` | ✓ | Bind sources that traverse a symlink and resolve outside the task directory. | Linting is optional. Use `--ignore` for rules that do not fit your task. > [!NOTE] > > Static linting complements the rubric-based `harbor check` and `harbor analyze` and does not guarantee task or verifier correctness. # Multi-container Source: https://docs.harborframework.com/tasks/multi-container Multi-container documentation for Harbor. Multi-container environments enable additional services to your environment to represent databases, APIs, MCPs, etc. ## Specification In most cases, use **`environment/docker-compose.yaml`** to specify the multi-container environment. > [!NOTE] > > Harbor itself is agnostic to which infra-as-code spec you use, which means it is possible to support multi-container environments using something other than `docker-compose.yaml`. We have not implemented support for anything else natively, but users are free to do so by implementing a [custom environment](/sandboxes/custom-sandboxes). ## Reserved services and default compose Harbor reserves the `main` service name for the agent container. All other services are treated as sidecars. Harbor merges your `environment/docker-compose.yaml` on top of a base compose file, so you do not need to define the `main` service build or keepalive command yourself. For tasks with a `Dockerfile`, the base compose is [`docker-compose-build.yaml`](https://github.com/harbor-framework/harbor/blob/main/src/harbor/environments/docker/docker-compose-build.yaml): ```yaml title="src/harbor/environments/docker/docker-compose-build.yaml" theme={"system"} services: main: build: context: ${CONTEXT_DIR} pull_policy: build command: [ "sh", "-c", "sleep infinity" ] ``` For tasks that use a prebuilt image instead of building locally, Harbor uses [`docker-compose-prebuilt.yaml`](https://github.com/harbor-framework/harbor/blob/main/src/harbor/environments/docker/docker-compose-prebuilt.yaml): ```yaml title="src/harbor/environments/docker/docker-compose-prebuilt.yaml" theme={"system"} services: main: image: ${PREBUILT_IMAGE_NAME} command: [ "sh", "-c", "sleep infinity" ] ``` ## Example Layout ```bash theme={"system"} my-task/ ├── instruction.md ├── task.toml └── environment/ ├── Dockerfile # agent (main) service ├── docker-compose.yaml # sidecars + depends_on └── mcp-server/ # optional service build context ├── Dockerfile └── server.py ``` Harbor treats the agent service as **`main`**. In compose you typically only add overrides such as `depends_on` and healthchecks; Harbor wires the rest. ```yaml title="environment/docker-compose.yaml" theme={"system"} services: main: depends_on: mcp-server: condition: service_healthy mcp-server: build: context: ./mcp-server expose: - "8000" healthcheck: test: ["CMD", "python", "-c", "import socket; s=socket.create_connection(('localhost',8000),timeout=2); s.close()"] interval: 2s timeout: 5s retries: 15 start_period: 5s ``` Sidecars share a Docker network with `main`; reach them by **service name** (e.g. `http://mcp-server:8000`). ## Support | Support | Environments | | - | - | | Native Compose | `docker`, `podman`, `ec2`, `islo`, `vercel` | | DinD Docker Compose | `blaxel`, `beam`, `daytona`, `gke`, `hyperbrowser`, `langsmith`, `modal`, `novita`, `tensorlake`, `sail`, `sbx`, `superserve` | | Other multi-container specifications | Custom environments only | | Not supported | `e2b`, `runloop`, `ack`, `openshift`, `apple-container`, `singularity`, `cwsandbox`, `use-computer`, `cua-cloud`, `opensandbox`, `skypilot`, `hf-sandbox` | # Multi-step Source: https://docs.harborframework.com/tasks/multi-step Evaluate agent performance across multiple milestones. Multi-steps tasks provide a way to iterleave verification through the agent run and measure an agent's ability to continue work from a prior session. They are helpful for long-horizon tasks with early stopping conditions and for measuring memory and continual learning ability. ## Format Multi-step tasks have a different format than a typical Harbor task: ```bash theme={"system"} task.toml environment/ ├── Dockerfile # or some other spec └── ... tests/ ├── helpers.py # optional shared grading utilities └── ... steps/ ├── step-1/ │ ├── instruction.md │ ├── tests/ │ │ ├── test.sh │ │ └── ... │ ├── solution/ │ │ ├── solve.sh │ │ └── ... │ └── workdir/ │ ├── setup.sh # optional │ └── ... └── step-2/ └── ... ``` A step can contain the following files and folders: * `instruction.md` (required) * `tests/` (optional) * `solution/` (optional) * `workdir/` (optional) ## Configuration Declare steps in the root `task.toml`, in execution order. Each `name` matches a directory under `steps/`. Other task settings use the standard [task configuration](/tasks/configuration). ```toml theme={"system"} multi_step_reward_strategy = "mean" [agent] timeout_sec = 600 [[steps]] name = "step-1" min_reward = 1.0 [steps.agent] timeout_sec = 300 [[steps]] name = "step-2" [steps.verifier] timeout_sec = 120 ``` Here, `step-1` gets a 300-second agent timeout; `step-2` inherits 600 seconds. `step-2` runs only if `step-1` earns a `reward` of at least `1.0`. ### Steps schema Each `[[steps]]` entry accepts: **name** `string` *required* Unique, portable directory name under `steps/`. **agent** `AgentConfig` Per-step agent settings, using the task's `[agent]` schema. **verifier** `VerifierConfig` Per-step verifier settings, using the task's `[verifier]` schema, including [separate environments](/tasks/separate-verifier). **min\_reward** `number | object | null` (default: null) Reward threshold required to continue. See [Early stopping](#early-stopping). **healthcheck** `HealthcheckConfig | null` (default: null) Additional healthcheck after step setup, before the agent runs. Uses the environment healthcheck schema. **artifacts** `list[string | ArtifactConfig]` (default: \[]) Extra [artifacts](/tasks/configuration#artifacts) collected after the agent runs, before the step's verification, into `steps//artifacts/`, alongside task- and trial-level artifacts. ### Trial reward Set `multi_step_reward_strategy` at the top level of `task.toml`: * `"mean"` (default): average each reward across steps with verifier results; missing keys count as zero. * `"final"`: use the last executed step's verifier result. ## Early stopping Set `min_reward` on a step to skip remaining steps when its score is too low. A number checks the `reward` key; an object requires every named reward to meet its threshold: ```toml theme={"system"} [[steps]] name = "step-1" min_reward = { accuracy = 0.9, safety = 1.0 } [[steps]] name = "step-2" ``` Missing reward keys fail the check; equality passes. Without `min_reward`, low scores do not stop execution. Thresholds are ignored when verification is disabled, but a step error without a verifier result still stops the task. Skipped steps do not contribute to the trial reward. `"final"` uses the last executed step; `"mean"` averages the available verifier results. ## Test helpers Put shared helpers in the base `tests/`. Harbor copies them to `/tests/`, then overlays the step's tests, overwriting matching files. [Separate verifiers](/tasks/separate-verifier#image-selection) use bundled tests with dedicated verifier images, or the same upload behavior when falling back to the agent environment. ## Adding step-specific environment files Sometimes, you want to upload files to the agent's workspace at the start of a step. To do this, place files in `steps//workdir/`. Harbor copies them into the agent's working directory before the step, overwriting matching paths. ```bash theme={"system"} steps/step-2/workdir/ ├── input.csv └── setup.sh ``` An optional `setup.sh` runs with Bash after copying. Filesystem changes persist between steps. ## Resuming an agent session Each step starts a fresh conversation by default. To continue the previous step's session, use: > [tab] CLI > > ```bash theme={"system"} > harbor run \ > --path "" \ > --agent "" \ > --model "" \ > --resume-trajectory > ``` > [tab] Config > > ```yaml theme={"system"} > tasks: > - path: "" > agents: > - name: "" > model_name: "" > resume_trajectory: true > ``` Requires an agent with native resume support. The environment persists regardless of this setting. ## Starting from a specific step > [!NOTE] > > Starting from a specific step is coming soon. To enable this feature, make sure prior steps contain `solution/solve.sh` files. # Network policies Source: https://docs.harborframework.com/tasks/network-policies Network policies documentation for Harbor. Often, task authors want to constrain the network access of the agent or verifier during a rollout for security, reproducibility, or reward hacking mitigation. Network policies can be specified in the `task.toml` file at varying degrees of granularity. How you choose to specify depends on your environment affordances and use case. ## Example ```toml title="task.toml" theme={"system"} [environment] # default unless overridden by [agent] or [verifier] network_mode = "public" [agent] # applies during agent.run() -- but *not* during agent.setup() network_mode = "allowlist" allowed_hosts = ["pypi.org", "api.openai.com"] [verifier] # applies during verifier.verify() network_mode = "no-network" ``` ![Diagram showing the public environment baseline, the allowlist during the agent phase, and no network during the verifier phase](https://mintcdn.com/harborframework/ByMfu-LEbojpJQFw/images/netpolicy.png?fit=max\&auto=format\&n=ByMfu-LEbojpJQFw\&q=85\&s=ea0ff2b0c76062c1bf11ab89bbaed368) Network policy across phases in the shared sandbox > [!NOTE] > > In this example, downloading and installing the agent still works because > `agent.setup()` uses the public `[environment]` baseline. `[agent]` applies > only to `agent.run()`. If a phase has no override, it inherits its sandbox's > baseline policy. ## Network modes Harbor supports three network modes: `public`, `no-network`, and `allowlist`. | Network mode | Description | Supported environments | | - | - | - | | `public` | Full network access. | All | | `no-network` | No network access. | `docker`³, `podman`³, `daytona`, `e2b`, `langsmith`, `tensorlake`, `cwsandbox`, `runloop`, `modal`¹⁰, `gke`², `ec2`, `novita`, `islo`, `blaxel`, `opensandbox`, `skypilot`, `beam`, `hyperbrowser`, `vercel`⁷, `runta`, `prime`, `sail`, `sbx`, `boxd`, `superserve` | | `allowlist` | Network access only to targets listed in `allowed_hosts`; empty or omitted hosts deny all egress. | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `langsmith`, `islo`, `runloop`, `modal`¹⁰, `novita`¹, `blaxel`¹, `beam`⁵, `tensorlake`⁶, `hyperbrowser`, `vercel`⁷, `runta`, `prime`, `sail`, `sbx`⁹, `superserve` | > [accordion] Provider-specific limitations > > The `prime` provider applies runtime network policy changes to new connections; existing connections stay open. > > The `sail` provider applies runtime network policy changes to new connections; existing connections stay open, except that a switch to `no-network` stalls them. > > The `superserve` provider applies runtime network policy changes to new connections; existing connections stay open. It matches hostname entries on the TLS SNI or HTTP `Host` header, so they allow ports 80 and 443 only, and a `*.example.com` entry matches subdomains at any depth but not `example.com` itself; IPv4 address and CIDR entries allow every port. A hostname allowlist also allows the sandbox's DNS resolvers. > > ¹ Single-container tasks only (not in Docker Compose mode).\\ > > ² Docker Compose (multi-container) tasks only.\\ > > ³ Docker and Podman support requires Linux containers; Windows containers do not support this network policy mode.\\ > > ⁴ Docker and Podman support requires Linux containers and local runtime support for the nftables kernel features used by Harbor's egress-control sidecar.\\ > > ⁵ Beam resolves concrete hostnames to IP CIDRs before applying the policy; wildcard host entries are not supported.\\ > > ⁶ TensorLake allowlists accept exact hostnames, leading-wildcard hostnames (a wildcard matches subdomains at any depth but not the apex domain), IPv4 literals, and IPv4 CIDR ranges, but not IPv6 targets.\\ > > ⁷ Vercel allowlists are available for single-container tasks only. They match domain rules on the TLS SNI, accept exact and leading-wildcard hostnames but not IP literals or CIDR ranges, and deny plain-text HTTP to an allowlisted host. The policy applies from sandbox creation and can be updated on a running sandbox. Compose tasks support `public` and `no-network` only.\\ > > ⁸ Islo supports dynamic network policy only when no custom gateway profile or gateway configuration is supplied.\\ > > ⁹ SBX allowlists and runtime policy changes require `target=cloud`. Local SBX supports static `no-network` only.\\ > > ¹⁰ See [Modal Compose](#modal-compose) for runtime requirements and startup restrictions. ## Phases Network policies can be specified for the following phases: | Phase | Description | Supported environments | | - | - | - | | `[environment]` | The baseline network policy configured at environment start time. | Any environment that supports the requested network mode | | `[agent]` | Network access during `agent.run()` phase. This requires the environment provider to support dynamic network policy switching. This overrides the `[environment]` baseline. | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `islo`⁸, `modal`¹⁰, `novita`¹, `beam`⁵, `hyperbrowser`, `vercel`⁷, `tensorlake`⁶, `runta`, `prime`, `sail`, `sbx`⁹, `superserve` | | `[verifier]` | Network access during `verify()` phase. This requires the environment provider to support dynamic network policy switching. This overrides the `[environment]` baseline. | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `islo`⁸, `modal`¹⁰, `novita`¹, `beam`⁵, `hyperbrowser`, `vercel`⁷, `tensorlake`⁶, `runta`, `prime`, `sail`, `sbx`⁹, `superserve` | | `[verifier.environment]` | The baseline network policy configured at verifier environment start time, when using a separate verifier environment. | Any environment that supports the requested network mode | Baseline phases are subject to the environment supporting the requested network mode (see the table above). These phases can also be specified at the step-level, when using [multi-step tasks](/tasks/multi-step). ## Capabilities Each `BaseEnvironment` implementation declares an `EnvironmentCapabilities` model describing what it can do. The following capabilities govern network policy enforcement: | Capability | Description | Environments | | - | - | - | | `disable_internet` | The environment can run containers without internet access (`no-network`). | `docker`³, `podman`³, `daytona`, `e2b`, `langsmith`, `tensorlake`, `cwsandbox`, `runloop`, `modal`¹⁰, `gke`², `ec2`, `novita`, `islo`, `blaxel`, `opensandbox`, `skypilot`, `beam`, `hyperbrowser`, `vercel`⁷, `runta`, `prime`, `sail`, `sbx`, `boxd`, `superserve` | | `network_allowlist` | The environment can restrict egress to configured allowlist entries (`allowlist`). | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `langsmith`, `islo`, `runloop`, `modal`¹⁰, `novita`¹, `blaxel`¹, `beam`⁵, `tensorlake`⁶, `hyperbrowser`, `vercel`⁷, `runta`, `prime`, `sail`, `sbx`⁹, `superserve` | | `network_allowlist_hostnames` | The environment can enforce exact hostname entries in `allowed_hosts`. | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `langsmith`, `islo`, `runloop`, `modal`¹⁰, `novita`¹, `blaxel`¹, `beam`⁵, `tensorlake`⁶, `hyperbrowser`, `vercel`⁷, `runta`, `prime`, `sail`, `sbx`⁹, `superserve` | | `network_allowlist_wildcard_hostnames` | The environment can enforce leading-wildcard hostname entries in `allowed_hosts`. | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `langsmith`, `runloop`, `modal`¹⁰, `novita`¹, `blaxel`¹, `hyperbrowser`, `vercel`⁷, `tensorlake`⁶, `runta`, `prime`, `sail`, `superserve` | | `network_allowlist_ipv4_addresses` | The environment can enforce IPv4 address literal entries in `allowed_hosts`. | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `modal`¹⁰, `novita`¹, `beam`⁵, `tensorlake`⁶, `hyperbrowser`, `prime`, `sail`, `superserve` | | `network_allowlist_ipv6_addresses` | The environment can enforce IPv6 address literal entries in `allowed_hosts`. | `docker`⁴, `podman`⁴, `beam`⁵ | | `network_allowlist_ipv4_cidrs` | The environment can enforce IPv4 CIDR range entries in `allowed_hosts`. | `docker`⁴, `podman`⁴, `daytona`¹, `modal`¹⁰, `novita`¹, `beam`⁵, `tensorlake`⁶, `hyperbrowser`, `prime`, `sail`, `superserve` | | `network_allowlist_ipv6_cidrs` | The environment can enforce IPv6 CIDR range entries in `allowed_hosts`. | `docker`⁴, `podman`⁴, `beam`⁵ | | `dynamic_network_policy` | The environment can switch the active network policy after start, enabling `[agent]` and `[verifier]` phase overrides. | `docker`⁴, `podman`⁴, `daytona`¹, `e2b`, `islo`⁸, `modal`¹⁰, `novita`¹, `beam`⁵, `hyperbrowser`, `vercel`⁷, `tensorlake`⁶, `runta`, `prime`, `sail`, `sbx`⁹, `superserve` | > [accordion] Full feature grid > > | Capability | `docker` | `podman` | `daytona` | `e2b` | `langsmith` | `tensorlake` | `cwsandbox` | `runloop` | `modal` | `gke` | `ec2` | `novita` | `islo` | `blaxel` | `opensandbox` | `skypilot` | `beam` | `hyperbrowser` | `vercel` | `runta` | `prime` | `sail` | `sbx`⁹ | `superserve` | > | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | - | > | `disable_internet` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | > | `network_allowlist` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ✓ | ✓ | ✓ | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | > | `network_allowlist_hostnames` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ✓ | ✓ | ✓ | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | > | `network_allowlist_wildcard_hostnames` | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | ✓ | | | ✓ | | ✓ | | | | ✓ | ✓ | ✓ | ✓ | ✓ | | ✓ | > | `network_allowlist_ipv4_addresses` | ✓ | ✓ | ✓ | ✓ | | ✓ | | | ✓ | | | ✓ | | | | | ✓ | ✓ | | | ✓ | ✓ | | ✓ | > | `network_allowlist_ipv6_addresses` | ✓ | ✓ | | | | | | | | | | | | | | | ✓ | | | | | | | | > | `network_allowlist_ipv4_cidrs` | ✓ | ✓ | ✓ | | | ✓ | | | ✓ | | | ✓ | | | | | ✓ | ✓ | | | ✓ | ✓ | | ✓ | > | `network_allowlist_ipv6_cidrs` | ✓ | ✓ | | | | | | | | | | | | | | | ✓ | | | | | | | | > | `dynamic_network_policy` | ✓ | ✓ | ✓ | ✓ | | ✓ | | | ✓ | | | ✓ | ✓ | | | | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | ✓ | > [accordion] Provider-specific limitations > > ¹ Single-container tasks only (not in Docker Compose mode).\\ > > ² Docker Compose (multi-container) tasks only.\\ > > ³ Docker and Podman support requires Linux containers; Windows containers do not support this network policy mode.\\ > > ⁴ Docker and Podman support requires Linux containers and local runtime support for the nftables kernel features used by Harbor's egress-control sidecar.\\ > > ⁵ Beam resolves concrete hostnames to IP CIDRs before applying the policy; wildcard host entries are not supported.\\ > > ⁶ TensorLake allowlists accept exact hostnames, leading-wildcard hostnames (SDK 0.5.110+; a wildcard matches subdomains at any depth but not the apex domain), IPv4 literals, and IPv4 CIDR ranges, but not IPv6 targets.\\ > > ⁷ Vercel allowlists are available for single-container tasks only. They match domain rules on the TLS SNI, accept exact and leading-wildcard hostnames but not IP literals or CIDR ranges, and deny plain-text HTTP to an allowlisted host. The policy applies from sandbox creation and can be updated on a running sandbox. Compose tasks support `public` and `no-network` only.\\ > > ⁸ Islo supports dynamic network policy only when no custom gateway profile or gateway configuration is supplied.\\ > > ⁹ SBX allowlists and runtime policy changes require `target=cloud`. Local SBX supports static `no-network` only.\\ > > ¹⁰ See [Modal Compose](#modal-compose) for runtime requirements and startup restrictions. If a task requests a network mode the environment does not declare a capability for, Harbor rejects the trial at validation time rather than running with a weaker policy. ## Modal Compose Modal supports network allowlists and runtime policy changes for single-container tasks and Docker Compose tasks. Compose tasks without GPUs default to VM; GPU tasks and single-container tasks retain the gVisor default. Explicit `--ek modal_vm_runtime=true` or `false` overrides runtime selection, but VM does not support GPUs. The outer sandbox enforces egress policy for all Compose services while internal connectivity remains available. The startup policy also applies to Docker image pulls and build downloads: allow required destinations during preparation, then use `[agent]` and `[verifier]` overrides to restrict later phases. Harbor does not temporarily widen a restricted startup policy. ## Built-in web tools Built-in web tools that provide server-side access can be disabled via the `no-network` and `allowlist` network policy options. Explicitly setting the agent option `disable_web_search` to `true` or `false` overrides this default. A `public` network policy preserves configured tool settings. This behavior also applies to both agents in simulated-user trials over ACP. See [agent capabilities](/agents/pre-integrated-agents#agent-capabilities) for supported agents. Other agents log an error when asked to disable web tools and continue with their existing tool behavior. Sandbox network restrictions apply independently. Enabling web tools does not allow blocked sandbox connections; provider-hosted searches may run outside the sandbox. Arbitrary MCP tools are not covered by this option. ## Why phases? Often, task authors want to enforce different network policies for the agent (or verifier), but do not want those policies enforced when setting up an agent in the environment. For example, you may want to be able to install Claude Code into the environment but then turn off all network access except for Anthropic's API during the rollout. ## Support Environment implementations declare whether they support network policy configuration at start time and during runtime. Configuration at start time is more widely supported than during runtime, however, support is growing for both. # Overview Source: https://docs.harborframework.com/tasks/overview A Harbor task is an instruction, environment, and test script. A Harbor task is an instruction, environment, and test script. The task is defined as a directory of files with the following structure: ```bash theme={"system"} my-task/ ├── instruction.md ├── task.toml ├── environment/ │ ├── Dockerfile # or some other spec │ └── ... ├── solution/ │ ├── solve.sh │ └── ... └── tests/ ├── test.sh └── ... ``` Environments can be defined using any spec, as long as the consumer of the task (e.g. Harbor framework) supports it. Popular specs include `Dockerfile`, `docker-compose.yaml` (for multi-container environments), and `Apptainer.def` (for HPCs). ## Trials A Harbor trial is an agent's attempt at completing a task. The diagram below shows how the components of a task are used in a trial. ```mermaid theme={"system"} %%{init: {"flowchart": {"curve": "basis", "nodeSpacing": 60, "rankSpacing": 70}, "look": "handDrawn"}}%% flowchart LR Task -.-> SellShare[Share] Task[/Task/] --> Start[Start
Environment] Start --> C1[Environment] C1 --> C2[Environment] C2 --> Stop[Stop
Environment] C1 --> Agent[Agent] Agent --> C1 Agent --> Trajectory[/Trajectory/] C2 --> Verifier[Verifier] Verifier --> C2 Verifier --> Reward[/Reward/] Reward -.-> Evals[Aggregate
across eval] Reward -.-> Optimize[RL & context
optimization] Trajectory -.-> Optimize Trajectory -..-> SFT[SFT data &
failure analysis] ``` ## Rewards A task defines the logic to verify the completion of the instruction and produce a reward in the `tests/test.sh` script. The script must produce a numerical reward in the environment at `/logs/verifier/reward.txt` or `/logs/verifier/reward.json` (for multi-dimensional or labeled rewards). ## Independent, isolated, and reproducible Harbor tasks are independent, isolated, reproducible pieces of code. Harbor tasks have no dependency on the Harbor framework. They can easily be plugged into any framework that supports the Harbor format. However, the Harbor framework is a simple way to start running tasks at scale. Think of tasks like software packages that should be self-contained, verisioned, maintained, and developed over time. ## Task components * [`instruction.md`](/tasks/instruction) * [`task.toml`](/tasks/configuration) * [`environment/`](/tasks/environment) * [`solution/`](/tasks/solution) * [`tests/`](/tasks/verifier) ## Multi-step tasks Harbor tasks can be split into multiple steps, each with its own instruction, tests, and solution. Multi-step tasks are great for defining milestones in long-horizon tasks, testing continual learning methods like memory, and observing an agent's ability to build on its prior work. See [Multi-step](/tasks/multi-step) for a detailed overview. ```bash theme={"system"} my-task/ ├── task.toml ├── environment/ │ ├── Dockerfile # or some other spec │ └── ... ├── tests/ │ ├── helpers.py │ └── ... └── steps/ ├── step-1/ │ ├── instruction.md │ ├── tests/ │ │ ├── test.sh │ │ └── ... │ ├── solution/ │ │ ├── solve.sh │ │ └── ... │ └── workdir/ │ ├── setup.sh │ └── ... └── step-2/ └── ... ``` `Dockerfile` can be replaced with another supported environment spec. Shared grading utilities in `tests/helpers.py` and per-step `workdir/setup.sh` scripts are optional. Directories can contain additional supporting files. Each step's test script can use the shared utilities. A base `tests/test.sh` is also supported as a fallback for steps without their own test script; a step-specific `test.sh` overrides it. ## Local development files Add `.harborignore` inside `tests/` or `solution/`, including step directories, to exclude local files from sandbox uploads, publication, and content hashes. The ignore files themselves are also omitted. Patterns use Git ignore syntax, with paths relative to each ignore file. Nested rules can override parent rules, unless the entire parent directory is excluded. Ignore files outside tests and solution directories have no effect. For example, keep `expected.txt` using a nested ignore file: ```text theme={"system"} tests/ ├── .harborignore ├── test.sh └── fixtures/ ├── .harborignore ├── expected.txt └── draft.txt ``` > [card] > > > [tab] Incorrect > > > > ```gitignore title="tests/.harborignore" theme={"system"} > > /fixtures/ > > ``` > > > > ```gitignore title="tests/fixtures/.harborignore" theme={"system"} > > !expected.txt > > ``` > > > > Harbor skips `fixtures/` entirely, so the nested rule is never read. > > Both fixture files are excluded. > > > [tab] Correct > > > > ```gitignore title="tests/.harborignore" theme={"system"} > > /fixtures/*.txt > > ``` > > > > ```gitignore title="tests/fixtures/.harborignore" theme={"system"} > > !expected.txt > > ``` > > > > Harbor reads the nested rule and keeps `expected.txt`. Only `draft.txt` > > is excluded. Image builds use the builder's ignore rules, such as `.dockerignore`. Therefore, one should supply both `.dockerignore` and `.harborignore` for local development files when using separate verifiers. See the [runnable example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/hello-harborignore) for basic exclusions and nested rules. # Resources Source: https://docs.harborframework.com/tasks/resources Managing environment resources. Tasks declare resources in `task.toml`. Harbor applies CPU and memory using **enforcement policies**; storage, GPU, and TPU requests are passed through when the provider supports them. ## Task fields ```toml theme={"system"} [environment] cpus = 2 memory_mb = 4096 storage_mb = 10240 gpus = 1 gpu_types = ["H100", "A100"] [environment.tpu] # optional; GKE only type = "v6e" topology = "2x4" ``` | Field | Description | | - | - | | `cpus` | CPU count | | `memory_mb` | RAM in MB | | `storage_mb` | Ephemeral disk in MB | | `gpus` | GPU count | | `gpu_types` | Acceptable GPU types (optional) | | `tpu.type` | TPU accelerator type — alias (`v6e`, `trillium`, `v4`) or GKE label (`tpu-v6e-slice`) | | `tpu.topology` | TPU topology as `NxM` or `NxMxK` (required; chip count = product of dimensions) | All fields are optional. Omitted fields use the provider's default sizing. [Separate verifier sandboxes](/tasks/separate-verifier) can set their own values under `[verifier.environment]`. ## Enforcement policies CPU and memory each get an independent policy. Set them via `--cpus` / `--memory`, or `cpu_enforcement_policy` / `memory_enforcement_policy` in job or trial config. | Policy | Meaning | Requires `cpus` / `memory_mb`? | | - | - | - | | `auto` | Use the provider's default mode | No | | `limit` | Hard ceiling only | Yes | | `request` | Reservation only, no ceiling | Yes | | `guarantee` | Both reservation and hard ceiling | Yes | | `ignore` | Do not pass the value to the provider | No | > [tab] CLI > > ```bash theme={"system"} > harbor run -p "" -m "" -a "" \ > -e docker --cpus limit --memory guarantee > ``` > [tab] Config > > ```yaml theme={"system"} > environment: > type: docker > cpu_enforcement_policy: limit > memory_enforcement_policy: auto > ``` You can override resource values at runtime: > [tab] CLI > > ```bash theme={"system"} > harbor run -p "" -m "" -a "" \ > --override-cpus 4 \ > --override-memory-mb 8192 \ > --override-storage-mb 20480 \ > --override-tpu v6e=2x4 > ``` > [tab] Config > > ```yaml theme={"system"} > environment: > override_cpus: 4 > override_memory_mb: 8192 > override_storage_mb: 20480 > override_tpu: > type: v6e > topology: 2x4 > ``` ## Provider support Harbor validates policies at the start of a job. Unsupported combinations fail before trials run. `limit` and `guarantee` require limit support; `request` and `guarantee` require request support. Storage, GPUs, and TPUs do not have enforcement policies. Harbor passes their declared values to providers that support them. | Capability | Environments | | - | - | | CPU and memory limits | `apple-container`, `cwsandbox`, `docker`, `ec2`, `gke`, `modal`, `opensandbox`, `openshift`, `podman`, `skypilot`, `runta`, `prime`, `sbx`, `superserve` | | Fractional CPUs (e.g. `0.5`) | `docker`, `gke`, `modal`, `openshift`, `podman`, `beam`, `opensandbox` | | CPU requests | `beam`, `cwsandbox`, `daytona`, `e2b`, `gke`, `hyperbrowser`, `islo`, `modal`, `novita`, `openshift`, `runloop`, `skypilot`, `tensorlake`, `vercel`, `runta`, `sail`, `superserve` | | Memory requests | `beam`, `blaxel`, `cwsandbox`, `daytona`, `e2b`, `gke`, `hyperbrowser`, `islo`, `modal`, `novita`, `openshift`, `runloop`, `skypilot`, `tensorlake`, `vercel`, `runta`, `sail`, `superserve` | | Storage sizing | `ack`, `daytona`, `gke`, `hyperbrowser`, `islo`, `langsmith`, `runloop`, `runta`, `tensorlake`, `use-computer`, `prime`, `sail`, `superserve` | | GPU allocation | `beam`, `daytona`, `gke`, `modal`, `opensandbox`, `prime`, `docker` | | TPU allocation | `gke` | ## Validation | Check | When | | - | - | | Policy vs provider | Job creation | | Missing value for non-`auto`/`ignore` policy | Environment start | | GPU / TPU / internet requirements | Environment start | | GPU and TPU both set (GKE) | Environment start | # Separate verifier Source: https://docs.harborframework.com/tasks/separate-verifier Run verification in a separate environment. > [!NOTE] > > Tasks created with `harbor task init` or `harbor init --task` configure separate > verification. Omitting both `verifier.environment_mode` and > `[verifier.environment]` uses shared verification. Running the verifier in a separate container is useful for isolated grading. This can improve the security boundary between the agent and the verifier and allow you to pre-install dependencies into the verifier image and build it ahead of time, which can reduce installation flakiness and speed up the verifier phase. It also enables [trial regrading](/jobs/regrade). Pass agent outputs through [artifacts](#artifact-transfer). To opt into shared verification, set `environment_mode = "shared"` under `[verifier]`, omit `[verifier.environment]`, and install verifier dependencies in the agent image. ## Configuration There are two ways to configure a separate verifier environment: 1. Set `environment_mode = "separate"` under `[verifier]` in `task.toml`. 2. Add `[verifier.environment]` to `task.toml`. ### Option 1: Reuse the agent's environment configuration Set `environment_mode = "separate"` under `[verifier]`: ```toml theme={"system"} [environment] docker_image = "some/image:latest" cpus = 2 memory_mb = 1024 [verifier] environment_mode = "separate" ``` Without a verifier-specific image or build definition, Harbor starts a fresh copy of the agent environment and uploads `tests/` to `/tests/`. The agent's filesystem changes are not inherited. ### Option 2: Use a verifier-specific environment Add `[verifier.environment]` to use a different image or resources. This implicitly enables separate mode: ```toml theme={"system"} [verifier.environment] docker_image = "my-org/grading-image:latest" cpus = 2 memory_mb = 1024 ``` This uses the same schema as `[environment]`, including [network policy](/tasks/network-policies). It cannot be combined with `environment_mode = "shared"`. ### Mode resolution Existing tasks that omit both `verifier.environment_mode` and `verifier.environment` continue to use shared verification. | `environment_mode` | `[verifier.environment]` | Result | | - | - | - | | omitted | omitted | `"shared"` | | omitted | present | `"separate"` | | `"shared"` | omitted | `"shared"` | | `"shared"` | present | **validation error** | | `"separate"` | omitted | `"separate"` (copy of top-level `[environment]`) | | `"separate"` | present | `"separate"` (verifier-specific env) | ## Image selection Harbor selects the first available definition: | Priority | Definition | Tests | | - | - | - | | 1 | `[verifier.environment].docker_image` | Must be baked into the image. | | 2 | `tests/Dockerfile` (or `tests/docker-compose.yaml`) | Must be baked into the image. | | 3 | `[environment].docker_image` | Uploaded from `tests/` to `/tests/`. | | 4 | `environment/Dockerfile` (or `environment/docker-compose.yaml`) | Uploaded from `tests/` to `/tests/`. | Resource settings come from `[verifier.environment]` when provided, otherwise `[environment]`. An inherited agent image never overrides a verifier build definition. ### Dedicated verifier image New tasks include `tests/Dockerfile` for dependencies and bundled tests (one per step for multi-step tasks). Keep `test.sh` focused on running tests and writing rewards. To reuse the agent environment definition, remove the verifier Dockerfile and install verifier dependencies in the agent image. Dedicated verifier images must provide `/tests/test.sh` (or `/tests/test.bat` on Windows). Harbor does not upload tests into these images at runtime. ```bash theme={"system"} my-task/ ├── task.toml ├── instruction.md ├── environment/ │ └── Dockerfile # agent environment └── tests/ ├── Dockerfile # verifier image ├── test.sh └── grader.py ``` For example, `tests/Dockerfile` can bundle the grading files: ```dockerfile theme={"system"} FROM ubuntu:24.04 WORKDIR /app COPY . /tests/ ``` Use `.dockerignore` for build exclusions; [`.harborignore`](/tasks/overview#local-development-files) filters uploads and publication. ## Artifact transfer When a separate verifier runs, Harbor copies into the verifier env: * `/logs/artifacts/` (agent publish directory) * Paths listed in task-, trial-, and step-level `artifacts` fields Artifacts are uploaded to their original `source` paths in the verifier environment, not their host `destination` paths. For example, `{ source = "/app/report.json", destination = "report.json" }` is restored to `/app/report.json` in the verifier; `destination` only controls where it is saved on the host. See [Artifacts](/tasks/artifacts). `/logs/agent/` and `/logs/verifier/` are not copied unless declared as artifacts — e.g. trajectory grading: ```toml theme={"system"} artifacts = ["/logs/agent/trajectory.json"] ``` ### Sanitize artifacts If artifacts were uploaded unchanged, an agent could cheat the verifier: * **Setuid binary:** the agent ships a setuid program. Uploaded as root, it runs as root when the verifier executes it and writes its own `/logs/verifier/reward.json`. * **Symlink:** the agent makes `/app/output.png` a symlink to `/tests/solution.png`, so the verifier compares the reference solution against itself. Harbor blocks both. In every environment, each artifact takes the same path: Harbor packs it into a tar archive, extracts it with Python's [`data` filter](https://docs.python.org/3/library/tarfile.html#tarfile.data_filter), and uploads the result. The filter clears setuid/setgid bits, skips special files and symlinks that point outside the artifact, and normalizes permissions. Skipped entries are logged as a warning. Artifact contents are still untrusted input. ## Multi-step tasks Each step can override verifier mode under `[steps.verifier]`. Mixed shared/separate per step is supported: ```toml theme={"system"} [[steps]] name = "build" # Inherits task-level mode; shared in this example because it is omitted. [[steps]] name = "grade" [steps.verifier.environment] docker_image = "my-org/grading-image:latest" ``` Resolution: `[steps.verifier].environment_mode` when set; else `[steps.verifier.environment]` present implies `"separate"`; else trial-level. Network rules: [Network policies](/tasks/network-policies). Image precedence is step image, step tests build definition, task verifier image, task tests build definition, then agent environment. A step `tests/` directory without a build definition does not override a task verifier image. With the agent-environment fallback, Harbor uploads base tests, then overlays step tests. Tests are validated against each step's **effective** verifier OS, so a Linux agent can be graded on Windows (and vice versa) when the matching `test.sh` / `test.bat` exists. # Skills Source: https://docs.harborframework.com/tasks/skills Bundle reusable agent instructions with a task. A task can include skills in its environment so every agent running the task receives the same instructions and reference files. Each skill is a directory containing a `SKILL.md` file. ## Add skills to a task Place the skills in the environment build context: ```bash theme={"system"} my-task/ ├── task.toml └── environment/ ├── Dockerfile └── skills/ └── / ├── SKILL.md └── ... ``` Copy them into the image: ```dockerfile title="environment/Dockerfile" theme={"system"} FROM COPY skills/ /skills/ ``` Then point `environment.skills_dir` to that sandbox directory: ```toml title="task.toml" theme={"system"} [environment] skills_dir = "/skills" ``` Use an absolute sandbox path. This is required when task skills are combined with skills supplied at job runtime. ## How Harbor passes task skills Harbor does not upload the task's skill files separately: they already exist in the built or prebuilt environment at `environment.skills_dir`. Before creating the agent, Harbor passes that path to the agent integration as `skills_dir`. Compatible pre-integrated agents then copy or register the skills in their native configuration directory. A custom agent receives `skills_dir` in its constructor and should use it during `setup()` or `run()`. The path remains available in the sandbox as well. > [!NOTE] > > Setting `environment.skills_dir` does not copy files into the environment. Ensure the directory exists in the built or prebuilt image. ## Combine task and job skills [Job-provided skills](/jobs/skills) are uploaded into the task's `environment.skills_dir`, so the agent receives both sources through one directory. A job-provided skill replaces a bundled skill with the same directory name for that trial. If the task does not declare `environment.skills_dir`, job-provided skills use `/runtime/skills`. # Solution Source: https://docs.harborframework.com/tasks/solution Task solutions. The **`solution/`** folder is **optional**. It holds a reference script used by the oracle agent to sanity-check that a task is solvable. Solutions often help when debugging tasks or sandbox integrations. ## Required script | OS | File | | - | - | | Linux | `solution/solve.sh` | | Windows | `solution/solve.bat` | Harbor chooses the extension from `[environment].os` in [task.toml](/tasks/configuration). Additional files (scripts, data) are allowed. At runtime Harbor copies the folder to `/solution` and runs the solve script from the task working directory. ## When to include a solution * **Recommended** while authoring tasks — run `harbor run` with the Oracle agent to verify the task is solvable. * **Optional** for published benchmarks — omit if you do not want a public reference implementation. Without `solution/`, the Oracle agent cannot run. ## Configuration ```toml title="task.toml" theme={"system"} [solution] env = { API_KEY = "sk-test-123" } ``` Variables are applied when the Oracle executes `solve.sh`. ## Multiple solutions Use `--ae` to pass an environment variable, then choose an implementation in `solution/solve.sh`. **You choose the variable name and write the selection logic in `solve.sh`, so you can support as many solutions as you need.** It can run `solve2.sh`, `solution2/solve.sh`, a Python script, or any other implementation. Harbor copies the entire `solution/` directory, so implementations can share helpers or use separate supporting files. The [hello-world-multiple-solutions example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/hello-world-multiple-solutions) uses `SOLUTION` to select a second correct solution. From the repository root: ```bash theme={"system"} uv run harbor run -p examples/tasks/hello-world-multiple-solutions -a oracle \ --ae SOLUTION=2 ``` Omit `--ae` to run the original solution. Both should receive reward `1`. `SOLUTION` is just this example's choice, not a special Harbor variable. Avoid setting the same variable in `[solution.env]`, which takes precedence over `--ae`. # Verifier Source: https://docs.harborframework.com/tasks/verifier Task verification. The `tests/test.sh` script is the entrypoint for the verifier. Harbor uploads `tests/` to `/tests/` after the agent runs, unless a [dedicated verifier image or build definition](#separate-verifier-environment) provides the tests. `tests/test.sh` is executed in the task's working directory and is responsible for verifying the task's completion. It must produce a numerical reward at `/logs/verifier/reward.txt` or `/logs/verifier/reward.json`. ## Required script | OS | File | | - | - | | Linux | `tests/test.sh` | | Windows | `tests/test.bat` | Install test dependencies in `tests/Dockerfile` (or the agent image for shared verification). The script should: 1. Verify that the agent satisfied the [instruction](/tasks/instruction) 2. Write a **reward** under `/logs/verifier/` We recommend using **absolute paths** inside the script to avoid `cwd` surprises. ## Reward files | File | Format | | - | - | | `/logs/verifier/reward.json` | JSON key-value object of labeled numeric metrics | | `/logs/verifier/reward.txt` | Single number, usually `1` or `0` | If both are present, Harbor prefers `reward.json`. ### Example ```bash title="tests/test.sh" theme={"system"} #!/bin/bash set -euo pipefail if pytest /tests/test_outputs.py; then echo 1 > /logs/verifier/reward.txt else echo 0 > /logs/verifier/reward.txt fi ``` For multi-metric or LLM-based grading, consider using [RewardKit](/rewardkit/quick-start) or writing a structured `reward.json` file. ## Separate verifier environment Tasks created with `harbor task init` or `harbor init --task` configure a separate sandbox for verification. Omitting both `verifier.environment_mode` and `[verifier.environment]` uses shared verification. To opt into shared verification, set `environment_mode = "shared"` under `[verifier]` in `task.toml`, omit `[verifier.environment]`, and install verifier dependencies in the agent image. Harbor prefers `[verifier.environment].docker_image`, then a build definition in `tests/` (`Dockerfile` or `docker-compose.yaml`), over the agent environment. These dedicated verifier images must include `/tests/test.sh` or `/tests/test.bat`; Harbor does not upload tests into them at runtime. Without a dedicated verifier image or build definition, Harbor starts a fresh copy of the agent environment and uploads `tests/` to `/tests/`. The agent's filesystem changes are not inherited. For multi-step tasks, step verifier definitions take precedence over task-level definitions. Declare [artifacts](/tasks/artifacts) in the top-level `artifacts` list in `task.toml`, before any section headers. Harbor collects them before verification and copies them into the separate verifier sandbox at their original source paths. See [Separate verifier](/tasks/separate-verifier) for more details. ### Example ```toml title="task.toml" theme={"system"} [verifier] environment_mode = "separate" [verifier.environment] cpus = 2 ``` ```dockerfile title="tests/Dockerfile" theme={"system"} FROM python:3.12-slim COPY --from=ghcr.io/astral-sh/uv:0.9.7 /uv /usr/local/bin/uv RUN uv pip install --system pytest==8.4.1 pytest-json-ctrf==0.3.5 WORKDIR /app COPY . /tests/ ``` ## Regrading Harbor can rerun verifiers for existing trials if the task uses a separate verifier environment. This is useful when iterating on a verifier. See [Regrade](/jobs/regrade) for details. ## Passing environment variables to the verifier Environment variables can be passed to the verifier using the `[verifier.env]` section in `task.toml`. ```toml title="task.toml" theme={"system"} [verifier.env] ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}" MODEL_NAME = "claude-haiku-4-5" ``` The `${VAR}` syntax is used to read from the host environment. Harbor will ask the user to confirm before passing the environment variables to the verifier. ## LLM- or agent-as-a-judge Task authors can implement `test.sh` to use whatever verification approach they like, including LLM- or agent-as-a-judge. To avoid boilerplate, consider using [RewardKit](/rewardkit/quick-start) to define your judge or programmatic criteria. ## `rewardkit` The Harbor team maintains a package called [`harbor-rewardkit`](/rewardkit/quick-start). It is the easiest way to define and run common verifiers, including programmatic criteria and LLM- or agent-as-a-judge. # Usage stats Source: https://docs.harborframework.com/telemetry/telemetry What Harbor collects and how to opt out. Harbor collects limited usage telemetry to improve reliability and prioritize development. It is enabled by default. ## Collected data Harbor sends two events: | Event | Data | | - | - | | `harbor.command_finished` | Runtime and platform, install and launch source, detected AI-agent label, command path, flag names, outcome, duration, and job IDs | | `harbor.job_finished` | Job ID, agents and models, environment and resources, task and trial counts, enabled features, public sources, outcome, token usage, cost, duration, and reward | ## Not collected * Raw commands or job configuration * Local paths, private repository names, or custom registry locations * Task instructions, prompts, or local task names * Environment variables, agent or environment kwargs, or MCP configuration * Artifact paths * Exception messages or tracebacks * Usernames, emails, or account identities ## Identity and delivery Harbor creates a random installation ID in the user configuration directory. It is not derived from account or machine identity. Events are sent to PostHog by a detached process after the command returns. Failed deliveries are dropped. Person profiles and GeoIP processing are disabled. ## Opt out ```bash theme={"system"} HARBOR_TELEMETRY=off harbor run ... ``` # Create a task Source: https://docs.harborframework.com/tutorials/create-a-task Create a task documentation for Harbor. ## Step 0: Install Harbor Follow our [installation instructions](/getting-started/installation) to install Harbor, which involves installing the package and its dependencies. ## Step 1: Create your task Now that Harbor is installed, run the following command to create a new task directory with the required files: ```bash theme={"system"} harbor task init ssh-key-pair ``` This will generate a task directory with the following structure: ```bash theme={"system"} ssh-key-pair/ ├── instruction.md # Task instructions ├── task.toml # Configuration and metadata ├── environment/ │ └── Dockerfile # Container definition ├── solution/ │ └── solve.sh # Solution script └── tests/ │── test_outputs.py # Pytest unit tests └── test.sh # Test verification script ``` ## Step 2: Write the task instructions Open the `instruction.md` file in your task directory and add the task description: ```markdown title="ssh-key-pair/instruction.md" theme={"system"} # SSH Key Pair Generation Generate an SSH key pair in the files `~/.ssh/id_rsa` and `~/.ssh/id_rsa.pub`. Don't make them password protected. ``` ## Step 3: Configure task metadata Open the `task.toml` file and configure your task metadata: ```toml title="ssh-key-pair/task.toml" theme={"system"} version = "1.0" [metadata] author_name = "Your Name" author_email = "your.email@example.com" difficulty_explanation = "Simple SSH key generation command" category = "system-administration" tags = ["ssh", "cryptography", "linux"] [verifier] timeout_sec = 120.0 [agent] timeout_sec = 120.0 [environment] build_timeout_sec = 600.0 ``` Add `os = "windows"` here to target Windows containers; the default is `"linux"`. Add `cpus`, `memory_mb`, `storage_mb`, or `gpus` when the task needs explicit resources. ## Step 4: Create the task environment Open the Dockerfile in the `environment/` directory that was generated: ```dockerfile title="ssh-key-pair/environment/Dockerfile" theme={"system"} FROM ubuntu:24.04 # Create working directory WORKDIR /app # Install openssh-client for the task RUN apt-get update && apt-get install -y openssh-client && rm -rf /var/lib/apt/lists/* ``` This Dockerfile defines the environment an agent will interact with through the terminal. Add any dependencies your task requires here. ## Step 5: Test your solution idea Before writing the automated solution, you'll want to manually verify your approach works. Build and run the container interactively: ```bash theme={"system"} harbor task start-env -p ssh-key-pair -e docker -a -i # or use daytona or modal ``` Inside the container, test that the following command solves the task without requiring interactive input: ```bash theme={"system"} ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" ``` Verify the keys were created correctly: ```bash theme={"system"} ls -l ~/.ssh/id_rsa* ``` You should see: ``` ~/.ssh/ ├── id_rsa (-rw------- 600 private key) └── id_rsa.pub (-rw-r--r-- 644 public key) ``` Exit the container with `exit` or `Ctrl+D`. ## Step 6: Write the solution script Take the command you verified in the previous step and create the solution script. This file will be used by the Oracle agent to ensure the task is solvable. Update the `solution/solve.sh` file: ```bash title="ssh-key-pair/solution/solve.sh" theme={"system"} #!/bin/bash ssh-keygen -t rsa -f ~/.ssh/id_rsa -N "" ``` Make sure the script is executable: ```bash theme={"system"} chmod +x ssh-key-pair/solution/solve.sh ``` ## Step 7: Create the test script The test script verifies whether the agent successfully completed the task. It must produce a reward file in `/logs/verifier/`. This tutorial uses pytest for simplicity, but for multi-criterion verifiers, weighted scoring, or LLM-as-a-judge rubrics, consider using [RewardKit](/rewardkit/quick-start) instead. Update the `tests/test.sh` file: ```bash title="ssh-key-pair/tests/test.sh" theme={"system"} #!/bin/bash apt-get update apt-get install -y curl curl -LsSf https://astral.sh/uv/0.9.5/install.sh | sh source $HOME/.local/bin/env # Run pytest tests uvx \ --python 3.12 \ --with pytest==8.4.1 \ pytest /tests/test_outputs.py # Check exit code and write reward if [ $? -eq 0 ]; then echo 1 > /logs/verifier/reward.txt else echo 0 > /logs/verifier/reward.txt fi ``` Now create the Python test file: ```python title="ssh-key-pair/tests/test_outputs.py" theme={"system"} import os from pathlib import Path def test_key_files_exist() -> None: """Test that both private and public key files exist.""" private_key = Path.home() / ".ssh" / "id_rsa" public_key = Path.home() / ".ssh" / "id_rsa.pub" assert private_key.exists(), "Private key file does not exist" assert public_key.exists(), "Public key file does not exist" def test_key_file_permissions() -> None: """Test that the key files have correct permissions.""" private_key = Path.home() / ".ssh" / "id_rsa" public_key = Path.home() / ".ssh" / "id_rsa.pub" private_perms = oct(os.stat(private_key).st_mode)[-3:] public_perms = oct(os.stat(public_key).st_mode)[-3:] assert private_perms == "600", ( f"Private key has incorrect permissions: {private_perms}" ) assert public_perms == "644", ( f"Public key has incorrect permissions: {public_perms}" ) def test_key_format() -> None: """Test that the public key has the correct RSA format.""" public_key = Path.home() / ".ssh" / "id_rsa.pub" with open(public_key, 'r') as f: content = f.read() assert content.startswith("ssh-rsa "), "Public key does not start with 'ssh-rsa'" assert len(content.split()) >= 2, "Public key format is invalid" ``` ## Step 8: Test your task with the Oracle agent Run the following command to verify your task is solved by the solution script: ```bash theme={"system"} harbor run -p ssh-key-pair -a oracle ``` If successful, you should see output indicating the task was completed and the reward was 1. **Troubleshooting** If the Oracle agent fails, check: * The solution script has execute permissions * The Dockerfile installs all required dependencies * The test script correctly writes to `/logs/verifier/reward.txt` * The paths in your tests match the paths in your solution ## Step 9 (Optional): Test with a real agent Test your task with an actual AI agent to see if it can solve the task. For example, using Claude-Code with Haiku: ```bash theme={"system"} harbor run \ -p ssh-key-pair \ -a claude-code \ -m anthropic/claude-haiku-4-5 ``` ## Step 10 (Optional): Inspect the output in the viewer Launch the viewer to browse the run's trajectory, verifier logs, and artifacts: ```bash theme={"system"} harbor view ./jobs ``` Open the latest job, pick the `ssh-key-pair` trial, and check the **Verifier Logs** tab to see your pytest output and the final reward. The **Trajectory** tab walks you through each step the agent took — invaluable when debugging why a real agent fails the task. ## Step 11: Celebrate Congratulations! You've created your first Harbor task. Your task is now ready to be used for benchmarking AI agents! # Create a verifier with Rewardkit Source: https://docs.harborframework.com/tutorials/create-a-verifier-with-rewardkit Build a task whose verifier combines programmatic criteria, weights, and an optional LLM judge. This tutorial builds a small task and grades it with Rewardkit. The agent writes a text statistics module and an analysis script. The verifier scores `structure` and `correctness` separately and combines them into a main `reward`. The finished task is [reward-kit-example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/reward-kit-example) in the Harbor repository. ## Step 1: Create the task [Install Harbor](/getting-started/installation), then create a task directory: ```bash theme={"system"} harbor task init textstats ``` The finished task looks like this: ```bash theme={"system"} textstats/ ├── instruction.md ├── task.toml ├── environment/ │ ├── Dockerfile │ └── sample.txt ├── solution/ │ └── solve.sh └── tests/ ├── test.sh ├── criteria.py # shared custom criteria ├── reward.toml # main reward across dimensions ├── structure/ │ ├── files_exist.py │ ├── functions_defined.py │ └── reward.toml └── correctness/ ├── word_count.py ├── most_common.py ├── reward.toml └── pipeline/ └── pipeline_runs.py ``` ## Step 2: Write the instruction and environment ````markdown title="textstats/instruction.md" theme={"system"} Create a text statistics module and analysis script. 1. `/app/textstats.py` with `word_count(text: str) -> int` (words split by whitespace) and `most_common(text: str) -> str` (most frequent word, lowercase, empty string for empty input). 2. `/app/analyze.py`, which reads `/app/sample.txt` and writes `/app/results.json` as: ```json { "word_count": , "most_common": "" } ``` ```` The environment needs Python, `uv`, and the sample text: ```dockerfile title="textstats/environment/Dockerfile" theme={"system"} FROM ubuntu:24.04 COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/ WORKDIR /app COPY sample.txt /app/sample.txt ``` ```text title="textstats/environment/sample.txt" theme={"system"} the quick brown fox jumps over the lazy dog the dog barked at the fox the fox ran away quickly ``` Leave the generated `task.toml` as is. ## Step 3: Write the solution The Oracle agent runs this script to confirm the task is solvable: ```bash title="textstats/solution/solve.sh" theme={"system"} #!/bin/bash cat > /app/textstats.py << 'EOF' from collections import Counter def word_count(text: str) -> int: return len(text.split()) def most_common(text: str) -> str: words = text.lower().split() return Counter(words).most_common(1)[0][0] if words else "" EOF cat > /app/analyze.py << 'EOF' import json from pathlib import Path from textstats import most_common, word_count text = Path("sample.txt").read_text().strip() results = {"word_count": word_count(text), "most_common": most_common(text)} Path("results.json").write_text(json.dumps(results, indent=2)) EOF cd /app && uv run python analyze.py ``` ## Step 4: Run Rewardkit from the test script Harbor copies `tests/` to `/tests` and runs `test.sh`. The script only invokes Rewardkit, which discovers every criterion under `/tests`, runs it against `/app`, and writes `/logs/verifier/reward.json`: ```bash title="textstats/tests/test.sh" theme={"system"} #!/bin/bash uvx --python '>=3.12,<3.14' --from 'harbor-rewardkit==0.2.*' rewardkit /tests ``` ## Step 5: Add structure criteria Each subdirectory of `tests/` becomes one reward named after the directory, and each Python file inside it is one score named after the file. `structure` checks that the required files and functions exist, using [built-in criteria](/rewardkit/built-in-criteria). Paths are relative to `/app`: ```python title="textstats/tests/structure/files_exist.py" theme={"system"} from rewardkit import criteria criteria.file_exists("textstats.py") criteria.file_exists("analyze.py") criteria.file_exists("results.json") ``` ```python title="textstats/tests/structure/functions_defined.py" theme={"system"} from rewardkit import criteria criteria.file_contains("textstats.py", "def word_count") criteria.file_contains("textstats.py", "def most_common") ``` ## Step 6: Add correctness criteria Checking return values needs custom logic. Define it once at the tests root with `shared=True` so any dimension can call it. Returning a `float` gives partial credit: ```python title="textstats/tests/criteria.py" theme={"system"} import importlib.util from pathlib import Path from rewardkit import criterion def _load_module(workspace: Path, name: str): spec = importlib.util.spec_from_file_location(name, workspace / f"{name}.py") mod = importlib.util.module_from_spec(spec) spec.loader.exec_module(mod) return mod @criterion(shared=True) def word_count_correct(workspace: Path) -> float: try: mod = _load_module(workspace, "textstats") except Exception: return 0.0 cases = [("hello world", 2), ("one", 1), ("", 0), ("the quick brown fox", 4)] return sum(mod.word_count(t) == n for t, n in cases) / len(cases) @criterion(shared=True) def most_common_correct(workspace: Path) -> float: try: mod = _load_module(workspace, "textstats") except Exception: return 0.0 cases = [("the cat and the dog", "the"), ("hello hello world", "hello"), ("", "")] return sum(mod.most_common(t) == w for t, w in cases) / len(cases) ``` Call the shared criteria from `correctness`, one per file, and put the end-to-end pipeline check in a nested `pipeline/` group so it can be weighted separately: ```python title="textstats/tests/correctness/word_count.py" theme={"system"} from rewardkit import criteria criteria.word_count_correct() ``` ```python title="textstats/tests/correctness/most_common.py" theme={"system"} from rewardkit import criteria criteria.most_common_correct() ``` ```python title="textstats/tests/correctness/pipeline/pipeline_runs.py" theme={"system"} from rewardkit import criteria criteria.command_succeeds("python analyze.py") criteria.json_key_equals("results.json", "most_common", "the") ``` ## Step 7: Configure the scoring By default, the criteria in a Python file are averaged by weight, the files in a dimension count equally, and each dimension is written to `reward.json` on its own. Three `reward.toml` files adjust this. `structure` passes only when every file and function is present. `[scoring.]` configures the criteria within one Python file, and the unnamed `[[reward]]` combines the files: ```toml title="textstats/tests/structure/reward.toml" theme={"system"} [scoring.files_exist] aggregation = "all-pass" [scoring.functions_defined] aggregation = "all-pass" [[reward]] aggregation = "all-pass" ``` In `correctness`, the two function checks and the nested `pipeline` group are weighted by name: ```toml title="textstats/tests/correctness/reward.toml" theme={"system"} [[reward]] weights = { word_count = 3.0, most_common = 2.0, pipeline = 1.0 } ``` A root `reward.toml` adds the main `reward` that Harbor reads. It is `1.0` only when both dimensions score `1.0`: ```toml title="textstats/tests/reward.toml" theme={"system"} [[reward]] name = "reward" aggregation = "all-pass" ``` The verifier now writes: ```json title="/logs/verifier/reward.json" theme={"system"} { "correctness": 1.0, "structure": 1.0, "reward": 1.0 } ``` See [How scores are combined](/rewardkit/quick-start#how-scores-are-combined) for the aggregation modes. ## Step 8 (Optional): Add an LLM judge Add a `quality` dimension with a judge TOML and pass the API key through `task.toml`: ```toml title="textstats/tests/quality/quality.toml" theme={"system"} [judge] judge = "anthropic/claude-sonnet-5" files = ["/app/textstats.py", "/app/analyze.py"] [[criterion]] description = "Are the functions implemented in a clear and idiomatic way?" type = "binary" ``` ```toml title="textstats/task.toml" theme={"system"} [verifier.env] ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}" ``` `quality` becomes a fourth score, and the root `all-pass` aggregation includes it. The criterion is binary because `all-pass` needs a score of `1.0`, which a Likert judge rarely gives. See [Judge criteria](/rewardkit/judge-criteria) for agent judges and the full TOML reference. ## Step 9: Run and inspect Run the solution against the verifier, then open the viewer: ```bash theme={"system"} harbor run -p textstats -a oracle harbor view ./jobs ``` Every dimension should score 1. In the trial's **Verifier Logs** tab, the **Rewards** section renders `reward-details.json` as a tree with the score, weight, and any error per criterion. > [card] [reward-kit-example](https://github.com/harbor-framework/harbor/tree/main/examples/tasks/reward-kit-example) > > The complete task built in this tutorial.