Skip to main content
Options for session.run(), on top of the prompt options.

Properties

string | false
The output-format instructions appended to the prompt as an extra text block when output is set. Pass a string to replace the default, or false to append nothing (e.g. when the prompt already explains the expected JSON).
unknown
JSON Schema describing output, embedded in the appended output-format instructions so the agent knows the exact shape to produce. Rarely needed: when omitted, the SDK derives it from the schema itself — via a toJsonSchema() / toJSONSchema() method on the schema object (e.g. arktype), the Standard JSON Schema extension (~standard.jsonSchema), or on Node z.toJSONSchema() for zod 4 schemas (zod-to-json-schema for zod 3, when installed). Pass this to override the derived schema or when derivation isn’t possible — e.g. zod 4.1 or older on an edge runtime.
Record<string, unknown>
Extra _meta to send with the prompt (see PromptOptions).
StandardSchema<T>
Type: StandardSchemaSchema for the turn’s structured output (any Standard Schema, e.g. zod). run() appends output-format instructions to the prompt (see RunOptions.instructions); the final agent message is parsed as JSON — either the whole message or its last ```json fenced block — and validated; the result lands on outcome.output. Validation failure rejects the turn. A turn that stops without end_turn (cancelled, refusal, …) still resolves, but reading its output throws.
AbortSignal
Cancel the turn as soon as this signal aborts (see PromptOptions).