Skip to content

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

PropertyTypeDescriptionOverridesInherited fromDefined in
guardrailstringName 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
originalstringText that was suppressed.--src/core/events/types.ts:658
reason?stringExplanation 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
timestampnumberUnix timestamp (in milliseconds) when the event occurred. Remarks Useful for latency measurements and debugging the pipeline timing.-BaseEvent.timestampsrc/core/events/types.ts:86
type"guardrail.blocked"Discriminant for this event type.--src/core/events/types.ts:649

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency