From f0f93dbe0bad5342e73842b664dba36e5f47f8eb Mon Sep 17 00:00:00 2001 From: Harsh Jain <96345745+HarshJa1n@users.noreply.github.com> Date: Wed, 12 Mar 2025 18:10:28 +0530 Subject: [PATCH] Fix guardrail trigger in input_guardrails.py Remove the `not` keyword from the `tripwire_triggered` parameter in the `math_guardrail` function in `examples/agent_patterns/input_guardrails.py`. The not keyword prevented the guardrail from being triggered, which defeats the purpose of the example. --- examples/agent_patterns/input_guardrails.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/agent_patterns/input_guardrails.py b/examples/agent_patterns/input_guardrails.py index 62591886..8c8e1826 100644 --- a/examples/agent_patterns/input_guardrails.py +++ b/examples/agent_patterns/input_guardrails.py @@ -53,7 +53,7 @@ async def math_guardrail( return GuardrailFunctionOutput( output_info=final_output, - tripwire_triggered=not final_output.is_math_homework, + tripwire_triggered=final_output.is_math_homework, )