Open
Description
Bug Description
When an input guardrail triggers a tripwire and raises InputGuardrailTripwireTriggered
, the agent execution should stop immediately. However, tools are still being executed after the guardrail exception is raised, as evidenced by OpenAI API traces.
Expected Behavior
- Input guardrail evaluates the input
- If tripwire is triggered,
InputGuardrailTripwireTriggered
exception is raised - Agent execution stops immediately
- No tools should be called
Actual Behavior
- Input guardrail correctly triggers and raises exception
- Tools are still executed after the exception (visible in OpenAI dashboard traces)
- This creates unexpected behavior and potential security/cost implications
Environment
- openai-agents version: 0.1.0
- Python version: 3.13+
- Operating System: Windows
Steps to Reproduce
- Create an agent with an input guardrail that triggers a tripwire
- Create an agent with tools
- Run the agent with input that should trigger the guardrail
- Observe that exception is raised but tools are still called in OpenAI traces
OpenAI Trace
Additional Context
This issue was discovered while testing guardrails functionality. The guardrail logic works correctly (proper exception is raised), but the execution flow doesn't respect the guardrail's decision to stop processing.