Most agents evaluate deny before ask before allow, and match a rule by tool name plus a pattern for the command, path, domain or MCP tool. Small details matter, such as how compound shell commands, wrappers, redirects and symlinks are matched. Read each vendor's matching rules before you trust a pattern to block what you intend.
Read in this order
- OfficialClaude Code: Configure permissions (rule syntax)Start here: precedence order and pattern syntax, including compound commands.
- OfficialGemini CLI: Policy engineHow Gemini CLI writes and orders policy rules, for side-by-side comparison.
- OfficialCodex: RulesCodex's command-level allow, prompt and forbid decisions, with matching rules.