Repository navigation
Description
Summary
The Bash auto-approval path check treats every argument of an allow-listed command as a filesystem path, so arguments that are not paths get the command blocked with Blocked: Bash requires approval. In headless CI runs nobody can approve, so the call is lost. The weekly transcript review for the week ending 2026-11-15 counted 30 blocked Bash calls in 15 infer runs (cli 7, adk 3, inference-gateway 2, desktop 1, docs 1, cockpit 1); a share of them are this false positive rather than pipes or compound commands.
bashPathOutsideSandbox in internal/sandbox/bash_paths.go runs every word after argv[0] through pathCandidates and wordOutsideSandbox, except for echo and printf. There is no notion of which arguments a command opens as files:
- A word with glob characters goes to
globOutsideSandbox, which rejects any component that starts with.and has a glob character. A jq filter such as.files[].pathmatches that rule. - An absolute path outside the sandbox fails
ValidateRead, including/dev/nulland a binary path such as/usr/bin/flox. - A word marked dynamic (
$...) or with an unsupported tilde form is always reported as outside. - The value of
-m,-q,--jq,--bodyand similar flags is checked like any other word.
Steps to Reproduce
- Run infer headless with the default Bash allow-list (for example through
infer-action), in a repository checkout. - Have the agent call Bash with
gh pr view 1 --json files -q .files[].path. - Have the agent call Bash with an allow-listed command that names
/dev/nullor/usr/bin/floxas an argument.
Expected Behavior
An allow-listed read-only command is auto-approved when the flagged word is not a file the command opens: a jq filter after -q or --jq, a message after -m, an API endpoint after gh api, or /dev/null.
Actual Behavior
The call is blocked with Blocked: Bash requires approval and the hint '<word>' is outside the sandbox, protected, or depends on the environment (internal/sandbox/bash.go, internal/agent/loop/states/blocking_tools.go).
Observed in the transcripts, not all reproduced from the code: jq filters such as -q .files[].path (cli, docs), /dev/null, /usr/bin/flox, gh api repos/... endpoint paths (cli) and git commit -m messages containing / (2 inference-gateway runs). The first three follow directly from the code above. The exact gh api and git commit -m shapes that fail were not reproduced; a plain relative a/b word should pass, so those messages probably also held a glob character, a $, or a leading /.
Possible fixes, smallest first: skip the value that follows known non-path flags (-m, -q, --jq, --body, --title), allow /dev/null, and skip the endpoint argument of gh api; or only treat a word as a path when it starts with /, ./, ../ or ~.
Activity
edenreich commentedon Nov 15, 2026
@infer can you work on this? use /ponytail:ponytail
inference-gateway-maintainer commentedon Nov 15, 2026
Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.8· CLI:v0.261.0· Gateway:v0.67.0· View JobTodos
Pull Request
#1872
✅ Infer Result: Success
Fixed in #1872 (ready for review, branch
fix/issue-1870, commitecb5b91d).What changed
bashPathOutsideSandboxran every word of an allow-listed command through the sandbox path rules, so jq filters, commit messages, gh free-text values,gh apiendpoints and/dev/nullall reported "outside the sandbox" and got blocked with no one to approve in headless runs. Two smallest fixes ininternal/sandbox/bash_paths.go:nonPathWordsmarks the words a command never opens as a file, command-scoped: the endpoint right aftergh api, the value after git's-m, and the values after gh's-q,--jq,--body,--title. File-opening values (--body-file, glued--flag=path) and every later operand stay checked -tail -q f,sort -m f,git commit -m msg .envandwc /dev/null /etc/hostsstill pass through validation.validateBashReadexempts/dev/nullfrom reads only; creating commands (mkdir /dev/null,ln -s x /dev/null) still validate it as a write and stay blocked.internal/sandbox/bash_paths_test.gogained the issue's repro shapes as auto-approved cases plus keep-blocked guards;go test ./internal/sandbox/andtask precommit:runare green. Board item moved In progress → QA. Docs ticket: inference-gateway/docs#1232 (docs/tools-reference.md "Paths stay inside the sandbox" overstates what gets blocked now); upstream-tracking note on thegh api '?user/repos...'allow entry that can't match its own quoted shape is in the PR body.Skipped: glued
-q'.filter'/--jq=...values,gh apiendpoints placed after option flags, and words marking real files such as/usr/bin/flox(that is a file the command opens - still asks by policy). Risk: if a repo's allow-listedgitsubcommand takes a file operand immediately after bare-m, that word would no longer be path-checked.Model:
ollama_cloud/glm-5.3-flash· Action:v0.59.8· CLI:v0.261.0· Gateway:v0.67.0· Exit Code:0· Duration: 7m 11sTokens: 2,852,805 in · 39,284 out · 2,892,089 total (37 requests)
Tool calls: 41 total · 100% success rate
Traces
Stats
Triggered by edenreich · Infer Action · OSS
inference-gateway-releaser commentedon Nov 16, 2026
🎉 This issue has been resolved in version 0.262.0 🎉
The release is available on:
Your semantic-release bot 📦🚀