Skip to content

Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.

25.0 KB
Raw Blame
---
title: "Custom Graders & Tasks"
description: "Bring your own grader (BYOG) or a complete native task (BYOT) when SkillEvaluator's default graders can't express what success means for your skill."
---

When your skill's success criteria can't be expressed by the default graders —
a domain-specific output format, a service that must end up in a particular
state, a scoring rule only you can define — you can bring your own grader, or
your own complete [Harbor](https://github.com/harbor-framework/harbor) task.
Harbor is the open-source agent evaluation framework that executes Tier 3
trials. Scaffolding is keyless and takes one command; running a custom-graded
evaluation needs the same Tier 3 stack as any live eval — see
[Tier 3: Live Agent Evaluation](/skills/skillevaluator/tier3-live-evaluation).

## Grading modes

Every live evaluation runs in one of three grading modes:

| Mode | What scores the run | Use when |
| --- | --- | --- |
| `default` | SkillEvaluator's standard graders — the five dimensions, Skill Lift, and pass@k | The standard graders express success for your skill |
| `default_plus_custom` | Standard grading runs first, then your grader adds domain-specific `custom_metrics` alongside it | You want the standard view **plus** your own checks — the safe extension point |
| `custom_only` | Your grader alone defines the score; the standard dimension rows stay visible but show `NO SCORE` | Success can only be measured by your own logic |

Set the mode with `--grading-mode` on `tier3 evaluate` (or on `validate`
together with `--tier3`), or persist it in `evals/config.yml`:

```yaml title="evals/config.yml"
schema_version: 1
grading:
  mode: default_plus_custom
```

CLI flags override the config file. The aliases `aces_default` and
`aces_plus_custom` are accepted — on the CLI and in `evals/config.yml` — as
spellings of `default` and `default_plus_custom`.

<Tip>
Skill Lift — including lift on your custom metrics — is computed from the
with-skill and without-skill arms. Don't pass `--skip-baseline` on runs whose
custom lift you want to keep.
</Tip>

## Bring your own grader (BYOG)

A BYOG grader is a single `evals/grader.py` (or `evals/grader.sh`) that
SkillEvaluator stages into every generated task container and runs after the agent
finishes.

<Steps>

### Scaffold the starter

```bash title="Create evals/grader.py with a working contract"
skillevaluator init-custom-grader ./my-skill
```

This writes an executable starter grader under `evals/`, creates a starter
`evals/evals.json` if none exists, and sets `grading.mode` in
`evals/config.yml`. Flags:

| Flag | Default | Effect |
| --- | --- | --- |
| `--mode` | `default_plus_custom` | Grading mode written to `evals/config.yml` (`default_plus_custom` or `custom_only`) |
| `--language` | `python` | Generate `grader.py` (`python`) or `grader.sh` (`shell`) |
| `--force` | off | Overwrite an existing top-level custom grader |
| `--no-config` | off | Only create the grader file; do not create or update `evals/config.yml` |

### Implement the contract

Edit `evals/grader.py`. The starter already reads the trajectory and eval
case, writes a well-formed reward, and documents the reserved metric names —
replace its placeholder logic with your real checks.

### Run with a custom grading mode

```bash title="Evaluate with default grading plus your custom metrics"
skillevaluator tier3 evaluate ./my-skill --agents codex --grading-mode default_plus_custom
```

With `evals/config.yml` in place from step 1, the `--grading-mode` flag is
optional — the config already selects it.

</Steps>

### The reward contract

`custom_only` still requires a numeric overall score. Qualitative reasons can
accompany it, but prose alone is not a reward. For a manual, evidence-linked
assessment alongside current scores, see the
[qualitative assessment review contract](/skills/skillevaluator/reports#qualitative-assessment-review-contract).
Its worksheet is a documentation prototype, not input to your grader or a
scoreless runtime mode.

Inside the container, your grader reads two inputs and writes one result:

1. **Read** `/logs/agent/trajectory.json` — the agent's trajectory.
2. **Read** `/tests/entry.json` — the eval case metadata (`id`, `prompt`,
   `expected_output`, and the rest).
3. **Write** `/logs/verifier/reward.json` — your scores, each in the range
   0.0–1.0 — and also write the overall score as plain text to
   `/logs/verifier/reward.txt` for compatibility. In `custom_only` mode, a
   numeric `overall` in `reward.json` or a numeric `reward.txt` is required.

```json title="/logs/verifier/reward.json"
{
  "overall": 0.85,
  "custom_metrics": {
    "custom_check": 0.85
  },
  "details": {
    "custom_check": {
      "score": 0.85,
      "reason": "Replace this with real custom grading logic."
    }
  }
}
```

<Note>
In `default_plus_custom` mode, put your scores under `custom_metrics`. Your
grader must not overwrite reserved standard or reward-metadata names. These
include `security`, `skill_execution`, `skill_efficiency`, `accuracy`,
`goal_accuracy`, `behavior_check`, `overall`, `metrics`, `custom_metrics`,
`custom_details`, `details`, `entry_id`, `metric_set`, `metric_set_version`,
`evaluation_status`, `evaluation_errors`, `has_skill`, `judge_contract`, `error`,
`trajectory_detail`, and `trajectory_source`. A collision fails grading.
</Note>

Keep each reward to at most 128 custom metrics, with no more than 256 UTF-8
bytes in each printable, whitespace-trimmed metric name. The union across all
rewards in one condition must also stay at or below 128 names. Exceeding these
limits fails the affected reward or condition before aggregation so the
machine-readable summary and HTML report cannot silently disagree. Names that
look like credential values or credential fields are omitted without creating
a colliding redaction alias; narrow metric-shaped names such as
`secret_handling` and `token_efficiency` remain supported.
Explicit custom-metric entries whose values are booleans, nonnumeric,
non-finite, or outside 0.0–1.0 are omitted consistently from the persisted
reward, aggregate, and report; they cannot contribute a score or consume the
128-name publication budget.

SkillEvaluator assigns each trial's case ID from the staged Harbor task, not
from an `entry_id` your grader writes. A trial whose staged identity is
missing or ambiguous is kept only as an unscored diagnostic, and that
condition's case coverage fails.

Rather than hard-coding the paths, read them from the `HARBOR_*` environment
variables and fall back to the defaults below when a variable is unset — the
starter grader already does. Harbor records the interaction history as the
[Agent Trajectory Interchange Format (ATIF)](https://www.harborframework.com/docs/agents/trajectory-format),
a standardized JSON trajectory:

| Variable | Default | Carries |
| --- | --- | --- |
| `HARBOR_ATIF_PATH` | `/logs/agent/trajectory.json` | ATIF agent trajectory to grade |
| `HARBOR_ENTRY_JSON` | `/tests/entry.json` | Eval case metadata |
| `HARBOR_REWARD_JSON` | `/logs/verifier/reward.json` | Where to write your scores |
| `HARBOR_REWARD_TXT` | `/logs/verifier/reward.txt` | Where to write the plain-text overall score |
| `HARBOR_LOGS_DIR` | `/logs` | Root of the log tree |
| `HARBOR_ARTIFACTS_DIR` | `/logs/artifacts` | Files to retain as trial artifacts |
| `HARBOR_TESTS_DIR` | `/tests` | Root of the staged test files |
| `HARBOR_GRADER` | `/tests/grader.py` | Where your staged grader runs from |

In local mode, these variables point to evaluator-owned host paths.
`HARBOR_LOGS_DIR/artifacts` and `HARBOR_ARTIFACTS_DIR` identify the same staging
directory. Local artifact declarations must select `/logs/artifacts` or a
specific log role such as `/logs/agent`; transferring the whole `/logs` tree
is unsupported and fails before changing the destination.
Role log directories retain their host locations, so use
`HARBOR_ARTIFACTS_DIR` or `HARBOR_LOGS_DIR/artifacts` for artifacts rather than
deriving a parent from a role directory or writing `../artifacts` from it.

Your grader reads Harbor's `trajectory.json` as written. Unlike the standard
grader, it does not [rebuild a missing or empty trajectory](/skills/skillevaluator/tier3-grading#the-graded-trajectory)
from agent logs, so handle that case explicitly. A step's `message` and an
observation result's `content` can each be a string or a list of content parts
(`text`, `image`, or `audio`), so read both forms.

## Bring your own task (BYOT)

BYOG replaces the scoring; BYOT replaces the whole task — instruction,
container environment, and grader — with a native Harbor task you own under
`evals/harbor/`.

```bash title="Scaffold a native Harbor task"
skillevaluator init-harbor-task ./my-skill
```

| Flag | Default | Effect |
| --- | --- | --- |
| `--case-id` | `case-001` | Harbor case directory name and eval entry id |
| `--mode` | `custom_only` | Grading mode (`default`, `default_plus_custom`, or `custom_only`) |
| `--language` | `python` | Grader language for the starter (`python` or `shell`) |
| `--with-config` | off | Create or update `evals/config.yml` for native Harbor mode |
| `--force` | off | Overwrite an existing starter case |

Exact defaults for both scaffolding commands are in the
[CLI Reference](/skills/skillevaluator/cli-reference#init-custom-grader).

The scaffold produces a complete, runnable task source:

<FileTree>
- evals/
  - harbor/
    - README.md
    - dataset.toml
    - case-001/
      - task.toml
      - instruction.md
      - environment/
        - Dockerfile
      - tests/
        - grader.py
        - test.sh
</FileTree>

Edit `instruction.md` for the agent-facing task, `environment/Dockerfile` for
the container, and `tests/grader.py` for the scoring — the same reward
contract as BYOG applies.

A `custom_only` task that keeps its own Harbor test script instead of
`tests/grader.py` runs that script unchanged, so the script must follow
Harbor's reward contract. Harbor 0.25 requires every top-level value in its
`reward.json` to be a number, for example
`{"overall": 1.0, "native_quality": 1.0}`; SkillEvaluator reports each numeric
key other than `overall` as a custom metric. Nested objects such as
`custom_metrics` or `details` make Harbor reject the reward with
`VerifierOutputParseError`, so use `tests/grader.py` when you need them.

Two rules keep BYOT predictable:

- **Case IDs must match dataset entries.** When the grading mode is `default`
  or `default_plus_custom`, each case's entry id — `entry_id` under
  `[metadata]` in `task.toml`, falling back to the case directory name — must
  match an entry `id` in `evals/evals.json`, or the run refuses to start.
  `custom_only` has no such requirement. See
  [Eval Datasets](/skills/skillevaluator/eval-datasets).
- **Your source is never mutated in place.** SkillEvaluator stages with-skill
  and baseline copies of `evals/harbor/` under the results directory for each
  run; the files you author stay untouched. In a paired run, the staged copies
  append `-with-skill` or `-without-skill` to each `[task] name` and record a
  missing `entry_id` under `[metadata]`, so Harbor keeps the arms apart;
  results still resolve to your case IDs.

The staged task also has explicit compatibility boundaries:

- Native task projection is currently POSIX-only. A Windows agent environment,
  or any task/step verifier whose effective environment is Windows, is rejected
  before staging in every grading mode.
- `default` and `default_plus_custom` keep SkillEvaluator's standard grader in
  the shared verifier environment. Effective separate-verifier contexts and
  non-empty `steps/<step-name>/tests/` overlays are rejected. Task or step
  collect hooks and task-controlled `HARBOR_*`, executable-search, shell,
  process-loader, proxy/TLS, discovery, evaluator-provider, or judge-model
  environment controls are also rejected. An exact `${NAME}` assignment for a
  provider or judge control is accepted in task/step `verifier.env` only when
  the operator explicitly staged that same name; unrelated verifier variables
  remain available. Operator-set `LLM_JUDGE_FALLBACK_MODELS`,
  `LLM_JUDGE_FALLBACK_POLICY`, `LLM_JUDGE_RETRY_POLICY`, and
  `SKILL_EVAL_LLM_REFUSAL_FALLBACK_MODEL` values are forwarded only to the standard verifier job, never to the agent environment
  or a `custom_only` run. SkillEvaluator's Python verifier runs in isolated mode
  from a replaced `tests/skill_evaluator/` payload so authored helper modules
  cannot shadow its imports.
- Use `custom_only` when the native task must own those surfaces. A shared
  verifier, or a separate verifier built from `environment/`, uses a step's
  `steps/<step-name>/tests/` script when one exists and otherwise falls back to
  the top-level test. A `Dockerfile` or `docker-compose.yaml` in a step or task
  `tests/` directory, or a `docker_image` in the step's or task's
  `[verifier.environment]`, instead defines a dedicated verifier image: that
  `tests/` directory must contain its own test script, and Harbor uploads no
  tests to it. A task with
  `tests/grader.py` or `tests/grader.sh` cannot use a dedicated verifier image,
  because SkillEvaluator's grader would never reach it. When every native
  `custom_only` verifier pass already resolves an authored test script and no
  native `tests/grader.py` or `tests/grader.sh` selects SkillEvaluator's custom
  runner, staging preserves an authored `tests/skill_evaluator/` directory.
- A paired baseline rejects authored top-level or step healthchecks,
  `steps/<step-name>/workdir/` projections, Harbor's effective task-shipped
  prior trajectory (`trajectory.json` for a single-step task or the first
  step's `trajectory.json`), and skill-owned `harbor.pre_agent_setup` /
  `setup_commands`. Those surfaces can seed or observe agent behavior before
  the evaluated skill runs. They remain available for a with-skill-only
  `--skip-baseline` run.

## Validate the contract

Check your `evals/` tree and the Harbor task and reward contract before
spending compute:

```bash title="Validate the BYOT contract"
skillevaluator tier3 validate ./my-skill --harbor-contract
```

Add `--strict` to treat warnings as failures and `--json` for
machine-readable output.

## Debug retained jobs

Harbor job artifacts are transient — deleted by default whether the run
succeeds or fails. Pass `--harbor-keep-jobs` to retain them, then browse the
trajectories and grader output with Harbor's own viewer (when a retained jobs
directory exists, the Artifacts panel at the end of the run prints the exact
`harbor-view` command to paste):

```bash title="Keep the job artifacts, then inspect them"
skillevaluator tier3 evaluate ./my-skill --agents codex --harbor-keep-jobs
skillevaluator harbor-view <jobs-dir>
```

Grader stdout, the written `reward.json`, and the full trajectory are all in
the retained job tree — the fastest way to find out why a score isn't what
you expected. [Agents & Sandboxes](/skills/skillevaluator/agents-and-sandboxes) covers the
debugging workflow in depth.

## What reports show

Custom scores flow into the same results tree as everything else:

- In `result.json`, each agent carries per-arm custom metric averages
  (`custom_with_skill`, `custom_without_skill`) and a per-metric
  `custom_lift` — with-skill minus without-skill, per custom metric. The lift
  is also written to `custom_lift.json` next to the standard `lift.json`.
- In `default_plus_custom` mode, reports keep the standard metric and
  dimension view and add your scores as clearly labeled `Custom:` entries
  alongside it, each with its own lift; custom metrics never change the
  standard dimension scores.
- In `custom_only` mode, your `overall` reward drives pass@k and the overall
  lift. The standard dimension rows stay visible but render `NO SCORE` —
  unscored metrics are never coerced to 0.0, and your custom metrics are
  never re-labeled as standard dimensions. An arm that produces no scoreable
  reward (for example, every attempt fails) still records the `custom-only`
  metric set and `custom-overall-v1` score policy in its summary and in the
  run's attempt policy.

Custom lift needs both arms — a `--skip-baseline` run reports your custom
scores but no lift. [Reports & Results](/skills/skillevaluator/reports) covers the full on-disk
layout and the machine-readable contract.

## Import precomputed custom metrics

Use `tier3 import-metrics` when evaluation already happened outside
SkillEvaluator, such as a hardware simulator that cannot run in the standard
sandbox. The initial import contract accepts **per-case, per-attempt precomputed
scores**, not executable graders, predictions, raw trajectories, arbitrary
physical quantities, or aggregate-only benchmark results. Continue using the
grading modes above to execute custom grading logic against live trajectories.

Imports reuse the existing `custom_metrics` reward envelope, numeric bounds,
reserved-name protection and custom-score averaging. They do **not** select a
grading mode, supply `overall`, or replace canonical dimensions. In particular,
an import does not imply that `custom_only` grading or a standard verifier ran.

### Run the simulator example

From a repository checkout, import the bundled
[synthetic simulator results](assets/simulator-metrics.json):

```bash
uv run skillevaluator tier3 import-metrics docs/assets/simulator-metrics.json \
  --output-dir reports/imported-simulator
```

No provider key, agent, Docker or Tier 3 extra is needed. The output directory
must not exist; imports never overwrite live reports or a previous import.
The command creates `external_metrics.json` and `external_metrics.md`. These are
external-only artifacts, not a live run's `result.json`; `view`, `compare`, the
dashboard and publication gates do not consume them. Exit 0 means the import
was valid and reports were written, **not** that the external evaluation passed.

The example is fabricated data, not a simulator run. Its Markdown report includes:

| Custom metric | Version | Unit | Direction | With skill (n/total) | Without skill (n/total) | Paired delta | Improvement | Paired cases/attempts |
| --- | --- | --- | --- | --- | --- | --- | --- | --- |
| convergence\_rate | 1 | fraction | higher\_is\_better | 0.8500 (2/2) | 0.6500 (2/2) | 0.2000 | 0.2000 | 2/2 |
| timing\_error\_fraction | 1 | fraction\_of\_budget | lower\_is\_better | 0.1500 (2/2) | 0.3000 (2/2) | -0.1500 | 0.1500 | 2/2 |

Both reports label the observations as external. SkillEvaluator performs only
input validation, aggregation and paired comparison, not test execution or
independent verification of the producer's claims. JSON records
`executed_by_skillevaluator: false`, the declared provenance, import time,
SHA-256 of the exact input bytes, definitions, observations and coverage counts.
It assigns no Overall, pass/fail result or publication evidence.

### Input contract (version 1)

The input is a UTF-8 JSON object with exactly these fields:

| Field | Contract |
| --- | --- |
| `schema_version` | String `"1"`. Unknown versions are rejected. |
| `evaluation` | Required nonempty strings: `dataset_id`, `dataset_version`, `skill_id`, `skill_version`, `agent`, `agent_version`, `model`, `environment`. Use stable versions or content digests for datasets, skills, models and environment configurations. A non-model producer may explicitly use `model: "not_applicable"`. |
| `provenance` | Required nonempty strings: `producer` (exporter identity/version), `run_id` (external source run), `created_at` (ISO 8601 timestamp including timezone). |
| `metric_definitions` | Map of custom names to `{ "version": "1", "unit": "fraction", "direction": "higher_is_better", "aggregation": "mean" }`, for example. Version and unit are required nonempty strings; direction is `higher_is_better` or `lower_is_better`; only mean aggregation is supported. |
| `observations` | Nonempty list of `{ "case_id": "adder", "attempt": 1, "arm": "with_skill", "custom_metrics": { "convergence_rate": 0.9 } }`, for example. Each score references a declared definition. |

Scores must be finite JSON numbers in **[0, 1]**, the same scale as executable
custom graders. Booleans, numeric strings and `{ "score": ... }` wrappers are
not accepted by this initial import format. `unit` describes the normalized
quantity; the importer does not convert units or normalize raw measurements.
For example, export timing error divided by a fixed budget, and version that
normalization formula. Values above 1 must be transformed by an explicitly
documented, versioned scoring formula before export; never silently clip them.
Raw milliseconds, unrestricted counts and arbitrary ranges are not supported.
Change the metric version whenever its meaning, normalization or unit changes.

An omitted metric or `null` means **unscored**, never zero. Every observation
must have a nonempty `custom_metrics` object, but its declared metrics may all
be null. Arm means exclude missing values and report a scored count per metric
against total observations. All-missing metrics render `NO SCORE`.

Case IDs are strings following the [dataset identity rules](/skills/skillevaluator/eval-datasets). Attempts are
integers from 1 through 1000, not booleans. Only `with_skill` and `without_skill`
arms are accepted; duplicate case/attempt/arm identities and case IDs differing
only in capitalization are rejected. Standard metric names, metadata names
reserved by custom graders, and canonical dimension names cannot be custom
names. Names retain the existing bounded, publishable-name protections.

Unknown fields (including per-row context/definition overrides), duplicate JSON
keys and invalid values fail the whole import before creating output. Text
identities are printable, trimmed strings of at most 256 characters. Inputs are
bounded to 4 MiB, 1000 observations, 128 metric definitions, 128 metrics per
observation, 12 nesting levels and 500,000 parser tokens. Do not put credentials,
private data or sensitive infrastructure identifiers in exported metadata.

### Compatible paired custom lift

One document declares **one** dataset/version, skill/version, agent/version,
model, environment and metric-definition set, shared by both arms. Export only
comparable observations into that document: in particular, a case/attempt pair
must use the same workload and seed. These are producer assertions, not facts
SkillEvaluator can independently verify. Export different contexts or metric
versions separately; this initial path does not merge files or compare imports
with retained live runs.

For each metric, pair only matching case IDs **and attempt numbers** with finite
scores in both arms. Compute with-skill minus without-skill for each pair, mean
the matched attempts within each case, then equally weight cases. Unmatched
observations still contribute to arm means, not paired lift, so paired lift can
differ from subtraction of arm means. Reports show matched case and attempt
counts and make no statistical significance claim.

`custom_lift[NAME].delta` preserves the existing custom lift sign convention
(with minus without). `improvement` reverses it for lower-is-better metrics, so
positive always means better. A missing baseline, disjoint attempts or missing
scores produce null delta/improvement and `NO SCORE`, not a fabricated zero.

## Troubleshooting

<AccordionGroup>
  <Accordion title="grading.mode=custom_only requires a grader or native test script">
    `custom_only` refuses to run without a grader or a Harbor-resolvable native
    test script for every verifier pass. Scaffold a grader with
    `skillevaluator init-custom-grader ./my-skill --mode custom_only`, or for
    a native Harbor task provide `tests/grader.py`, a top-level `tests/test.sh`,
    or step-local test scripts. A dedicated verifier image, defined by a
    `Dockerfile` or `docker-compose.yaml` in a step or task `tests/` directory
    or by a verifier `docker_image`, must have its own test script in that
    directory because Harbor uploads no tests to it.
  </Accordion>
  <Accordion title="custom_only requires a numeric overall score">
    In `custom_only` mode your grader must write a numeric `overall` between
    0.0 and 1.0 in `reward.json`, or a numeric value in `reward.txt`. Without
    one the run fails rather than guessing.
  </Accordion>
  <Accordion title="Custom metric collides with a reserved name">
    Your grader wrote a metric named after a standard score or reward-metadata
    field (`security`, `accuracy`, `overall`, `entry_id`, `details`, and the
    rest). Rename it and keep custom scores under `custom_metrics`.
  </Accordion>
  <Accordion title="Custom scores don't appear in the report">
    Confirm the grading mode: `default` ignores custom graders entirely. Set
    `--grading-mode default_plus_custom` or `custom_only`, or the matching
    `grading.mode` in `evals/config.yml`, then re-run
    `skillevaluator tier3 validate ./my-skill --harbor-contract` to confirm
    the grader is picked up.
  </Accordion>
</AccordionGroup>

## Next steps

<CardGroup cols={2}>
  <Card title="Eval Datasets" icon="book" href="/skills/skillevaluator/eval-datasets">
    The full evals/ contract — dataset format, config.yml run policy, and
    fixtures your custom task can build on.
  </Card>
  <Card title="Reports & Results" icon="terminal" href="/skills/skillevaluator/reports">
    Everything a run writes to disk and how to read it, including where
    custom metrics and custom lift surface.
  </Card>
</CardGroup>