Skip to content

Commit be3b4c5

Browse files
fix: align tool allow lists with gh-aw (#279)
* fix: align tool allow lists with gh-aw - 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> * fix: address review feedback on tool allow list comments - 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> * fix: address remaining review feedback on tool allow lists - 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> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 784de06 commit be3b4c5

3 files changed

Lines changed: 204 additions & 115 deletions

File tree

AGENTS.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -393,24 +393,20 @@ The `tools` field controls which tools are available to the agent. Both sub-fiel
393393

394394
#### Default Bash Command Allow-list
395395

396-
When `tools.bash` is omitted, the agent can invoke the following shell commands:
397-
398-
```
399-
cat, date, echo, grep, head, ls, pwd, sort, tail, uniq, wc, yq
400-
```
396+
When `tools.bash` is omitted, the agent defaults to **unrestricted bash access** (`--allow-all-tools`). This matches gh-aw's sandbox behavior — since ado-aw agents always run inside the AWF sandbox, all tools are allowed by default.
401397

402398
#### Configuring Bash Access
403399

404400
```yaml
405-
# Default: safe built-in command list (bash field omitted)
401+
# Default: unrestricted bash access (bash field omitted → --allow-all-tools)
406402
tools:
407403
edit: true
408404
409-
# Unrestricted bash access (use with caution)
405+
# Explicit unrestricted bash (same as default) — also accepts "*"
410406
tools:
411407
bash: [":*"]
412408
413-
# Explicit command allow-list
409+
# Explicit command allow-list (restricts to named commands only)
414410
tools:
415411
bash: ["cat", "ls", "grep", "find"]
416412
@@ -637,8 +633,10 @@ Should be replaced with the human-readable name from the front matter (e.g., "Da
637633
Additional params provided to copilot CLI. The compiler generates:
638634
- `--model <model>` - AI model from `engine` front matter field (default: claude-opus-4.5)
639635
- `--no-ask-user` - Prevents interactive prompts
640-
- `--allow-tool <tool>` - Explicitly allows specific tools (github, safeoutputs, write, shell commands like cat, date, echo, grep, head, ls, pwd, sort, tail, uniq, wc, yq)
641636
- `--disable-builtin-mcps` - Disables all built-in Copilot CLI MCPs (single flag, no argument)
637+
- `--allow-all-tools` - When bash is omitted (default) or has a wildcard (`":*"` or `"*"`), allows all tools instead of individual `--allow-tool` flags
638+
- `--allow-tool <tool>` - When bash is NOT wildcard, explicitly allows configured tools (github, safeoutputs, write, and shell commands from the `bash:` field plus any runtime-required commands)
639+
- `--allow-all-paths` - When `edit` tool is enabled (default), allows the agent to write to any file path
642640

643641
MCP servers are handled entirely by the MCP Gateway (MCPG) and are not passed as copilot CLI params.
644642

0 commit comments

Comments
 (0)