Repository navigation
Labels
Description
Summary
The CLI's Bash tool now restricts file-write redirections by default (inference-gateway/cli#613, closes inference-gateway/cli#560). This is a user-facing change to the Bash whitelist policy and should be mirrored on the docs site.
Changed behavior:
- File-write redirections (
>,>>,&>file,>&file) are blocked by default, even for an otherwise-whitelisted command (for exampleecho secret > /etc/passwdis rejected). - A redirection is allowed only when a whitelist pattern matches the entire command. A prefix pattern such as
^git logwill not unlockgit log > file; use an anchored pattern (^...$) to opt one specific redirect in. - Benign redirections that only discard or merge streams (
2>&1,>/dev/null,2>/dev/null) are stripped before matching and remain allowed. - Pipes and chains (
|,&&,||,;) require every segment to be independently whitelisted (existing behavior from fix(tools): make bash whitelist shell-aware to fix benign-command rejections (#581) cli#605). - Command substitution (
$(...), backticks,<(...),>(...)) is always rejected. - A denied command returns explanatory feedback naming the restricted operator and pointing at
tools.bash.whitelist.patterns.
The in-repo docs were updated in the same PR (docs/tools-reference.md Bash Tool section and docs/configuration-reference.md); this ticket tracks reflecting the same content on the docs site.
Affected pages / locations
- Bash tool reference (whitelist / security section).
- Configuration reference (bash whitelist env vars
INFER_TOOLS_BASH_WHITELIST_COMMANDSandINFER_TOOLS_BASH_WHITELIST_PATTERNS).
Example to include
tools:
bash:
whitelist:
patterns:
- ^echo .+ >> /var/log/app\.log$ # allow appending to one specific fileLinks
- Source PR: feat(tools): restrict bash file-write redirects unless whitelisted by pattern cli#613
- Source issue: [FEATURE] Bash pipes or output redirections should be restricted by default cli#560
- Prior context: fix(tools): make bash whitelist shell-aware to fix benign-command rejections (#581) cli#605 (shell-aware matcher)
Acceptance Criteria
- Bash tool docs describe the restricted operators: pipes/chains validated per segment, file-write redirects blocked by default, benign redirects allowed, command substitution rejected
- Documented how to allow a specific redirect via an anchored whitelist pattern, including the YAML example above
- Configuration reference cross-references the policy from the bash whitelist section
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
edenreich commentedon Jun 6, 2026
@infer can you document it? use /maintainer
inference-gateway-maintainer commentedon Jun 6, 2026
Todos
Pull Request
#190
✅ Infer Result: Success
The task is complete. Here's a final checklist against the acceptance criteria:
PR #190 has been created at #190 with all changes on the
docs/bash-whitelist-restricted-operatorsbranch. Bothprettier --checkandmarkdownlintpass cleanly.Model:
ollama_cloud/deepseek-v4-flash· Exit Code:0· View JobTokens: 3,408,227 in · 8,424 out · 3,416,651 total (34 requests)
Tool calls: 38 total · 92% success rate
Closes #188.
Documents the Bash tool's shell-aware whitelist matcher changes from inference-gateway/cli#613 (closes inference-gateway/cli#560).
Changes to `cli.md`
Bash tool reference - Added a Restricted operators section covering:
Essential Environment Variables - Added `INFER_TOOLS_BASH_WHITELIST_COMMANDS` and `INFER_TOOLS_BASH_WHITELIST_PATTERNS` with examples.
Security / Command Whitelisting - Added cross-reference to the restricted operators section.
Source
Agent output (tail)
Triggered by edenreich · Infer Action
docs: document bash whitelist file-write redirect restriction (#190)
chore(release): 🔖 0.6.110 [skip ci]
inference-gateway-releaser commentedon Jun 10, 2026
🎉 This issue has been resolved in version 0.6.110 🎉
The release is available on GitHub release
Your semantic-release bot 📦🚀