Skip to content

Replace always_allow_tool_actions with tool_permissions.default#48553

Merged
rtfeldman merged 26 commits intomainfrom
pr/tool-permissions-schema-redesign
Feb 10, 2026
Merged

Replace always_allow_tool_actions with tool_permissions.default#48553
rtfeldman merged 26 commits intomainfrom
pr/tool-permissions-schema-redesign

Conversation

@rtfeldman
Copy link
Contributor

@rtfeldman rtfeldman commented Feb 6, 2026

Screenshot 2026-02-10 at 6 55 03 PM Screenshot 2026-02-10 at 6 55 15 PM

Replaces the boolean always_allow_tool_actions setting with a three-valued tool_permissions.default field ("allow" / "confirm" / "deny").

Release Notes:

  • Introduced per-tool permission settings, including regexes for controlling when tools may be auto-allowed, auto-denied, or always require confirmation.
  • Replaced the always_allow_tool_actions setting with tool_permissions.default.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Feb 6, 2026
@zelenenka zelenenka added the staff Pull requests authored by a current member of Zed staff label Feb 6, 2026
@rtfeldman rtfeldman force-pushed the pr/tool-permissions-schema-redesign branch from 0ceb5f2 to 12396ad Compare February 7, 2026 04:00
@rtfeldman rtfeldman changed the base branch from main to pr/acp-tool-permissions February 7, 2026 04:00
- Add copy_path tool to permissions configuration
- Replace local RuleType enum with ToolPermissionMode from settings crate
- Improve rule summary display (singular "1 rule", show invalid count)
- Add terminal command parsing preview (using extract_commands to match engine behavior)
- Add verdict label showing authoritative permission decision
- Log disagreements between pattern preview and engine verdict
- Display invalid regex patterns section with error details
- Add regex validation error banner with dismiss action
- Add compile-time validated tool_index for macro-generated render functions
- Update SettingsInputField with clear_on_confirm and editor reconciliation fix
- Rename "Configure Tool Rules" to "Tool Permissions" in navigation
- Update move_path/copy_path regex explanations for multi-input tools
- Add test validating all tools have ToolInfo entries or exclusions
@rtfeldman rtfeldman closed this Feb 9, 2026
@rtfeldman rtfeldman reopened this Feb 9, 2026
@rtfeldman rtfeldman force-pushed the pr/tool-permissions-schema-redesign branch 3 times, most recently from cfdc048 to fad4554 Compare February 9, 2026 15:47
… message

Instead of displaying the raw regex patterns (which are very long and
hard to read), show a concise human-readable message:
  `rm -rf` on `/`, `~`, `$HOME`, `.`, and `..` are always blocked.

The backtick-delimited code spans are rendered with code background
highlighting using StyledText. The same message is shown when the
verification section detects a hardcoded security rule denial.
@rtfeldman rtfeldman force-pushed the pr/tool-permissions-schema-redesign branch from fad4554 to 7ab9b18 Compare February 9, 2026 15:53
with_default_highlights expects non-overlapping sorted ranges. The
whole-range color highlight overlapped with the code span highlights,
causing 'invalid text run' panic. Set text color on parent div instead.
with_default_highlights captures the text style eagerly at call time,
before the parent div's .text_color() takes effect during layout.
Switch to with_highlights which defers to layout time, so the text
color set on the parent div is properly inherited.
- Add global default permission mode to tool_permissions settings
- Change per-tool default_mode to optional default (falls back to global)
- Change ToolPermissionContext inputs from single string to Vec<String>
- Add settings migration (m_2026_02_04) for old → new schema
- Add restore_file_from_disk tool permission support
- Remove always_allow_tool_actions setting
- Add global default mode selector to settings UI
- Update documentation
@rtfeldman rtfeldman force-pushed the pr/tool-permissions-schema-redesign branch from 7ab9b18 to 4ae7f38 Compare February 9, 2026 20:42
@rtfeldman rtfeldman changed the base branch from pr/acp-tool-permissions to pr/tool-permissions-settings-ui-improvements February 9, 2026 20:45
Base automatically changed from pr/tool-permissions-settings-ui-improvements to main February 10, 2026 15:30
rtfeldman and others added 10 commits February 10, 2026 10:50
…chema-redesign

