The action AgentOS should take based on this evaluation
Optional reasonHuman-readable reason for the action. May be shown to end users or logged for audit.
Optional reasonMachine-readable code identifying the policy or rule triggered. Useful for analytics and automated handling.
Optional metadataAdditional metadata for analytics, audit, or debugging. Persisted in response chunk metadata.
Optional detailsDetailed information about the evaluation (e.g., moderation scores, stack traces, matched patterns). Not shown to users.
Optional modifiedReplacement text when action is GuardrailAction.SANITIZE. For input evaluation: replaces textInput before orchestration. For output evaluation: replaces textDelta (streaming) or finalResponseText (final).
Optional replacementWith GuardrailAction.BLOCK on output (a streamed delta or the final response): a non-empty string is the fixed reply the caller receives in place of the model's, as a FINAL_RESPONSE whose guardrail metadata records the block, instead of an error chunk; an empty string or no value yields the error chunk. A product's safety templates answer this way, so a person reads a fixed text and never a raw failure.
Result returned by a guardrail evaluation.
Contains the action to take and optional context about why. This result is attached to response chunk metadata for observability.
Example