File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -150,6 +150,27 @@ Plan Mode's default tool restrictions are managed by the
150150but you can customize these rules by creating your own policies in your
151151` ~/.gemini/policies/ ` directory (Tier 2).
152152
153+ #### Global vs. mode-specific rules
154+
155+ As described in the
156+ [ policy engine documentation] ( ../reference/policy-engine.md#approval-modes ) , any
157+ rule that does not explicitly specify ` modes ` is considered "always active" and
158+ will apply to Plan Mode as well.
159+
160+ If you want a rule to apply to other modes but _ not_ to Plan Mode, you must
161+ explicitly specify the target modes. For example, to allow ` npm test ` in default
162+ and Auto-Edit modes but not in Plan Mode:
163+
164+ ``` toml
165+ [[rule ]]
166+ toolName = " run_shell_command"
167+ commandPrefix = " npm test"
168+ decision = " allow"
169+ priority = 100
170+ # By omitting "plan", this rule will not be active in Plan Mode.
171+ modes = [" default" , " autoEdit" ]
172+ ```
173+
153174#### Example: Automatically approve read-only MCP tools
154175
155176By default, read-only MCP tools require user confirmation in Plan Mode. You can
You can’t perform that action at this time.
0 commit comments