Skip to main content
Registers an input and output redaction, a maximum prompt length, and a custom input check you replace with your own client. Source: examples/agent_with_guardrails/

Run

From examples/:
A prompt that contains MODERATION_BLOCK stops with agent.ErrGuardrailBlocked and does not call the model. Replace moderate in main.go with your own check. On Temporal, register the same guardrails in the same order on the starter and the worker.