agent-settings.md

  1---
  2title: AI Agent Settings - Zed
  3description: "Customize Zed's AI agent: default models, temperature, tool approval, auto-run commands, notifications, and panel options."
  4---
  5
  6# Agent Settings
  7
  8Settings for Zed's Agent Panel, including model selection, UI preferences, and tool permissions.
  9
 10## Model Settings {#model-settings}
 11
 12### Default Model {#default-model}
 13
 14If you're using [Zed's hosted LLM service](./subscription.md), it sets `claude-sonnet-4-5` as the default model for agentic work (agent panel, inline assistant) and `gpt-5-nano` as the default "fast" model (thread summarization, git commit messages). If you're not subscribed or want to change these defaults, you can manually edit the `default_model` object in your settings:
 15
 16```json [settings]
 17{
 18  "agent": {
 19    "default_model": {
 20      "provider": "openai",
 21      "model": "gpt-4o"
 22    }
 23  }
 24}
 25```
 26
 27### Feature-specific Models {#feature-specific-models}
 28
 29You can assign distinct and specific models for the following AI-powered features:
 30
 31- Thread summary model: Used for generating thread summaries
 32- Inline assistant model: Used for the inline assistant feature
 33- Commit message model: Used for generating Git commit messages
 34
 35```json [settings]
 36{
 37  "agent": {
 38    "default_model": {
 39      "provider": "zed.dev",
 40      "model": "claude-sonnet-4-5"
 41    },
 42    "inline_assistant_model": {
 43      "provider": "anthropic",
 44      "model": "claude-3-5-sonnet"
 45    },
 46    "commit_message_model": {
 47      "provider": "openai",
 48      "model": "gpt-4o-mini"
 49    },
 50    "thread_summary_model": {
 51      "provider": "google",
 52      "model": "gemini-2.0-flash"
 53    }
 54  }
 55}
 56```
 57
 58> If a custom model isn't set for one of these features, they automatically fall back to using the default model.
 59
 60### Alternative Models for Inline Assists {#alternative-assists}
 61
 62With the Inline Assistant in particular, you can send the same prompt to multiple models at once.
 63
 64Here's how you can customize your settings file ([how to edit](../configuring-zed.md#settings-files)) to add this functionality:
 65
 66```json [settings]
 67{
 68  "agent": {
 69    "default_model": {
 70      "provider": "zed.dev",
 71      "model": "claude-sonnet-4-5"
 72    },
 73    "inline_alternatives": [
 74      {
 75        "provider": "zed.dev",
 76        "model": "gpt-5-mini"
 77      }
 78    ]
 79  }
 80}
 81```
 82
 83When multiple models are configured, you'll see in the Inline Assistant UI buttons that allow you to cycle between outputs generated by each model.
 84
 85The models you specify here are always used in _addition_ to your [default model](#default-model).
 86
 87For example, the following configuration will generate three outputs for every assist.
 88One with Claude Sonnet 4.5 (the default model), another with GPT-5-mini, and another one with Gemini 3 Flash.
 89
 90```json [settings]
 91{
 92  "agent": {
 93    "default_model": {
 94      "provider": "zed.dev",
 95      "model": "claude-sonnet-4-5"
 96    },
 97    "inline_alternatives": [
 98      {
 99        "provider": "zed.dev",
100        "model": "gpt-5-mini"
101      },
102      {
103        "provider": "zed.dev",
104        "model": "gemini-3-flash"
105      }
106    ]
107  }
108}
109```
110
111### Model Temperature
112
113Specify a custom temperature for a provider and/or model:
114
115```json [settings]
116{
117  "agent": {
118    "model_parameters": [
119      // To set parameters for all requests to OpenAI models:
120      {
121        "provider": "openai",
122        "temperature": 0.5
123      },
124      // To set parameters for all requests in general:
125      {
126        "temperature": 0
127      },
128      // To set parameters for a specific provider and model:
129      {
130        "provider": "zed.dev",
131        "model": "claude-sonnet-4-5",
132        "temperature": 1.0
133      }
134    ]
135  }
136}
137```
138
139## Agent Panel Settings {#agent-panel-settings}
140
141Note that some of these settings are also surfaced in the Agent Panel's settings UI, which you can access either via the `agent: open settings` action or by the dropdown menu on the top-right corner of the panel.
142
143### Default View
144
145Use the `default_view` setting to change the default view of the Agent Panel.
146You can choose between `thread` (the default) and `text_thread`:
147
148```json [settings]
149{
150  "agent": {
151    "default_view": "text_thread"
152  }
153}
154```
155
156### Font Size
157
158Use the `agent_ui_font_size` setting to change the font size of rendered agent responses in the panel.
159
160```json [settings]
161{
162  "agent_ui_font_size": 18
163}
164```
165
166> Editors in the Agent Panel—such as the main message textarea—use monospace fonts and are controlled by `agent_buffer_font_size` (which defaults to `buffer_font_size` when unset).
167
168### Default Tool Permissions
169
170> **Note:** In Zed v0.224.0 and above, tool approval uses the `agent.tool_permissions` settings described below.
171
172The `agent.tool_permissions.default` setting controls the baseline tool approval behavior for Zed's native agent:
173
174- `"confirm"` (default) — Prompts for approval before running any tool action
175- `"allow"` — Auto-approves tool actions without prompting
176- `"deny"` — Blocks all tool actions
177
178```json [settings]
179{
180  "agent": {
181    "tool_permissions": {
182      "default": "confirm"
183    }
184  }
185}
186```
187
188Even with `"default": "allow"`, per-tool `always_deny` and `always_confirm` patterns are still respected, so you can auto-approve most actions while keeping guardrails on dangerous or sensitive ones.
189
190### Per-tool Permission Rules {#per-tool-permission-rules}
191
192For granular control over individual tool actions, use the `tools` key inside `tool_permissions` to configure regex-based rules that auto-approve, auto-deny, or always require confirmation for specific inputs.
193
194Each tool entry supports the following keys:
195
196- `default` — Fallback when no patterns match: `"confirm"`, `"allow"`, or `"deny"`
197- `always_allow` — Array of patterns that auto-approve matching actions
198- `always_deny` — Array of patterns that block matching actions immediately
199- `always_confirm` — Array of patterns that always prompt for confirmation
200
201```json [settings]
202{
203  "agent": {
204    "tool_permissions": {
205      "default": "allow",
206      "tools": {
207        "terminal": {
208          "default": "confirm",
209          "always_allow": [
210            { "pattern": "^cargo\\s+(build|test|check)" },
211            { "pattern": "^git\\s+(status|log|diff)" }
212          ],
213          "always_deny": [{ "pattern": "rm\\s+-rf\\s+(/|~)" }],
214          "always_confirm": [{ "pattern": "sudo\\s" }]
215        },
216        "edit_file": {
217          "always_deny": [
218            { "pattern": "\\.env" },
219            { "pattern": "\\.(pem|key)$" }
220          ]
221        }
222      }
223    }
224  }
225}
226```
227
228#### Pattern Precedence
229
230When evaluating a tool action, rules are checked in the following order (highest priority first):
231
2321. **Built-in security rules** — Hardcoded protections (e.g., `rm -rf /`) that cannot be overridden
2332. **`always_deny`** — Blocks matching actions immediately
2343. **`always_confirm`** — Requires confirmation for matching actions
2354. **`always_allow`** — Auto-approves matching actions. For the terminal tool with chained commands (e.g., `echo hello && rm file`), **all** sub-commands must match an `always_allow` pattern
2365. **Tool-specific `default`** — Per-tool fallback when no patterns match (e.g., `tools.terminal.default`)
2376. **Global `default`** — Falls back to `tool_permissions.default`
238
239#### Case Sensitivity
240
241Patterns are **case-insensitive** by default. To make a pattern case-sensitive, set `case_sensitive` to `true`:
242
243```json [settings]
244{
245  "agent": {
246    "tool_permissions": {
247      "tools": {
248        "edit_file": {
249          "always_deny": [
250            {
251              "pattern": "^Makefile$",
252              "case_sensitive": true
253            }
254          ]
255        }
256      }
257    }
258  }
259}
260```
261
262#### `copy_path` and `move_path` Patterns
263
264For the `copy_path` and `move_path` tools, patterns are matched independently against both the source and destination paths. A `deny` or `confirm` match on **either** path takes effect. For `always_allow`, **both** paths must match for auto-approval.
265
266#### MCP Tool Permissions
267
268MCP tools use the key format `mcp:<server_name>:<tool_name>` in the `tools` configuration. For example:
269
270```json [settings]
271{
272  "agent": {
273    "tool_permissions": {
274      "tools": {
275        "mcp:github:create_issue": {
276          "default": "confirm"
277        },
278        "mcp:github:create_pull_request": {
279          "default": "deny"
280        }
281      }
282    }
283  }
284}
285```
286
287The `default` key on each MCP tool entry is the primary mechanism for controlling MCP tool permissions. Pattern-based rules (`always_allow`, `always_deny`, `always_confirm`) match against an empty string for MCP tools, so most patterns won't match — use the tool-level `default` instead.
288
289See the [Tool Permissions](./tool-permissions.md) documentation for more examples and complete details.
290
291> **Note:** Before Zed v0.224.0, tool approval was controlled by the `agent.always_allow_tool_actions` boolean (default `false`). Set it to `true` to auto-approve tool actions, or leave it `false` to require confirmation for edits and tool calls.
292
293### Edit Display Mode
294
295Control whether to display review actions (accept & reject) in single buffers after the agent is done performing edits.
296The default value is `false`.
297
298```json [settings]
299{
300  "agent": {
301    "single_file_review": false
302  }
303}
304```
305
306### Sound Notification
307
308Control whether to hear a notification sound when the agent is done generating changes or needs your input.
309The default value is `false`.
310
311```json [settings]
312{
313  "agent": {
314    "play_sound_when_agent_done": true
315  }
316}
317```
318
319### Message Editor Size
320
321Use the `message_editor_min_lines` setting to control the minimum number of lines of height the agent message editor should have.
322It is set to `4` by default, and the max number of lines is always double of the minimum.
323
324```json [settings]
325{
326  "agent": {
327    "message_editor_min_lines": 4
328  }
329}
330```
331
332### Modifier to Send
333
334Require a modifier (`cmd` on macOS, `ctrl` on Linux) to send messages. Prevents accidental sends while editing.
335The default value is `false`.
336
337```json [settings]
338{
339  "agent": {
340    "use_modifier_to_send": true
341  }
342}
343```
344
345### Edit Card
346
347Use the `expand_edit_card` setting to control whether edit cards show the full diff in the Agent Panel.
348It is set to `true` by default, but if set to false, the card's height is capped to a certain number of lines, requiring a click to be expanded.
349
350```json [settings]
351{
352  "agent": {
353    "expand_edit_card": false
354  }
355}
356```
357
358### Terminal Card
359
360Use the `expand_terminal_card` setting to control whether terminal cards show the command output in the Agent Panel.
361It is set to `true` by default, but if set to false, the card will be fully collapsed even while the command is running, requiring a click to be expanded.
362
363```json [settings]
364{
365  "agent": {
366    "expand_terminal_card": false
367  }
368}
369```
370
371### Feedback Controls
372
373Control whether to display the thumbs up/down buttons at the bottom of each agent response, allowing you to give Zed feedback about the agent's performance.
374The default value is `true`.
375
376```json [settings]
377{
378  "agent": {
379    "enable_feedback": false
380  }
381}
382```