mirror of
https://github.com/zed-industries/zed.git
synced 2026-06-01 03:14:56 +07:00
This builds on https://github.com/zed-industries/zed/pull/46112 (which should be merged first) and adds the permission evaluation logic and integrates it with the terminal tool as part of the tool permissions feature. This is a separate PR for [stacked diffs](https://newsletter.pragmaticengineer.com/p/stacked-diffs) to make review easier. ## Changes - **Add `tool_permissions.rs`** with `decide_permission()` function that implements: - `deny > confirm > allow` precedence hierarchy (security-critical) - Case-sensitive and case-insensitive regex matching - Integration with existing `always_allow_tool_actions` setting - Comprehensive unit tests (15 tests) - **Integrate with terminal tool**: - Commands matching deny rules are blocked immediately with an error - Commands matching allow rules proceed without confirmation dialog - Commands requiring confirmation show the dialog as before - Added integration tests for deny and allow rule scenarios Co-Authored-By: Claude Opus 4.5 Release Notes: - N/A --------- Co-authored-by: Amp <amp@ampcode.com> |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| LICENSE-GPL | ||