Block a specific command even when a broader rule allows related commands.

Section: Permissions, tools, paths, and URLs

Deny a dangerous shell action

bash
bash
copilot --allow-tool="shell(git:*)" --deny-tool="shell(git push)"
Explanation

Deny rules take precedence over allow rules, which is ideal for guardrails.

Learn the surrounding workflow

Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.

Related commands

Same sheet · prioritizing Permissions, tools, paths, and URLs
Allow specific shell commands only
Permit a narrow shell tool pattern.
OpenIn sheetbashsame section
Allow all tools, paths, and URLs
Disable approval prompts for the whole run.
OpenIn sheetbashsame section
Allow all tools automatically
Skip confirmation for tool use.
OpenIn sheetbashsame section
Add an allowed directory
Grant file access to an extra path.
OpenIn sheetbashsame section
Allow a specific domain
Trust a URL or domain without prompts.
OpenIn sheetbashsame section
Block a specific URL or domain
Prevent access to sites you do not want queried.
OpenIn sheetbashsame section