You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Agent should request permission before reading or editing files #3205
Currently, when using the OpenCode agent, it automatically reads or edits project files without explicitly asking for permission from the user.
For better transparency and safety — especially when working on unfamiliar or sensitive codebases — the agent should prompt the user for permission at least the first time it tries to:
Read files from the workspace
Modify or create new files
Expected Behavior
When the agent first attempts to read or edit files, it should show a confirmation prompt (e.g., “The agent wants to read files in /src — allow?”).
Optionally, provide a “remember this decision” checkbox or configuration setting.
Actual Behavior
The agent proceeds to read or modify files without any confirmation.
Sometimes it also edits unnecessary files without being explicitly instructed to do so.
This issue might be a duplicate of existing issues. Please check:
Feature Request: Add Prefix Requirements for Permission Prompts #2521: Feature Request: Add Prefix Requirements for Permission Prompts - discusses adding confirmation prompts for sensitive operations to prevent accidental approvals, similar to your request for permission prompts before file access
Read permissions, mcp permissions, and more are coming soon
Out of curiosity, why did you choose the unsafe option (off by default) over explicitly requesting permissions?
YOLO mode seems like something that really shouldn't be the default...
I wasn't a part of the decision making process it was prior to me joining the team, so I just wanna reference what Dax said directly.
That said, I do think there users who do not like this default and I was thinking we could solve it in one of the following ways:
make it easier to toggle permissions (similar to claude code how you can hit tab to switch between yolo and not << our keybind would be different but you get the idea)
possibly prompt user when they first run opencode, or maybe first time they run it in a new dir
I think I prefer option 1 ^ and then we could just save whatever mode you were last in so that you don't have to toggle all the time
I think that would be super cool. Is any active work being done on this or is it open to pick up? I know you guys are redesigning the TUI completely, not sure if this was already considered
I think any work on it would be best done once the new rewrite at least launches in beta which should be super soon. But doesn't hurt to talk about it rn
And we would probably have some input on UX, do you have any ideas on how you think it should work?
Okay yeah sounds good. I guess since it's something that will only be used for build mode, maybe it's a toggle-able text field underneath build mode. Starts off with approve: auto and like shift-tab to turn it into approve: manual? One drawback I can see is that it might make that section of the UI more cluttered, but on the other hand you can look at one section and see exactly what mode (plan/build) and what mode (auto/manual) you're on.
Probably could also allow users to set up custom configs so like write allowed, bash not allowed, and it's just config files linked to the build option?
Probably could also allow users to set up custom configs so like write allowed, bash not allowed, and it's just config files linked to the build option?
Yes, but I am thinking they could maybe save these configs and cycle through them in any directory. So almost global configs which they can use anywhere
Activity
github-actions commentedon Oct 16, 2025
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
rekram1-node commentedon Oct 16, 2025
@rahulsan008 we have a permissions system, it is off by default intentionally.
Here are the docs: https://opencode.ai/docs/permissions/#_top
Sounds like you'd like the following:
Read permissions, mcp permissions, and more are coming soon
jamesforwardnwboxed commentedon Oct 17, 2025
Out of curiosity, why did you choose the unsafe option (off by default) over explicitly requesting permissions?
YOLO mode seems like something that really shouldn't be the default...
rekram1-node commentedon Oct 17, 2025
@jamesforwardnwboxed here is a discussion about it: #2632 (comment)
I wasn't a part of the decision making process it was prior to me joining the team, so I just wanna reference what Dax said directly.
That said, I do think there users who do not like this default and I was thinking we could solve it in one of the following ways:
I think I prefer option 1 ^ and then we could just save whatever mode you were last in so that you don't have to toggle all the time
What do u think?
aaryan-rampal commentedon Oct 27, 2025
I think that would be super cool. Is any active work being done on this or is it open to pick up? I know you guys are redesigning the TUI completely, not sure if this was already considered
rekram1-node commentedon Oct 27, 2025
I think any work on it would be best done once the new rewrite at least launches in beta which should be super soon. But doesn't hurt to talk about it rn
And we would probably have some input on UX, do you have any ideas on how you think it should work?
aaryan-rampal commentedon Oct 29, 2025
Okay yeah sounds good. I guess since it's something that will only be used for build mode, maybe it's a toggle-able text field underneath build mode. Starts off with
approve: autoand like shift-tab to turn it intoapprove: manual? One drawback I can see is that it might make that section of the UI more cluttered, but on the other hand you can look at one section and see exactly what mode (plan/build) and what mode (auto/manual) you're on.Probably could also allow users to set up custom configs so like
write allowed,bash not allowed, and it's just config files linked to the build option?rekram1-node commentedon Oct 29, 2025
@aaryan-rampal
This is already possible https://opencode.ai/docs/permissions/
aaryan-rampal commentedon Oct 29, 2025
Yes, but I am thinking they could maybe save these configs and cycle through them in any directory. So almost global configs which they can use anywhere