Skip to content

HarnessContext

HarnessContext = object

Runtime context passed from the eval fixture into a harness run.

const harness: Harness<string> = {
name: "refund-agent",
async run(input, context) {
context.setArtifact("inputLength", input.length);
return {
output: undefined,
session: { events: [{ type: "message", role: "user", content: input }] },
usage: {},
errors: [],
};
},
};

artifacts: Record<string, JsonValue>

Mutable JSON-safe artifact bag shared with the harness.


setArtifact: (name, value) => void

Stores one JSON-safe artifact on the current run.

string

JsonValue

void


optional signal?: AbortSignal

Abort signal from Vitest when available.