zed/docs/src/ai
Kirill Bulatov f21cec7cb1
Introduce worktree trust mechanism (#44887)
Closes https://github.com/zed-industries/zed/issues/12589 

Forces Zed to require user permissions before running any basic
potentially dangerous actions: parsing and synchronizing
`.zed/settings.json`, downloading and spawning any language and MCP
servers (includes `prettier` and `copilot` instances) and all
`NodeRuntime` interactions.
There are more we can add later, among the ideas: DAP downloads on
debugger start, Python virtual environment, etc.

By default, Zed starts in restricted mode and shows a `! Restricted
Mode` in the title bar, no aforementioned actions are executed.
Clicking it or calling `workspace::ToggleWorktreeSecurity` command will
bring a modal to trust worktrees or dismiss the modal:

<img width="1341" height="475" alt="1"
src="https://github.com/user-attachments/assets/4fabe63a-6494-42c7-b0ea-606abb1c0c20"
/>

Agent Panel shows a message too:

<img width="644" height="106" alt="2"
src="https://github.com/user-attachments/assets/0a4554bc-1f1e-455b-b97d-244d7d6a3259"
/>

This works on local, SSH and WSL remote projects, trusted worktrees are
persisted between Zed restarts.
There's a way to clear all persisted trust with
`workspace::ClearTrustedWorktrees`, this will restart Zed.

This mechanism can be turned off with settings:
```jsonc
"session": {
  "trust_all_worktrees": true
}
```
in this mode, all worktrees will be trusted by default, allowing all
actions, but no auto trust will be persisted: hence, when the setting is
changed back, auto trusted worktrees will require another trust
confirmation.

This settings switch was added to the onboarding view also.

Release Notes:

- Introduced worktree trust mechanism, can be turned off with
`"session": { "trust_all_worktrees": true }`

---------

Co-authored-by: Matt Miller <mattrx@gmail.com>
Co-authored-by: Danilo Leal <daniloleal09@gmail.com>
Co-authored-by: John D. Swanson <swanson.john.d@gmail.com>
2025-12-16 20:34:00 +02:00
..
agent-panel.md docs: Improve content in /ai/agent-panel and /ai/rules (#42055) 2025-11-06 01:18:55 -03:00
agent-settings.md docs: Improve the Inline Assistant content (#41566) 2025-10-30 13:53:31 +00:00
ai-improvement.md Update docs for Gemini ZDR (#42697) 2025-11-14 00:22:20 -06:00
billing.md docs: Update links to account page (#44924) 2025-12-15 22:11:42 +00:00
configuration.md docs: Reorganize introduction (#41387) 2025-10-28 17:39:40 -03:00
edit-prediction.md editor: Accept next line prediction (#44411) 2025-12-15 18:28:59 +00:00
external-agents.md docs: Point to the right URL for Gemini CLI (#43239) 2025-11-21 07:23:43 -05:00
inline-assistant.md docs: Improve the Inline Assistant content (#41566) 2025-10-30 13:53:31 +00:00
llm-providers.md language_models: Add auto_discover setting for Ollama (#42207) 2025-12-16 09:11:10 +01:00
mcp.md mcp: Fix source property showing up as undefined in settings (#43417) 2025-11-25 16:03:21 +00:00
models.md Opus 4.5 and Gemini 3 to docs (#43424) 2025-11-24 13:38:14 -06:00
overview.md docs: Add section about MCP servers with external agents (#40658) 2025-10-20 09:11:11 -03:00
plans-and-usage.md docs: Update links to account page (#44924) 2025-12-15 22:11:42 +00:00
privacy-and-security.md Introduce worktree trust mechanism (#44887) 2025-12-16 20:34:00 +02:00
rules.md docs: Improve content in /ai/agent-panel and /ai/rules (#42055) 2025-11-06 01:18:55 -03:00
subscription.md Docs updates September (#38796) 2025-09-24 11:10:58 -05:00
text-threads.md docs: Improve content about text threads vs. threads (#43688) 2025-11-27 20:49:05 +00:00
tools.md docs: Update agent tools page (#42271) 2025-11-08 12:54:42 -03:00