# Conflicts:
#	crates/agent/src/tests/mod.rs
#	crates/agent/src/tools/subagent_tool.rs
#	crates/settings_ui/src/pages/tool_permissions_setup.rs
- Create dedicated docs/src/ai/tool-permissions.md reference page
- Add cross-links from SUMMARY, overview, privacy-and-security, agent-panel, mcp
- Simplify inline tool permissions docs in agent-settings.md (link to new page)
- Add restore_file_from_disk, save_file, subagent to tools.md
- Fix model name (gpt-5-mini), font size setting name (agent_ui_font_size),
  single_file_review default (true), model_parameters JSON wrapping
- Clarify that per-tool regex patterns only apply to native Zed agent
- Add doc comments on ToolPermissions::default field
- Reject empty regex patterns in compile_regex_rules (security fix)
- Expand tool permissions documentation (agent-settings.md, agent-panel.md, mcp.md)
- Update settings content doc comments and default.json comments
- Add tests: empty regex validation, default.json parsing, explicit global default, precedence
- Replace .ok()/let _ = with .log_err() in visual_test_runner.rs
- Add doc comments on HardcodedSecurityRules and clarifying test comments
…laude Code and Codex

When always_allow_tool_actions was true, also set:
- agent_servers.claude.default_mode = "bypassPermissions"
- agent_servers.codex.default_mode = "full-access"

This preserves the auto-accept behavior for ACP agents that was
previously provided by always_allow_tool_actions. Without this,
users who had always_allow_tool_actions: true would be prompted for
every ACP agent tool call after the migration, since the new
tool_permissions.default setting only applies to Zed's built-in agent.
Replace convoluted std::mem::take + unwrap_or_default + unreachable!
pattern with direct pattern matching. Drop the entry API in favor of
a matches! check for absent/null followed by get_mut, making the flow
linear and eliminating the intermediate null insertion.
The migrate_tool_permission_defaults migration no longer touches
agent_servers, so remove agent_servers from expected test outputs
where it wasn't in the input, and update comments accordingly.
@rtfeldman rtfeldman marked this pull request as ready for review February 10, 2026 23:56
@rtfeldman rtfeldman merged commit de213ad into main Feb 10, 2026
28 checks passed
@rtfeldman rtfeldman deleted the pr/tool-permissions-schema-redesign branch February 10, 2026 23:57
morgankrey added a commit that referenced this pull request Feb 14, 2026
This is an experiment showing what the docs-suggest workflow would have
generated for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
morgankrey added a commit that referenced this pull request Feb 14, 2026
This is an experiment showing what the docs-suggest workflow would have
generated for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
morgankrey added a commit that referenced this pull request Feb 14, 2026
This is an experiment showing what the docs-suggest workflow would have
generated for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
morgankrey added a commit that referenced this pull request Feb 14, 2026
Example output showing what the docs-suggest automation would generate
for the v0.224 preview release.

PRs analyzed:
- #48118: Forward ZED_ env vars to flatpak (no docs needed)
- #48467: Move update button to title bar (docs needed)
- #48553: Tool permissions refactor (docs exist, wrong format)
- #48592: vim :bdelete command (docs needed)
- #48814: Devcontainer root support (docs needed)
- #48912: Split diff default (docs needed)

5 of 6 PRs generated actionable suggestions.

Files:
- docs/.suggestions/v0.224-suggestions.md: Raw suggestion output
- docs/src/update.md: Update notification UI documentation
- docs/src/vim.md: Added :bdelete command
- docs/src/dev-containers.md: Root config file location support

Co-authored-by: factory-droid[bot] <138933559+factory-droid[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cla-signed The user has signed the Contributor License Agreement staff Pull requests authored by a current member of Zed staff

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants