fix: align tool allow lists with gh-aw#279
Conversation
- Emit --allow-all-tools when bash wildcard (:* or *) is set, dropping all individual --allow-tool flags (matches gh-aw computeCopilotToolArguments) - Default to --allow-all-tools when bash is not specified (matches gh-aw's applyDefaultTools sandbox behavior — bash: [*] is the default when sandbox is enabled, and ado-aw agents always run in AWF sandbox) - Emit --allow-all-paths when edit tool is enabled (matches gh-aw GetExecutionSteps) - Remove DEFAULT_BASH_COMMANDS constant (no longer the default) - Update tests and AGENTS.md documentation Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Looks good — the logic is correct and well-structured. One subtle behavioral note worth double-checking, and one minor inconsistency in the restricted-bash path. Findings
|
- Add comment noting wildcard+command mixing is unsupported (cmds.len()==1) - Add comment explaining why restricted-bash path emits both --allow-tool write and --allow-all-paths (tool identity vs path scope) - Replace silent vec![] fallback with debug_assert! in unreachable None arm Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Logic is correct and well-structured; one stale documentation section and one weak test assertion worth noting. Findings
|
- Update AGENTS.md copilot_params docs: --allow-all-tools now mentions bash-omitted default, --allow-tool references configured tools instead of deleted DEFAULT_BASH_COMMANDS list - Replace debug_assert!(false, ...) with unreachable!() for the bash=None invariant (idiomatic Rust for proven-unreachable paths) - Strengthen test_copilot_params_custom_mcp_no_mcp_flag assertion to check --allow-tool (not non-existent --mcp flag) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
🔍 Rust PR ReviewSummary: Looks good — clean implementation, well-tested. One minor silent-failure concern worth a compile-time warning. Findings
|
Summary
Aligns the Copilot CLI tool allow list generation (
generate_copilot_params()) with gh-aw's implementation.Changes
Default behavior →
--allow-all-toolsgh-aw's
applyDefaultTools()setsbash: ["*"]when sandbox is enabled and bash isn't specified. Since ado-aw agents always run in AWF sandbox, our default should match. Previously we defaulted to 12 specific shell commands (cat, date, echo, ...); now we default to--allow-all-tools.--allow-all-toolsfor wildcard bashWhen
tools.bashis set to[":*"]or["*"], emit a single--allow-all-toolsflag and drop ALL individual--allow-toolflags. This matches gh-aw'scomputeCopilotToolArguments()which returns early with just["--allow-all-tools"].--allow-all-pathswhen edit is enabledWhen the edit tool is enabled (default), emit
--allow-all-pathsto allow the agent to write to any file path. This matches gh-aw'sGetExecutionSteps()."*"wildcard supportAccept both
"*"and":*"as bash wildcards, matching gh-aw's dual-check pattern.Before / After
tools:(default)--allow-tool github --allow-tool safeoutputs --allow-tool write --allow-tool "shell(cat)" ...--allow-all-tools --allow-all-pathsbash: [":*"]--allow-tool github --allow-tool safeoutputs --allow-tool write --allow-tool "shell(:*)"--allow-all-tools --allow-all-pathsbash: ["cat", "ls"]--allow-tool github ... --allow-tool "shell(cat)" --allow-tool "shell(ls)"--allow-tool github ... --allow-tool "shell(cat)" --allow-tool "shell(ls)" --allow-all-pathsedit: false--allow-tool write--allow-tool write, no--allow-all-pathsTesting
tools: azure-devopsand restricted bash configs