node:vm, sandboxed - no network, no filesystem, a 3-second timeout) against each result’s input/output/expected - plus toolCalls (the linked trace’s recorded tool calls) when the result carries a trace_id, so a scorer can assert on tool behavior. They run right alongside the judge and similarity metrics, not instead of them.
From the dashboard: Governance → Evaluate → Datasets (or Evaluator) → create or edit → Code Scorers section → Add scorer. Each one gets a name and a JavaScript function body:
From the SDK (dataset builder, so the scorer is versioned with the dataset it guards):
{ score, reasoning }. A scorer that throws, times out, or returns something unexpected degrades to { score: null, error } for that one result - it never blocks the judge rating or any other score from being computed.
From the SDK, attach scorers when building a grading config:
run.results() as codeScorerResults. The runnable version is sample-scripts/selfhost_demo/03_evaluate_with_a_dataset.py.
Expected-trajectory matching reports
through the same per-result scorer rows: a case with
expected_tools shows a
“Trajectory match (mode)” row next to your own code scorers, pass/fail with the
expected-vs-actual call lists in its reasoning.
