Skip to content

JudgeContext

Full normalized context passed to every judge.

type RefundOutput = { status: "approved" | "denied" };
const RefundStatusJudge = createJudge<string, RefundOutput>(
"RefundStatusJudge",
({ output }) => ({
score: output.status === "approved" ? 1 : 0,
}),
);

TInput = any

TOutput extends JsonValue | undefined = JsonValue | undefined

THarness extends Harness<TInput, TOutput> | undefined = Harness<TInput, TOutput> | undefined

harness: THarness

Harness associated with this judge context.


input: TInput

Original eval input passed to the harness.


output: TOutput

App-facing output returned by the harness.


run: HarnessRun<TOutput>

Complete normalized harness run being judged.


optional runJudge?: RunJudge

Runs the configured matcher, judge, or suite judge harness with run-scoped context.


session: HarnessRun<TOutput>["session"]

Normalized transcript associated with the harness run.


toolCalls: ToolCall[]

Flattened tool calls observed in the normalized session.