Cross-agent guardrails to evaluate
Source/observer agent context
Standard guardrail context
The output chunk to evaluate
Evaluation result with blocked status and any modifications
const result = await evaluateCrossAgentGuardrails(
crossAgentGuardrails,
{ sourceAgentId: 'worker-1', observerAgentId: 'supervisor' },
guardrailContext,
textDeltaChunk
);
if (result.blocked) {
// Terminate the source agent's stream
} else if (result.modifiedChunk) {
// Use the sanitized chunk
}
Evaluate a chunk through all applicable cross-agent guardrails.
Filters guardrails to only those observing the source agent, then evaluates the chunk through each. Respects
canInterruptOthersflag.