Expand description
Input and output guardrails with tripwire support.
Guardrails check input before it reaches the LLM and output before it
reaches the user. A GuardrailResult::Tripwire halts execution
immediately, while GuardrailResult::Warn allows execution to continue
with a logged warning.
Enums§
- Guardrail
Result - Result of a guardrail check.
Traits§
- Erased
Input Guardrail - Dyn-compatible wrapper for
InputGuardrail. - Erased
Output Guardrail - Dyn-compatible wrapper for
OutputGuardrail. - Input
Guardrail - Guardrail that checks input before it reaches the LLM.
- Output
Guardrail - Guardrail that checks output before it reaches the user.
Functions§
- run_
input_ guardrails - Run a sequence of input guardrails, returning the first non-Pass result.
- run_
output_ guardrails - Run a sequence of output guardrails, returning the first non-Pass result.