Optional evaluateEvaluate output from an observed agent.
Called when an observed agent (per observeAgentIds) emits a chunk. The evaluation timing depends on IGuardrailService.config:
evaluateStreamingChunks: true: Called for each TEXT_DELTAevaluateStreamingChunks: false: Called only for FINAL_RESPONSECross-agent context and chunk to evaluate
Evaluation result, or null to allow without action
trueOptional evaluateEvaluate user input before orchestration.
Called once per request before the orchestration pipeline starts. Use this to validate, sanitize, or block user messages.
Input and context to evaluate
Evaluation result, or null to allow without action
BLOCK to prevent the request from being processedSANITIZE with modifiedText to clean the inputnull or ALLOW to let the request throughOptional evaluateEvaluate agent output before streaming to client.
Called for response chunks based on GuardrailConfig.evaluateStreamingChunks:
true: Called for every TEXT_DELTA chunk (real-time filtering)false (default): Called only for FINAL_RESPONSE chunksResponse chunk and context to evaluate
Evaluation result, or null to allow without action
BLOCK to immediately terminate the stream with an errorSANITIZE with modifiedText to redact/modify contentOptional observeAgent IDs this guardrail observes.
[] or undefined: Observe all agents in the agency// Observe specific workers
observeAgentIds = ['worker-1', 'worker-2'];
// Observe all agents
observeAgentIds = [];
Optional canWhether this guardrail can interrupt other agents' streams.
When true:
When false (default):
false
Optional configConfiguration for evaluation behavior. Controls streaming vs final-only evaluation and rate limiting.
Cross-agent guardrail service for multi-agent supervision.
Extends IGuardrailService to enable observation and intervention in other agents' output streams. Use this for:
Example: Quality gate guardrail
Example: Selective agent monitoring