Skip to content

CreateHarnessOptions

CreateHarnessOptions<TInput, TOutput> = object

Options for creating a lightweight custom application harness.

Prefer this helper for custom harnesses. Implement Harness directly only when the callback already returns a full HarnessRun with canonical session.events.

const options: CreateHarnessOptions<string, { status: "approved" }> = {
name: "refund-agent",
run: async ({ input }) => ({
output: await classifyRefund(input),
events: [{ type: "message", role: "user", content: input }],
}),
};

TInput = unknown

TOutput extends JsonValue | undefined = JsonValue | undefined

name: string

Stable harness name used in reports.


run: (args) => MaybePromise<HarnessResultLike<TOutput>>

Executes application code and returns either a lightweight result or full HarnessRun.

CreateHarnessRunArgs<TInput>

MaybePromise<HarnessResultLike<TOutput>>