Interface GuardrailOutputPayload

Payload for output guardrail evaluation.

Provided to IGuardrailService.evaluateOutput before response chunks are emitted to the client. Use this to filter, redact, or block agent output.

Remarks

The timing of evaluation depends on GuardrailConfig.evaluateStreamingChunks:

  • true: Called for every TEXT_DELTA chunk (real-time filtering)
  • false (default): Called only for FINAL_RESPONSE chunks
interface GuardrailOutputPayload {
    context: GuardrailContext;
    chunk: AgentOSResponse;
    ragSources?: RagRetrievedChunk[];
}

Properties

Conversational context for policy decisions

The response chunk to evaluate

ragSources?: RagRetrievedChunk[]

RAG source chunks retrieved for this request. Available to output guardrails for grounding verification. Persists across all chunks in a stream (not just the final chunk). Undefined when no RAG retrieval was performed.