agent-settings.md

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