Skip to content

FileSearchTool runs despite InputGuardrailTripwireTriggered #889

Open
@odalink-ar

Description

@odalink-ar

Hello, I'm observing unexpected behavior when using input_guardrails in combination with FileSearchTool.
Although the guardrail is triggered correctly (the InputGuardrailTripwireTriggered exception is thrown), the traces show that the agent still executed the document search.

This suggests that part of the FileSearchTool process is running even when the input should have been blocked, resulting in unnecessary token consumption.
Could you confirm if this behavior is expected or if it could be a partial execution before the exception propagates?

Also, is there a recommended way to avoid this behavior or completely block tool execution if the guardrail is triggered?

Expected behavior:

When a guardrail returns tripwire_triggered=True, the agent should not execute any tools, even partially. The flow should be completely cut off before any tool (such as FileSearchTool) prepares or consumes tokens.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionQuestion about using the SDK

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions