github / github/copilot-cli

--allow-tool='shell(docker ps)' doesn't work

Offen
#2,610 0 Kommentare 4 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
area:permissions area:tools
Vorherrschende Sprache
Shell
Sterne
11.2k
Forks
1.9k
Ø Merge
14 Std. 16 Min.
Gemergte PRs (30 T.)
6

Beschreibung

### Describe the bug

https://docs.github.com/en/copilot/reference/copilot-cli-reference/cli-command-reference#tool-permission-patterns - documentation mentions `shell(git push)` as an example pattern for --allow-tool. This seems to imply that there's a flexible mechanism for allowing subcommands (we don't have to allow all `git` commands, we can pick specific subcommands like `git push` to allow).

This does work for `git` (I tested it with `git status`) but doesn't work for other commands. For example:
```copilot --model gpt-5-mini --allow-tool='shell(docker ps)' -p 'Run this command in Bash: `docker ps`'```

This doesn't work. Same with `shell(docker ps:*)`

### Affected version

GitHub Copilot CLI 1.0.21.

### Steps to reproduce the behavior

```copilot --model gpt-5-mini --allow-tool='shell(docker ps)' -p 'Run this command in Bash: `docker ps`'```

### Expected behavior

Expected the `docker ps` command to be allowed to run, without asking for permissions. But instead seeing "Permission denied and could not request permission from user"

### Additional context

_No response_

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Start by reproducing the reported command with GitHub Copilot CLI 1.0.21, comparing shell(git status) with shell(docker ps) and shell(docker ps:*). Read the tool-permission-patterns documentation linked in the issue and trace the permission-pattern handling entry point. Done means the documented docker ps pattern runs without a permission prompt while unrelated commands remain protected.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
docker, shell
Bereich
cli, security
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Ruhig
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
68/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.