rewardkit
Skill6.7k starsChanged 25 days agoApache-2.0View on GitHub
Write Harbor task verifiers using Reward Kit. Use when creating or editing a
- Reads credentials
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 5 are distinctive, and 7 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
7
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 14
Put criteria alongside test.sh in the task's tests/ directory:
- Very specific: line 32
If judge criteria need API keys, pass them through task.toml:
- Distinctive: line 38
Ask whether Reward Kit should run in the agent's shared environment or in a separate verifier environment.
- Very specific: line 72
Call built-ins from any .py file in tests/:
- Very specific: line 83
All criteria accept weight (default 1.0) and isolated (default False, runs in overlayfs so side effects don't leak).
- Very specific: line 102
Use the @criterion decorator.
- Distinctive: line 219
Only affects how this file's own criteria combine.
- Distinctive: line 260
Put criteria in subdirectories — each becomes a separate reward:
- Very specific: line 326
Put shared helpers (common checks.py functions with shared=True, fixture files, a fallback test.sh) at the task level, and step-specific …
- Very specific: line 340
Use
@criterion: when logic is task-specific but still programmatic. - Distinctive: line 342
Use agent judges: when the rubric requires exploring the filesystem or running code (e.g.
- Distinctive: line 344
Use subdirectories: when you want separate scores (correctness vs structure vs quality) rather than one blended number.
≈ “Common” is an estimate: at least 1 in 5 of the 308,232 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Help the user write task verifiers with Reward Kit. Reward Kit is a lightweight Python package that turns a directory of criteria files into a reward score. Each criterion is a Python function call or a TOML judge file; folders become separate rewards.
Setup in a Harbor task
Put criteria alongside test.sh in the task's tests/ directory:
tests/
├── test.sh
├── checks.py # programmatic criteria
└── judge.toml # optional LLM/agent judgetests/test.sh:
#!/bin/bash
uvx --python '>=3.12,<3.14' --from 'harbor-rewardkit==0.2.*' rewardkit /testsThis runs all criteria in /tests/ against the workspace at /app and writes
/logs/verifier/reward.json. Defaults match Harbor's conventions — no extra config needed.
If judge criteria need API keys, pass them through task.toml:
[verifier.env]
ANTHROPIC_API_KEY = "${ANTHROPIC_API_KEY}"Ask whether Reward Kit should run in the agent's shared environment or in a separate verifier environment. Prefer a separate verifier environment when judge prompts, grading dependencies, API keys, or clean-room checks should not be available to the agent:
[environment]
network_mode = "no-network" # Agent env baseline — offline during agent.run()
[verifier]
environment_mode = "separate"
[verifier.environment]
network_mode = "public" # Verifier env baseline — LLM judge API calls
docker_image = "python:3.12-slim"In shared mode, the verifier runs in the agent container and inherits
[environment].network_mode. Put [verifier].network_mode only when verify()
needs different network access than the agent phase (a phase override, not a
baseline). If agent and verifier need different baselines without runtime
switching, use environment_mode = "separate" and set
[verifier.environment].network_mode.
Judge criteria that call external APIs need a public baseline or allowlist on
the verifier environment. Programmatic checks that only read local files can use
no-network.
In separate mode, tests/ is the verifier image build context and must provide
/tests/test.sh at runtime; Harbor does not upload tests/ into the running
verifier container.
Programmatic criteria
Call built-ins from any .py file in tests/:
import rewardkit as rk
rk.file_exists("output.txt")
rk.file_contains("output.txt", "hello")
rk.command_succeeds("python main.py", weight=2.0)
rk.json_key_equals("result.json", "status", "ok")All criteria accept weight (default 1.0) and isolated (default False, runs in
overlayfs so side effects don't leak).
Available built-ins
- Files:
file_exists,file_not_exists,file_contains,file_contains_regex,file_matches,files_equal,diff_ratio - Commands:
command_succeeds,command_output_contains,command_output_matches,command_output_matches_regex(30s default timeout, optionalcwd) - Data:
json_key_equals,json_path_equals,csv_cell_equals,xlsx_cell_equals(needs[office]extra),sqlite_query_equals - HTTP:
http_status_equals,http_response_contains - Images:
image_similarity,image_size_equals(needs[image]extra) - Trajectory:
trajectory_tool_used,trajectory_tool_not_used,trajectory_turn_count
For extras, install with uv tool install harbor-rewardkit[all].
Custom criteria
Use the @criterion decorator. First parameter is always workspace: Path. Returns
bool, float, or a dict with score plus optional reasoning, confidence, and model:
from pathlib import Path
from rewardkit import criterion
@criterion
def has_valid_output(workspace: Path) -> bool:
return (workspace / "output.txt").read_text().strip() != ""Zero-parameter criteria auto-register. Criteria with extra args must be called via rk:
@criterion(description="output has at least {n} lines")
def has_n_lines(workspace: Path, n: int) -> bool:
return len((workspace / "output.txt").read_text().splitlines()) >= n
rk.has_n_lines(10, weight=2.0)
rk.has_n_lines(50, weight=1.0)For criteria shared across reward subdirs, define with shared=True in a root-level file
and call from subdirs.
Judge criteria (LLM or agent-as-a-judge)
For subjective checks (quality, readability, edge cases), create a TOML file:
[judge]
judge = "anthropic/claude-opus-5-5" # LiteLLM model string
files = ["/app/main.py"]
[[criterion]]
description = "Is the code correct?"
type = "binary"
[[criterion]]
description = "How readable is the code?"
type = "likert"
points = 5
weight = 2.0Criterion types:
binary— yes/no → 1.0 or 0.0likert— 1..points, normalized to [0, 1]numeric— min..max, normalized to [0, 1]rubric— 2 to 10 describedlevelsforming a scale from worst to best; position sets the score
Agent judges
Agent judges shell out to a CLI and can explore the filesystem:
[judge]
judge = "claude-code"
model = "anthropic/claude-opus-5-5"
isolated = true
[[criterion]]
description = "Does the solution handle edge cases?"
type = "binary"Slower and more expensive than LLM judges, but they can run commands and inspect files.
JEV judge
JEV is a new type of language model from TypeSafe. It answers each criterion with a probability or a rubric
score and returns no reasoning, so it is fast and cheap. It needs the jev extra
(harbor-rewardkit[jev]) and TYPESAFE_API_KEY.
[judge]
judge = "jev"
files = ["/app/answer.md"]
[[criterion]]
description = "Does the answer address the requested task?"
[[criterion]]
description = "How complete is the answer?"
type = "rubric"
levels = ["Omits the information", "Covers part of it", "Covers all of it"]Binary criteria pass at a probability of 0.5 or higher. Only binary and rubric criteria and
text files are supported; atif-trajectory and prompt_template are not.
The task image needs CA certificates (ca-certificates on Debian and Ubuntu), because the
TypeSafe SDK verifies TLS against the system trust store.
Useful [judge] options
timeout (default 300), reasoning_effort (low|medium|high for every LLM and agent judge, other levels depend on the judge; jev accepts none), reference (path to
reference solution), atif-trajectory (evaluate the agent's trajectory), weight,
prompt_template (custom prompt with {criteria} placeholder), samples (run the judge
N times and score each criterion with its median sample), guard (protects the judge
from instructions the agent wrote into the graded files; "flag" reports them under guard
in the details, "penalize" also scores a flagged submission 0), isolated (agent judges
only: read-only overlayfs copy of the workspace). More than one agent run in a task (several agent judges, samples above 1, or
individual mode with several criteria) requires isolated = true on each agent judge, which needs a separate verifier with fuse-overlayfs
and mount privileges; --yolo skips the check.
Scoring aggregation (within one judge TOML)
[scoring]
aggregation = "all-pass" # weighted-mean | weighted-sum | all-pass | any-pass | threshold | required-pass
threshold = 0.7 # only for thresholdall-pass, any-pass, and required-pass count a score as passing only when
it is 1.0, so a Likert or numeric criterion needs full marks.
Only affects how this file's own criteria combine. To aggregate across dimensions, see Aggregating dimensions.
Scoring config for programmatic files
Each .py file that registers criteria is an equal-weighted scoring component
named after its filename stem. Files that only provide imports or shared
criterion factories and register no checks are ignored. To change how criteria
within a file combine, use [scoring.<stem>] in the same directory's
reward.toml:
# tests/structure/reward.toml
[scoring.files_exist] # configures files_exist.py
aggregation = "all-pass"
[scoring.behavior] # configures behavior.py
aggregation = "threshold"
threshold = 0.75Each entry takes the same aggregation values as a judge TOML. Unknown keys and stems that do not resolve to a criterion-bearing Python file raise.
Directories may be nested recursively. A non-root directory can aggregate its
local Python files, local judges, and immediate child directories with one
unnamed [[reward]] table:
# tests/correctness/reward.toml
[[reward]]
aggregation = "weighted-mean"
weights = { files = 2.0, behavior = 1.0 }Membership is implicit. Child directories have weight 1.0 unless overridden;
use filename stems for local Python files and judge TOMLs, and directory names
for child groups. Without [[reward]], the directory defaults to weighted mean.
Multi-reward tasks
Put criteria in subdirectories — each becomes a separate reward:
tests/
├── test.sh
├── correctness/
│ └── check.py
├── structure/
│ └── files_exist.py
└── quality/
└── quality.tomlJudge TOMLs may also sit directly at the tests root alongside reward subdirectories. Each is exposed as a top-level reward named after its filename stem and can be referenced by a root aggregation.
Criterion-bearing Python files at the tests root are also top-level dimensions named after their stems. Root support files that register no criteria are ignored.
Produces:
{ "correctness": 0.75, "structure": 1.0, "quality": 0.6 }Aggregating dimensions
To add aggregated scores on top of the per-dimension keys, add a root-level
tests/reward.toml with one or more [[reward]] tables. Each adds one key to
reward.json, aggregating the dimensions with the same modes as [scoring]:
# tests/reward.toml
[[reward]]
name = "reward"
aggregation = "weighted-mean"
weights = { correctness = 2.0, quality = 1.0 }{ "correctness": 0.75, "structure": 1.0, "quality": 0.6, "reward": 0.775 }The per-dimension scores stay; aggregated keys are added alongside them (a
name may not collide with a dimension). Top-level dimensions have equal
weight unless that aggregation's inline map overrides them;
reward-details.json keeps the full recursive breakdown.
Output files
/logs/verifier/reward.json— per-reward scores/logs/verifier/reward-details.json— per-criterion results, judge reasoning, errors
Multi-step tasks
In a multi-step task, each step has its own tests/ under
steps/{name}/tests/, and the verifier runs once per step. Reward Kit behaves
the same as in a single-step task: for each step it reads /tests, runs the
criteria against /app, and writes /logs/verifier/reward.json for that step.
Harbor then aggregates per-step results into a trial-level reward via
multi_step_reward_strategy in task.toml — aggregation happens outside
Reward Kit, so don't try to encode cross-step logic in your criteria.
A task-level tests/ directory (at the task root) is uploaded to /tests
first, then the step's own tests/ is layered on top (same-name files win).
Put shared helpers (common checks.py functions with shared=True, fixture
files, a fallback test.sh) at the task level, and step-specific criteria
under each step.
Multi-reward subdirectories still work within a step: steps/foo/tests/
can contain correctness/, structure/, quality/ — each produces a
separate reward key for that step, and multi_step_reward_strategy = "mean"
averages each key across steps. Use "final" when the last step is an
end-to-end check whose rewards already represent the full task.
When to reach for what
- Use built-ins for file existence, string matches, command output, JSON/CSV checks, HTTP probes.
- Use
@criterionwhen logic is task-specific but still programmatic. - Use LLM judges for subjective quality dimensions (readability, correctness of prose).
- Use agent judges when the rubric requires exploring the filesystem or running code (e.g. "does the test suite actually pass?").
- Use subdirectories when you want separate scores (correctness vs structure vs quality) rather than one blended number.
- Use
isolated=Truefor any criterion that runs mutating commands, so it doesn't corrupt the workspace for other criteria.
Working example
See examples/tasks/reward-kit-example/ in the Harbor repo.
Trending
More talk lately.about the whole repository
Who's talking about laude-institute/harbor
- A Hacker News story“Harbor – a framework for evaluating and optimizing agents and language models”Hacker News · Nov 8, 2025 · 3 points
- harbor-framework/harbor“Multiple reward keys not supported”GitHub · Feb 16, 2026 · 2 reactions
- NovaSky-AI/SkyRL“[skyrl-train][Harbor] Upstream Harbor training code to main skyrl-train”GitHub · Jan 12, 2026 · 2 reactions
- harbor-framework/harbor-datasets“Add SpreadsheetBench dataset (400 tasks)”GitHub · Feb 22, 2026 · 1 reactions
- harbor-framework/harbor“why import environment variables in environment.env in examples/configs/*.yaml”GitHub · Jan 12, 2026 · 1 reactions
The biggest 5 of 38 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 38
Talked about on GitHub and Hacker News (38 times).
On GitHub · 37
- Feb 16, 2026Multiple reward keys not supported — harbor-framework/harbor2 reactions · 1 comment
- Jan 12, 2026[skyrl-train][Harbor] Upstream Harbor training code to main skyrl-train — NovaSky-AI/SkyRL2 reactions · 1 comment
- Feb 22, 2026Add SpreadsheetBench dataset (400 tasks) — harbor-framework/harbor-datasets1 reaction
- Jan 12, 2026why import environment variables in environment.env in examples/configs/*.yaml — harbor-framework/harbor1 reaction · 5 comments
- Nov 30, 2025Add Claude Code OAuth authentication documentation — harbor-framework/harbor-docs1 reaction · 1 comment
32 more on GitHub
- Oct 5, 2026Scout pitch: Resumable, seeded benchmark runs (per-item result files, resume flag, recorded seed) — 8gi-foundation/8gent-codesays it tested it0 reactions
- Sep 26, 2026Research input for 13/14 (souls, continuity, retention): reuse existing formats, and make "forget" cascade through derived memory — BharathChinthallapalli/Test-Waters0 reactions
- Sep 15, 2026Nothing measures whether our own skills help, so every subtraction decision is a vibe check — pmgledhill102/agentic-coding-config0 reactions · 1 comment
- Aug 15, 2026Eval infrastructure: measure whether a skill rewrite still routes — Lancetnik/slop-writer0 reactions
- Aug 7, 2026docs: per-plugin CLAUDE.md with the upstream docs and local specifics — walkerhughes/agents0 reactions
- Apr 29, 2026实验记录:Qwen3-8B run-3 (msp60ius) Phase 1 OOD 跑分 — base+4 ckpt × 66 task × 3 attempts (terminus-2 + harbor + sglang) — iter215 OOD 峰 vs iter279 回落 — HansBug/OpenClaw-RL0 reactions
- Apr 10, 2026Feature: Integrate PraisonAI Agents with Terminal-Bench 2.0 (Harbor Framework) — MervinPraison/PraisonAI0 reactions · 1 comment
- Mar 1, 2026Bedrock API key env var mismatch with LiteLLM (`AWS_BEARER_TOKEN_BEDROCK`) — harbor-framework/harbor0 reactions
- Feb 21, 2026[Harbor] Proper cleanup of Trials (especially address sandbox leakage) upon RL run fails / KeyboardInterrupt — NovaSky-AI/SkyRL0 reactions
- Feb 17, 2026[Ready For Review] multi-step checkpoint trial execution — harbor-framework/harbor0 reactions · 1 comment
- Feb 16, 2026Change asyncio.gather to TaskGroup in the Harbor generator to correctly propagate cancellation signals. — NovaSky-AI/SkyRL0 reactions · 6 comments
- Feb 12, 2026Sandboxes do not get terminated after Keyboard interruption during RL — harbor-framework/harbor0 reactions · 3 comments
- Feb 12, 2026Improve startup time with installed agents — harbor-framework/harbor0 reactions · 2 comments
- Feb 11, 2026Support MCP for all agents — harbor-framework/harbor0 reactions · 2 comments
- Feb 9, 2026Stored Object: paper:url.153C303C — chtmp223/papers-feed0 reactions · 1 comment
- Feb 5, 2026Bug: breaking change from `bash -ic` to `bash -lc` — harbor-framework/harbor0 reactions · 1 comment
- Feb 5, 2026TMUX is not compatible with the alpine image in docker — harbor-framework/harbor0 reactions · 1 comment
- Jan 20, 2026OpenRouter model names not working in Harbor 0.1.42 (`--model openrouter/anthropic/claude-sonnet-4.5`) — harbor-framework/harbor0 reactions
- Jan 17, 2026Failures in agent setup are silently discarded — harbor-framework/harbor0 reactions
- Jan 16, 2026Terminus 2 Agent Uses Logger Before Initialization When Model Provider is hosted_vllm — harbor-framework/harbor0 reactions · 1 comment
- Jan 10, 2026feat: Support Agent-Trajectory Interchange Format (ATIF) for trial trajectory capture — spachava753/rollout0 reactions
- Jan 10, 2026feat(evaluation): block web access and restrict LiteLLM tools during CRS run phase — sslab-gatech/CRSBench0 reactions · 4 comments
- Jan 6, 2026docker gpu support — harbor-framework/harbor0 reactions · 11 comments
- Dec 28, 2025BUG: where does 4096 come from? — harbor-framework/harbor0 reactions · 1 comment
- Dec 24, 2025Fix: Docker environment PATH inheritance on macOS — rotemtam/harbor0 reactions
- Dec 23, 2025Adapter runs unable to find docker — harbor-framework/harbor0 reactions · 2 comments
- Dec 17, 2025Trajectory viewer for non-linear history — harbor-framework/harbor0 reactions · 2 comments
- Dec 16, 2025environment.exec(): bash: cannot set terminal process group (-1): Not a tty bash: no job control in this shell — harbor-framework/harbor0 reactions · 3 comments
- Dec 16, 2025Deniz/dc agent updates 1215 — mlfoundations/SkyRL0 reactions
- Dec 10, 2025🚨 CRITICAL: Docker Compose project name validation bug breaks Oracle on custom_docker_compose tasks — harbor-framework/harbor0 reactions · 2 comments
- Nov 30, 2025Revert litellm hack once upstream fix is released — harbor-framework/harbor0 reactions · 2 comments
- Nov 24, 2025Feature Request: Harbor as a LLM proxy — harbor-framework/harbor0 reactions · 1 comment
On Hacker News · 1
Other versions3 projects use a version of this.
Word for word · 1
- Arize-ai/phoenix★ 12k100% same
Edited · 2
- harbor-framework/harbor★ 6.2k100% same
- cerbos/skills★ 497% same
Wrote their own version · 0
None found.
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository7 other files it gives its agents.
- AGENTS.mdAGENTS.md
- docs/AGENTS.mdAGENTS.md
- create-adapterSkill
- create-taskSkill
- harbor-execSkill
- publishSkill
- upload-parity-experimentsSkill
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
Reviews can't be read right now.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

