Interface PhraseListGuardrailOptions

How a phrase-list guard is built: its id, its list, the judge behind onMatch: 'judge', the stages it runs on, the replacement a block carries.

interface PhraseListGuardrailOptions {
    id: string;
    source: PhraseListSource;
    judge?: PhraseJudge;
    judgeThreshold?: number;
    stages?: ("output" | "input")[];
    replacementText?: string;
    replacementFor?(ruleId): undefined | string;
    timeoutMs?: number;
    normalize?(text): string;
}

Methods

Properties

id: string
judge?: PhraseJudge

Required when any entry is judge.

judgeThreshold?: number

A judge's block counts only at or above this confidence; a lower one blocks all the same (fail closed). Default 0.7.

stages?: ("output" | "input")[]

The stages the guard evaluates. Default both.

replacementText?: string

The reply a block is answered with when no rule's own replacement applies.

timeoutMs?: number

The deadline for one evaluation, judge included. Default 8 seconds.