Feature Request: Granular Agent Tool Permission Controls #34475
Replies: 11 comments 3 replies
|
There is definitely room for improvement/enhancement for how tool permissions are handled. I'm not sure whether simple text/regex/glob based rules are up to the task. The requirement for users to manually compose/test/modify these statements to control this feature raises some pretty clear UX concerns. There are also very real concerns with how to match pipelines, chained commands, file redirections, variable interpolation, shell script execution, etc. And for that I think we would need to actually parse all the commands (and support multiple shell dialects). I'm not sure the best path forward but would love to capture some of the prior art used by other editors. Thanks for reporting. |
|
I haven't used other "art" that addresses this problem well, but I would really like to have a solution in Zed. Would it be possible to model a command as an array of strings (as passed to execve) rather than a string of shell commands (as passed to This may seem like a major constraint, but if the agent is going to have the command auto-approved, it could potentially combine commands itself (if command A files, run command B). Also, a user could write a wrapper script to perform common operations and supporting a small number of parameters, encapsulating things like |
|
Alternatively, matching the full string with a small collection of regex-like macros might be adequate. For example, if the user is asked for permission to allow |
|
One more idea that could work for more than just shell scripts: Instead of giving find-grain permissions for a particular category of tool (such as the ones that run shell commands), how about making it really easy for a user to create a very narrow custom tool that is implemented in terms of the original tool the model tried to use, and then always grant access to that specialized tool? For example, if the model tries to use the command tool to run Although the example is again with shell commands, the general idea could be applied to tools that do other things -- making HTTP requests, creating objects in a database, etc. The idea more decoupled from the specific shell command use-case. (If the user could open the specification for the parameter mapping in a Zed buffer, specified as markdown or yaml, then they could get an agent's help in refining and maintaining it.) |
|
This is proving to be more necessary than anything to have in Zed. So both the rules need to be followed and passed to the LLM and we need tool level ACL. |
|
CLine simply added another section into each MCP configuration, called Simply allowing to specify auto-approved tools in the config would be a massive improvemnet. Even if this is not exposed in the UI, i.e. there is no button to click that allows certain action for a certain tool. |
|
For inspiration, opencode configuration example: "permission": {
"bash": {
"find *": "allow",
"git diff *": "allow",
"git log *": "allow",
"git status *": "allow",
"git show *": "allow",
"grep *": "allow",
"ls *": "allow",
"pwd": "allow",
"which *": "allow",
"*": "ask",
},
"edit": "ask",
"glob": "allow",
"grep": "allow",
"list": "allow",
"lsp": "allow",
"patch": "ask",
"question": "allow",
"read": {
"*": "allow",
"*.env": "deny",
"*.env.*": "deny",
"*.envrc": "deny",
"*.envrc.*": "deny",
"*.env.example": "allow",
},
"skill": "allow",
"task": "ask",
"todoread": "allow",
"todowrite": "allow",
"webfetch": "ask",
"write": "ask",
// mcp
"context7_*": "ask",
"exa_*": "ask",
"pw_*": "ask",
}, |
|
Hey @l4b4r4b4b4 - stable v0.221.4 adds more granular permissions via: I think this covers most of what was mentioned here, but feel free to open another discussion if there are other things you want us to consider here. |
TitleFeature Request: Add a Dedicated "Permissions" Tab in Agent Settings for Structured UI-Based Control Description / Rationale1. Proposed FeatureAdd a dedicated "Permissions" tab under Zed's Agent Settings ( 2. Why This Is Needed
3. Key UI Elements Suggested
|



Uh oh!
There was an error while loading. Please reload this page.
Feature Request: Granular Agent Tool Permission Controls
Summary
Currently, Zed Editor provides an all-or-nothing approach to agent tool permissions where users can either:
Feature Request
I would like to request more granular control over the 'Always Allow' functionality, specifically:
1. Command-Specific Permissions
ls,cat,grep)2. Tool-Specific Permissions
read_file,write_file)3. Pattern-Based Permissions
ping *,npm install *)4. Always Deny Rules
Use Cases
Developer Workflow
ls,cat,grep,findread_filerm,write_file,terminalwith destructive commandsSecurity-Conscious Users
rm -rf,sudo,curlto external siteshead,tail,wcProductivity Enhancement
Suggested Implementation
UI Enhancements
Configuration File
{ "agent_permissions": { "rules": [ { "pattern": "ping *", "type": "command", "action": "always_allow" }, { "pattern": "read_file", "type": "tool", "action": "always_allow" }, { "pattern": "rm -rf *", "type": "command", "action": "always_deny" } ] } }Benefits
Related Issues
This builds upon the existing agent tool permission system and would enhance issues like:
Environment
Would love to hear thoughts from the community and maintainers on this feature request!
All reactions