Skip to main content

Interface: PhraseEntry

Defined in: packages/agentos/src/safety/guardrails/builtin/PhraseListGuardrail.ts:30

One entry of a list: the phrase, how it matches, and what a match does (a block at once, or the judge's read).

Properties​

match​

match: "word" | "regex" | "substring"

Defined in: packages/agentos/src/safety/guardrails/builtin/PhraseListGuardrail.ts:38

word: the phrase between word boundaries; substring: anywhere; regex: the phrase is a regular expression. Every entry runs over the normalised text (lower case, marks and zero-width characters removed, look-alike letters mapped to Latin, quotes straightened): a word or substring phrase is normalised the same way before it is compiled, while a regex source is compiled as written, so write a regex in that normalised form.


onMatch​

onMatch: "block" | "judge"

Defined in: packages/agentos/src/safety/guardrails/builtin/PhraseListGuardrail.ts:40

block: a match blocks; judge: the judge decides whether the match, in context, crosses the rule.


phrase​

phrase: string

Defined in: packages/agentos/src/safety/guardrails/builtin/PhraseListGuardrail.ts:31


ruleId?​

optional ruleId: string

Defined in: packages/agentos/src/safety/guardrails/builtin/PhraseListGuardrail.ts:42

The rule the entry belongs to: the block's reasonCode and the key of its replacement.