ModerationVerdict
Verdict returned by a ModerationFn.
Defined in: src/guardrails/moderation.ts:18
Verdict returned by a ModerationFn.
Properties
| Property | Type | Description | Defined in |
|---|---|---|---|
categories? | readonly string[] | Violated categories, surfaced in the guardrail event metadata. | src/guardrails/moderation.ts:22 |
flagged | boolean | Whether the text violates policy. | src/guardrails/moderation.ts:20 |
score? | number | Confidence or severity, surfaced in the guardrail event metadata. | src/guardrails/moderation.ts:24 |
text? | string | Sanitized text to speak instead of the original. Remarks When present and non-empty on a flagged verdict, this is spoken and the utterance is not blocked — the escape hatch for classifiers that rewrite rather than reject. An empty string blocks the utterance instead. | src/guardrails/moderation.ts:33 |