Skip to content

[BUG] Approval-gated tools are offered when no approver exists and block the agent mid-turn #1583

Closed

Description

@edenreich

Summary

In a session where approvals are not available (CI, tools.safety.approval_behaviour with no approver), tools that require approval are still offered to the model. Calling them is refused mid-turn with a message telling the agent to "tell the user what you need", which an unattended agent cannot do. The agent then works around the missing tool for the rest of the run.

Seen on an infer-action v0.58.0 run with CLI v0.233.0: https://github.com/edenreich/das-ist-berlin/actions/runs/39459666409

Steps to Reproduce

  1. Run infer agent non-interactively (infer-action) with the default safety config.
  2. Have the agent start a background shell with run_in_background and then read it with BashOutput, or call KillShell or BrowserNavigate.
  3. Have it run a Bash command outside the allowlist, such as bun /tmp/x.ts or ls ~/.cache/ms-playwright.

Expected Behavior

Either the tool is not in the tool list for that session, or the refusal says the tool is unavailable in this session and names what is allowed, so the model does not plan around it. An agent run with no approver should never be told to ask the user.

Actual Behavior

Seven calls were refused:

Blocked: BashOutput requires approval, but approvals are not available in this session (tools.safety.approval_behaviour). The action was NOT executed. Do not retry the same call - tell the user what you need and ...
Blocked: KillShell requires approval, but approvals are not available in this session ...
Blocked: BrowserNavigate requires approval, but approvals are not available in this session ...
Blocked: Bash requires approval, but approvals are not available in this session ...   (bun /tmp/mapillary2.ts)
Blocked: Bash requires approval, but approvals are not available in this session ...   (ls ~/.cache/ms-playwright)

With BashOutput refused, every background shell's output was unreadable. The agent reasoned "background shells' output stays unreadable - I must design everything so scripts WRITE TO FILES" and rewrote its scripts to write files and poll them with Wait, which cost turns and context. BrowserNavigate was refused although the workflow had computer-use: 'true' and INFER_BROWSER_USE_ENABLED=true, so the demo it was asked to record could not have been made.

Suggested fix:

  • When approvals cannot be granted, filter approval-gated tools out of the tool definitions sent to the model, or mark them as unavailable in their description.
  • Make the refusal text for unattended sessions say the tool is unavailable here and, for Bash, which patterns are allowed, instead of asking the agent to ask the user.
  • BashOutput on a shell the agent itself started should not need approval: reading output cannot do more than the command already allowed.

Activity

  1. added
    bug
    on Oct 20, 2026
  2. added theissue type on Oct 20, 2026
  3. moved this from Todo to QA in 2026on Oct 20, 2026
  4. moved this from QA to Done in 2026on Oct 20, 2026
  5. inference-gateway-releaser commented on Oct 20, 2026

    @inference-gateway-releaser
    Contributor

    🎉 This issue has been resolved in version 0.233.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugreleased

    Type

    Projects

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions