Guardrail context for the error details
The blocking evaluation result
Optional options: GuardrailOutputOptionsStream options (streamId, personaId)
Async generator yielding a single ERROR chunk
if (outcome.evaluation?.action === GuardrailAction.BLOCK) {
yield* createGuardrailBlockedStream(
guardrailContext,
outcome.evaluation,
{ streamId: 'stream-123', personaId: 'support-agent' }
);
return;
}
Create a stream that emits a single error chunk for blocked content.
Use this when input evaluation returns GuardrailAction.BLOCK to generate an appropriate error response without invoking orchestration.