Skip to main content

Interface: TextGuardrailOptions

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:34

The guards option: a host's guards, enforced on one call.

Properties​

context​

context: GuardrailContext

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:38

Who the call is for and where it happens.


mode?​

optional mode: "enforce" | "dryRun"

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:43

enforce (default) applies every verdict. dryRun evaluates every guard and reports each verdict with enforced: false; the input, the tool calls and the reply pass unchanged.


onVerdict()?​

optional onVerdict: (verdict) => void | Promise<void>

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:55

Called with every verdict, enforced or not. A throw is written as an event and ignored.

Parameters​

verdict​

TextGuardrailVerdict

Returns​

void | Promise<void>


output?​

optional output: "stream" | "hold"

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:51

streamText only. hold (default): no text part is delivered before the final guards have judged the whole reply. stream: text flows as it arrives; only guards with evaluateStreamingChunks can stop it mid-stream, and a final block arrives as an error part after the text.


services​

services: IGuardrailService[]

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:36

The guards, in registration order.


stages?​

optional stages: readonly ("output" | "input" | "toolCalls")[]

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:45

The stages that run. Default: every stage some guard implements.


timeoutMs?​

optional timeoutMs: number

Defined in: packages/agentos/src/api/runtime/textGuardrails.ts:53

The deadline for a guard whose config sets none. Default 8000 ms.