Skip to content

Input guardrail tripwire allows tool execution to continue after exception is raised #991

Open
@adeelmc

Description

@adeelmc

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

  1. Create an agent with an input guardrail that triggers a tripwire
  2. Create an agent with tools
  3. Run the agent with input that should trigger the guardrail
  4. Observe that exception is raised but tools are still called in OpenAI traces

OpenAI Trace

Image

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions