GuardrailBlockedEvent
Emitted when a guardrail suppresses text instead of speaking it.
Defined in: src/core/events/types.ts:647
Emitted when a guardrail suppresses text instead of speaking it.
Remarks
At the 'final' stage nothing is synthesized for the utterance. At the 'chunk' stage the current segment and every later segment of the same utterance are dropped — text already handed to the TTS provider cannot be recalled. Use mode: 'buffered' when a block must be absolute.
Example
agent.on('guardrail.blocked', (event) => {
showNotice(`Response withheld by ${event.guardrail}: ${event.reason}`);
});
See
GuardrailEvent for all guardrail event types
Extends
BaseEvent
Properties
| Property | Type | Description | Overrides | Inherited from | Defined in |
|---|---|---|---|---|---|
guardrail | string | Name of the guardrail that blocked the text. | - | - | src/core/events/types.ts:652 |
metadata? | Record<string, unknown> | Detail supplied by the guardrail (matched categories, counts, scores). | BaseEvent.metadata | - | src/core/events/types.ts:664 |
original | string | Text that was suppressed. | - | - | src/core/events/types.ts:658 |
reason? | string | Explanation supplied by the guardrail, if any. | - | - | src/core/events/types.ts:661 |
stage | "chunk" | "final" | Pipeline point at which it ran. | - | - | src/core/events/types.ts:655 |
timestamp | number | Unix timestamp (in milliseconds) when the event occurred. Remarks Useful for latency measurements and debugging the pipeline timing. | - | BaseEvent.timestamp | src/core/events/types.ts:86 |
type | "guardrail.blocked" | Discriminant for this event type. | - | - | src/core/events/types.ts:649 |