Run Harbor tasks
A Harbor task is a directory with task.toml, instruction.md, an
environment/ the agent works in, and tests/ holding the verifier that
writes a reward. Start every case in Vitest evals; write a
Harbor task only when the case needs its own container (system packages, the
workspace, the sandbox, services, an isolated verifier) or must run on a pushed
commit or deployed version. A case has one implementation, on one runner.
You need: Docker for local runs, or a deployed runtime and an owner or admin login for platform runs.
1. Install the adapter
introspection setup --target harbor2. Write the verifier
The verifier is RewardKit : each
folder in tests/ is one named score, either Python checks or a model judge,
and tests/reward.toml combines them into reward.
evals/refund-task/tests/
test.sh
reward.toml
refund_issued/check.py # deterministic check
reply/judge.toml # model-graded criteria#!/bin/bash
mkdir -p /logs/verifier
uvx --from 'harbor-rewardkit==0.1.*' --with 'introspection-harbor>=0.10.0' \
rewardkit /tests --workspace /opt/introspection/recipefrom pathlib import Path
from rewardkit import criterion
from introspection_harbor.verifier import load_trajectory, tool_calls
CALLS = tool_calls(load_trajectory())
@criterion(description="A refund was issued for order A-1042")
def refund_issued(workspace: Path) -> bool:
return any(
call["name"] == "issue_refund"
and call["arguments"].get("order_id") == "A-1042"
and not call["is_error"]
for call in CALLS
)[judge]
judge = "anthropic/claude-sonnet-4-6"
atif-trajectory = "/logs/agent/trajectory.json"
[[criterion]]
name = "confirms_refund"
description = "The final reply tells the customer that the refund for order A-1042 was issued."
[scoring]
aggregation = "all_pass"[[reward]]
name = "reward"
aggregation = "all_pass"reward is the case score; every other key is a named score. A multi-step
task puts each step’s instruction, tests/ and solution/ under
steps/<name>/ and lists the steps in task.toml:
multi_step_reward_strategy = "mean" # or "final": the last step's scores
[[steps]]
name = "request"
min_reward = 1.0 # skip later steps unless reward reaches 1
[[steps]]
name = "approve"Each trial’s verifier/ directory (per step, steps/<name>/verifier/) holds
reward.json, the scores Harbor records, and reward-details.json, which
gives each criterion’s value and the judge’s reasoning. Read the second to
see why a score is low.
3. Run on Introspection
Trials run in your runtime’s sandbox, against a commit you pushed. Commit and push first; the working tree is never evaluated.
git push
introspection eval run --runner harbor -p evals/refund-task \
--runtime support-agent --commit-sha <full-commit-sha> --trials 3git rev-parse HEAD prints the full SHA. -p is relative to the recipe.
Each trial uses the runtime’s image with the recipe replaced by your commit. Platform trials share an evaluation lane, one
at a time by default, apart from production tasks (Limits).
An owner or admin login can create trials; a member login can’t. A project API
key alone can’t start this run: --commit-sha resolves the runtime and
repository through your introspection login.
4. Or run locally
INTROSPECTION_HARBOR_ADAPTER=bootstrap introspection eval run --runner harbor -p evals/refund-taskbootstrap installs the CLI, Pi, and your recipe into whatever image the
task’s environment/ builds.
5. Read and compare results
introspection eval view
introspection eval compare <run-a> <run-b>
introspection eval baseline promote <run-id> # writes baseline.json in the suite directoryCI checks that the committed baseline still matches the suite
(introspection eval baseline check, no login or Docker needed). Recording a
baseline and comparing runs need a platform run, so CI cannot run the
regression gate for Harbor. Multi-step tasks compare per step.
Keep a baseline
Record the baseline on Introspection against a pushed commit, not with a local
bootstrap run: the two run different images, so never compare one with the
other. When a pull request changes a task, run its pushed commit, promote that
run, and commit baseline.json in the same pull request. A task’s fingerprint
covers only its own directory, so a change to a sidecar’s build context such as
fakes/, the runtime image, or the verifier package versions leaves the check
passing: promote a new baseline yourself and say so in the pull request.
Verify
introspection eval run ... --agent harbor:oracle scores 1 on every task: the
verifier accepts a correct solution. Then run your recipe agent.
Run options
| Flag | Effect |
|---|---|
--agent <name> | Run a recipe agent variant. harbor:oracle runs the task’s solution/; harbor:nop sends nothing. Use them to test the verifier. |
--trials N | N separate runs, each with its own run.json |
--retry-errors N | Rerun trials that failed on infrastructure (no model response, expired login, sandbox never ready), up to N times. Agent failures and low scores are never rerun. |
--fresh-steps | Start a new conversation at each step of a multi-step task. By default steps continue one conversation. |
Check MCP fakes in a verifier
A task can serve your MCP fakes as a sidecar on port 7353:
add a fakes service built from fakes/, whose image installs the committed
package-lock.json and runs eval-simulate serve, with EVAL_SIMULATE_SCENARIO set
to the task’s scenario, and bind each server to
http://fakes:7353/<server-id>/mcp. In the verifier,
introspection_harbor.verifier reads the trajectory (tool_calls, and
server_calls for one server’s calls under its own tool names) and
introspection_harbor.fakes reads each fake’s state (fake_state,
fake_initial_state) and checks it (load_manifests, state_changes,
write_attempts). With EVAL_SIMULATE_MANIFEST_DIR set, the sidecar also writes
each fake’s answers.json, which introspection_harbor.answers reads
(load_answers, read_result) to decode an answer as the fake’s contract
declares it. server_calls and introspection_harbor.answers need
introspection-harbor 0.11.0 or later.
Limits
| Not supported | Do this instead |
|---|---|
| Evaluating uncommitted changes on the platform | Push a branch and pass its SHA. |
--retry-errors with --from-conversation | Rerun failed trials separately. |
Or ask your agent: “Write a Harbor task for the refund flow and run it on support-agent against my pushed branch.”