Answer: The engine checks a tool call against all active rules starting from the highest priority, and the first rule that matches determines the outcome. A rule matches only if all its conditions are met, including the tool name (with wildcards allowed) and, if specified, the arguments pattern. Status: Confirmed Entry: tool/gemini-cli/permissions-and-security/rule-matching-priority Revision: 1 Digest: sha256:2a974b5948079629 (changes whenever the content changes) Timeline: Created: 2026-11-13T03:18:51Z Last changed: 2026-11-13T03:18:51Z Last verified: 2026-11-20T12:53:37Z Next check: 2026-11-21T12:53:37Z Check interval: Daily Expected change: No fixed schedule Data: Field | Value | Source | As of matching order | starting from the highest priority | [1] | 2026-11-20 conflict resolution | The first rule that matches determines the outcome. | [1] | 2026-11-20 match condition | A rule matches a tool call if all of its conditions are met | [1] | 2026-11-20 tool name condition | The `toolName` in the TOML rule must match the name of the tool being called. | [1] | 2026-11-20 wildcards | `*`, `mcp_server_*`, or `mcp_*_toolName` | [1] | 2026-11-20 arguments pattern | If `argsPattern` is specified, the tool's arguments are converted to a stable JSON string, which is then tested against the provided regular expression. | [1] | 2026-11-20 Sources: [1] Google. "Policy engine". https://geminicli.com/docs/reference/policy-engine.md Role: primary. Accessed: 2026-11-20T12:53:37Z Quote: "the engine checks it against all active rules, starting from the highest priority" (Supports: matching order) Quote: "The first rule that matches determines the outcome." (Supports: conflict resolution) Quote: "A rule matches a tool call if all of its conditions are met" (Supports: match condition) Quote: "The `toolName` in the TOML rule must match the name of the tool being called." (Supports: tool name condition) Quote: "You can use wildcards like `*`, `mcp_server_*`, or `mcp_*_toolName` to match multiple tools." (Supports: wildcards) Quote: "If `argsPattern` is specified, the tool's arguments are converted to a stable JSON string, which is then tested against the provided regular expression." (Supports: arguments pattern) Published: 2026-10-16T02:36:07Z Snapshot SHA-256: 0caa715d2a1a1bc13343b6966177d07538b63b73d3b6436ea9cc3c2b7697adb4 (captured 2026-11-15T12:57:40Z) Verification: Method: Automated extraction from [1] with deepseek-flash (JSON output, thinking disabled). Every value was checked by code to appear verbatim in a quoted passage of [1]. On this check the text of [1] was unchanged since 2026-11-13T03:18:51Z, so the values verified then were kept. Cross-check: not-available at 2026-11-20T12:53:37Z. No independent second source is configured for this entry Last successful check: 2026-11-20T12:53:37Z Last attempt: 2026-11-20T12:53:37Z Notes and limitations: Extracted automatically from a single official source (section "Rule matching"). Related: https://latestn.com/tool/gemini-cli/permissions-and-security/sandbox-expansion-outside-workspace How do I include files outside the workspace in the Gemini CLI sandbox? https://latestn.com/tool/gemini-cli/permissions-and-security/sandbox-proxy-script-setup How do I configure a proxy script for the Gemini CLI sandbox using GEMINI_SANDBOX_PROXY_COMMAND? https://latestn.com/tool/gemini-cli/permissions-and-security/sandboxing-methods Which sandboxing methods does Gemini CLI support on macOS, Linux, and Windows? https://latestn.com/tool/gemini-cli/permissions-and-security/proxy-allowed-domains How do I restrict which domains the Gemini CLI sandbox proxy allows? https://latestn.com/tool/gemini-cli/permissions-and-security/remote-subagent-authentication How do I configure authentication for a remote subagent in Gemini CLI? https://latestn.com/tool/gemini-cli/permissions-and-security/restrict-tool-access How do I restrict which tools Gemini CLI users can access? https://latestn.com/tool/ All entries in AI tools Change log: Time | Event | Change | Source 2026-11-13T03:18:51Z | added | Entry created | — Changes for this entry as a feed: https://latestn.com/tool/gemini-cli/permissions-and-security/rule-matching-priority/latest Challenge this entry: Open challenges: None How: If a value here is wrong or out of date, send what is wrong and a link to evidence. Challenges are queued and checked against the evidence; they do not change the entry by themselves. If the entry changes as a result, the change log says so. Form: https://latestn.com/dispute/tool/gemini-cli/permissions-and-security/rule-matching-priority POST: https://latestn.com/dispute/tool/gemini-cli/permissions-and-security/rule-matching-priority with claim, evidence_url, and optionally field and contact (form-encoded or JSON) GET: https://latestn.com/dispute/tool/gemini-cli/permissions-and-security/rule-matching-priority?claim={what is wrong}&evidence_url={link} How to cite: LatestN. (2026). How does Gemini CLI match policy rules and resolve conflicts using priority tiers? Revision 1, last verified 2026-11-20T12:53:37Z. https://latestn.com/tool/gemini-cli/permissions-and-security/rule-matching-priority (accessed 2026-11-21T09:58:43Z). @misc{LatestN_tool_gemini_cli_permissions_and_security_rule_matching_priority_r1, title = {How does Gemini CLI match policy rules and resolve conflicts using priority tiers?}, author = {{LatestN}}, year = {2026}, howpublished = {\url{https://latestn.com/tool/gemini-cli/permissions-and-security/rule-matching-priority}}, note = {Revision 1; digest sha256:2a974b5948079629; last verified 2026-11-20T12:53:37Z; accessed 2026-11-21T09:58:43Z} } Reuse: License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/) Attribution: Copying and adapting are allowed, including commercially, if you credit LatestN and link to the entry you used. Each entry ends with a ready-made citation. URL: https://latestn.com/tool/gemini-cli/permissions-and-security/rule-matching-priority