OmniscioGuidesPermission rulesDocker
Claude Code permissions for docker commands
Container work is mostly read and build, with one moment that deserves a look: something starting or leaving. This block approves the read and build verbs, asks before a container starts or an image is pushed, and refuses two destructive forms.
Checked on November 27, 2026 against the Claude Code 2.1.332 documentation. By the Omniscio team. Updated .
The block
{
"permissions": {
"allow": [
"Bash(docker build *)",
"Bash(docker compose build *)",
"Bash(docker ps *)",
"Bash(docker logs *)",
"Bash(docker images *)"
],
"ask": [
"Bash(docker run *)",
"Bash(docker compose up *)",
"Bash(docker push *)"
],
"deny": [
"Bash(docker system prune *)",
"Bash(docker rm -f *)"
]
}
}Read it in three tiers. Build, list and read the local state without a prompt. Ask when a container starts or an image leaves the machine. Refuse the system prune that deletes unused data and the removal that skips confirmation.
Because deny is evaluated first, a deny rule beats an ask or allow rule for the same call. Because a compound command needs every part allowed, docker build . && docker push still asks at the push.
What each rule matches
| Rule | Matches | Does not match |
|---|---|---|
Bash(docker build *) | docker build ., docker build -t app:dev ., and bare docker build | docker buildx bake, because the text after docker is not build |
Bash(docker compose build *) | docker compose build, docker compose build api | docker-compose build, the older standalone program |
Bash(docker compose up *) | docker compose up, docker compose up -d api | docker compose down |
Bash(docker ps *) | docker ps, docker ps -a | docker port |
Bash(docker logs *) | docker logs api, docker logs -f api | docker log, which is not a command |
Bash(docker images *) | docker images, docker images --filter dangling=true | docker image rm app:dev, which deletes one |
Bash(docker run *) | docker run image, docker run -p 8080:80 image | docker create, which makes a container without starting it |
Bash(docker push *) | docker push app:dev, docker push registry.example.com/app:dev | docker pull app:dev |
Bash(docker system prune *) | docker system prune, docker system prune -a | docker image prune, a different scope |
Bash(docker rm -f *) | docker rm -f api, docker rm -f api worker | docker rm api, which refuses a running container unless -f is given |
A * stands in for any text, including spaces, and one with a space before it also matches the bare command. That is why Bash(docker build *) covers a plain docker build as well as one carrying flags.
Why not one rule for docker
A rule is matched as written, so Bash(docker *) covers every docker verb, including the ones this block refuses. Nothing in the rule narrows the verb, which is why the block names each subcommand instead.
docker exec is the sharper reason to name verbs. Anthropic lists the development runners that are not stripped before matching, and docker exec is one of them. A rule like Bash(docker exec *) matches whatever command comes after exec, so the inner command is the one a rule has to name.
The same pattern of space matters at the end. Bash(docker*) with no space matches docker push and also a command that merely begins with the letters, such as docker-compose up. Bash(docker *) requires the space.
The docker command a rule does not catch
A Bash rule matches the command text Claude writes, so it covers the docker invocation Claude usually produces. It does not match the same program reached another way: a full path to the binary, a wrapper not on the stripped list, or a shell reached through sh -c is a different text.
When the restriction has to hold, the two tools Anthropic names are the sandbox, for operating-system enforcement, and a PreToolUse hook, which can inspect the full command before it runs. The rules here are for removing prompts on the verbs you already trust.
A read-only docker command such as docker ps is in the built-in read-only set, with one exception: it prompts when a flag selects another daemon, such as -H or --context. Podman's --url and --connection flags get the same treatment.
Where the block goes
Commit it at .claude/settings.json if the team agrees, or keep it in ~/.claude/settings.json for every project. In a project file, the allow rules wait until the folder is trusted, while the ask and deny rules apply at once.
For one session, --allowedTools "Bash(docker build *)" adds an allow rule without editing a file, and --disallowedTools "Bash(docker push *)" turns the push prompt into a refusal. A deny rule from any settings file still outranks the flag.
Confirm it took effect
- Run
/permissionsand check that the five allow rules, the three ask rules and the two deny rules are listed, with the settings file that supplied each. - Ask Claude to run
docker build .. No prompt. - Ask it to run
docker push app:dev. A prompt, or a refusal if you moved push to deny. - Ask it to run
docker system prune -a. Refused.
A saved edit reaches a running session without a restart. /status lists the settings files that loaded, and claude doctor lists entries Claude Code rejected.
The mistakes that make a docker rule misfire
- One broad rule.
Bash(docker *)approves push and prune too, and earns a startup warning. - A wildcard on a runner.
Bash(docker exec *)approves whatever comes after exec, because the runner is not stripped. - No space before the wildcard.
Bash(docker*)also matchesdocker-composeand any other command that starts with those letters. - Expecting the rule to follow the binary. A full path to docker, or
sh -caround the command, is a different text and is not matched.
The other new pages
Each page carries a complete block, not a fragment. The hub lists all ten.
Where Omniscio fits
Omniscio is a desktop app for running several Claude Code agents side by side in one window. The rules on this page are Claude Code's own and apply inside an Omniscio session, because each session runs Claude Code.
Where these answers come from
- Configure permissions, for Bash matching, the wildcard warnings, the runner list, the read-only set and the form a rule does not catch. Read November 27, 2026.
- Settings reference, for the permission keys.
- CLI reference, for
--allowedToolsand--disallowedTools. - The changelog, release 2.1.332, dated November 25, 2026.
Common questions
Does Bash(docker *) allow docker push as well?
It would, which is why the block names each subcommand instead. A wildcard after the program approves everything the program can do. A deny or ask rule naming a subcommand still wins over the broad allow, but the list of approved verbs is invisible until you read it.
Why does docker run ask instead of running?
A docker run command carries flags a short rule does not inspect, so the block leaves it in the ask list where the whole command is visible before it runs.
Does a rule on docker exec cover the command inside it?
Not in the way you might expect. docker exec is one of the runners Anthropic lists as not stripped before matching, so a wildcard rule on it approves whatever command comes after exec. Name the inner command as well, or leave exec out of the allow list.
Do docker ps and docker logs need a rule at all?
The built-in read-only set includes read-only forms of docker, so they usually run without a prompt already. The rules here make the intent explicit and cover the flag forms, and a docker command that selects another daemon with -H or --context prompts even when the subcommand is read-only.