Skip to content

GuardrailErrorEvent

Emitted when a guardrail throws or exceeds its timeout.

Defined in: src/core/events/types.ts:685

Emitted when a guardrail throws or exceeds its timeout.

Remarks

The policy field reports how the SDK handled it: 'passthrough' kept the text and skipped the guardrail, 'block' suppressed the text. Treat these events as an alert — a guardrail that fails silently is a guardrail that is not protecting anything.

Example

agent.on('guardrail.error', (event) => {
  metrics.increment('guardrail.failure', { guardrail: event.guardrail });
});

See

GuardrailEvent for all guardrail event types

Extends

  • BaseEvent

Properties

PropertyTypeDescriptionInherited fromDefined in
errorErrorThe error thrown, or a timeout error synthesized by the SDK.-src/core/events/types.ts:696
guardrailstringName of the guardrail that failed.-src/core/events/types.ts:690
metadata?Record<string, unknown>Optional metadata associated with the event. Remarks May contain provider-specific data or debugging information.BaseEvent.metadatasrc/core/events/types.ts:94
policy"passthrough" | "block"How the failure was handled, per the configured error policy.-src/core/events/types.ts:699
stage"chunk" | "final"Pipeline point at which it ran.-src/core/events/types.ts:693
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.error"Discriminant for this event type.-src/core/events/types.ts:687

© 2026 CompositeVoice. All rights reserved.

Font size
Contrast
Motion
Transparency