JudgeContext
Full normalized context passed to every judge.
Example
Section titled “Example”type RefundOutput = { status: "approved" | "denied" };
const RefundStatusJudge = createJudge<string, RefundOutput>( "RefundStatusJudge", ({ output }) => ({ score: output.status === "approved" ? 1 : 0, }),);Extended by
Section titled “Extended by”Type Parameters
Section titled “Type Parameters”TInput
Section titled “TInput”TInput = any
TOutput
Section titled “TOutput”TOutput extends JsonValue | undefined = JsonValue | undefined
THarness
Section titled “THarness”THarness extends Harness<TInput, TOutput> | undefined = Harness<TInput, TOutput> | undefined
Properties
Section titled “Properties”harness
Section titled “harness”harness:
THarness
Harness associated with this judge context.
input:
TInput
Original eval input passed to the harness.
output
Section titled “output”output:
TOutput
App-facing output returned by the harness.
run:
HarnessRun<TOutput>
Complete normalized harness run being judged.
runJudge?
Section titled “runJudge?”
optionalrunJudge?:RunJudge
Runs the configured matcher, judge, or suite judge harness with run-scoped context.
session
Section titled “session”session:
HarnessRun<TOutput>["session"]
Normalized transcript associated with the harness run.
toolCalls
Section titled “toolCalls”toolCalls:
ToolCall[]
Flattened tool calls observed in the normalized session.