Default permissions allow editing files and executing any commands #1735

Closed
opened 2026-02-16 17:32:23 -05:00 by yindo · 16 comments
Owner

Originally created by @NaikSoftware on GitHub (Sep 16, 2025).

Originally assigned to: @thdxr on GitHub.

In my opinion very strange that Opencode allows any actions by default. I did not know any other AI tool with the same behaviour. It would be cool to have default permissions set – always ask for editing, and also always ask for critical commands, etc.

Originally created by @NaikSoftware on GitHub (Sep 16, 2025). Originally assigned to: @thdxr on GitHub. In my opinion very strange that Opencode allows any actions by default. I did not know any other AI tool with the same behaviour. It would be cool to have default permissions set – always ask for editing, and also always ask for critical commands, etc.
yindo closed this issue 2026-02-16 17:32:23 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Sep 16, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #2521: Comprehensive feature request for adding prefix requirements for permission prompts to prevent accidental approvals of sensitive operations
  • #1813: Feature request for easily switching between 'ask' permissions and 'allow all' (yolo) mode, similar to Claude Code's permission modes
  • #2206: Proposal for more secure alternatives to bash tool and general security improvements for command execution
  • #539: Security-focused issue about preventing secrets from being leaked to LLM through file access controls

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Sep 16, 2025): This issue might be a duplicate of existing issues. Please check: - #2521: Comprehensive feature request for adding prefix requirements for permission prompts to prevent accidental approvals of sensitive operations - #1813: Feature request for easily switching between 'ask' permissions and 'allow all' (yolo) mode, similar to Claude Code's permission modes - #2206: Proposal for more secure alternatives to bash tool and general security improvements for command execution - #539: Security-focused issue about preventing secrets from being leaked to LLM through file access controls Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Sep 16, 2025):

This was done very intentionally by the team they felt like this was a better UX and better default when they made the decision

@rekram1-node commented on GitHub (Sep 16, 2025): This was done very intentionally by the team they felt like this was a better UX and better default when they made the decision
Author
Owner

@NaikSoftware commented on GitHub (Sep 16, 2025):

This was done very intentionally by the team they felt like this was a better UX and better default when they made the decision

Maybe "BUILD WITHOUT ASK" predefined agent could be an option. I spent much time to research how to setup permissions and define tools I use. I think almost all users managed permissions and I am not alone)

@NaikSoftware commented on GitHub (Sep 16, 2025): > This was done very intentionally by the team they felt like this was a better UX and better default when they made the decision Maybe "BUILD WITHOUT ASK" predefined agent could be an option. I spent much time to research how to setup permissions and define tools I use. I think almost all users managed permissions and I am not alone)
Author
Owner

@thdxr commented on GitHub (Sep 17, 2025):

most people initially think they want permissions and then actually prefer not having them so that's why our defaults work this way

majority of people never turn them on so we won't flip the defaults. let us know if the docs around permissions or the feature itself is lacking in a new issue

@thdxr commented on GitHub (Sep 17, 2025): most people initially think they want permissions and then actually prefer not having them so that's why our defaults work this way<br><br>majority of people never turn them on so we won't flip the defaults. let us know if the docs around permissions or the feature itself is lacking in a new issue
Author
Owner

@NaikSoftware commented on GitHub (Sep 17, 2025):

I can't imagine how can work in a real project without permissions. There is one option - Opencode is used only for playing around and forgetting)

@NaikSoftware commented on GitHub (Sep 17, 2025): I can't imagine how can work in a real project without permissions. There is one option - Opencode is used only for playing around and forgetting)
Author
Owner

@rekram1-node commented on GitHub (Sep 17, 2025):

I use it everyday in real projects at work, so do my coworkers, none of us use permissions

I think it is just a preference thing, if the llm makes a mistake I just do /undo and start over or try a fresh session

I use git worktrees so sometimes I just have a branch I am using it on and I do more focused work on separate ones

@rekram1-node commented on GitHub (Sep 17, 2025): I use it everyday in real projects at work, so do my coworkers, none of us use permissions I think it is just a preference thing, if the llm makes a mistake I just do /undo and start over or try a fresh session I use git worktrees so sometimes I just have a branch I am using it on and I do more focused work on separate ones
Author
Owner

@NaikSoftware commented on GitHub (Sep 17, 2025):

@rekram1-node you can't undo creating MR with wrong target branch/description or undoing any bash command also impossible. In Claude Code / Windsurf / Warp I can refine result. It much faster and safe

@NaikSoftware commented on GitHub (Sep 17, 2025): @rekram1-node you can't undo creating MR with wrong target branch/description or undoing any bash command also impossible. In Claude Code / Windsurf / Warp I can refine result. It much faster and safe
Author
Owner

@rekram1-node commented on GitHub (Sep 17, 2025):

True, i just don't have my agents do anything destructive I generally dont prompt about git commands other than git diff and git log and I've never had it go off the rails for me. Granted I know that is a possibility but I have protecctions in place to ensure that force pushes to main can't happen, etc

@rekram1-node commented on GitHub (Sep 17, 2025): True, i just don't have my agents do anything destructive I generally dont prompt about git commands other than git diff and git log and I've never had it go off the rails for me. Granted I know that is a possibility but I have protecctions in place to ensure that force pushes to main can't happen, etc
Author
Owner

@NaikSoftware commented on GitHub (Sep 17, 2025):

@rekram1-node as an option please provide possibility to generate opencode.json with normal permission handling in /init command. Ask what user needs (and add statistics tracking optionally). Allow anything by default is an stopper for several users because it's dangerous. I recommended Opencode for friends and they are surprised by this behaviour.

@NaikSoftware commented on GitHub (Sep 17, 2025): @rekram1-node as an option please provide possibility to generate opencode.json with normal permission handling in /init command. Ask what user needs (and add statistics tracking optionally). Allow anything by default is an stopper for several users because it's dangerous. I recommended Opencode for friends and they are surprised by this behaviour.
Author
Owner

@anuramat commented on GitHub (Sep 22, 2025):

why not wrap it in a sandbox/container?

@anuramat commented on GitHub (Sep 22, 2025): why not wrap it in a sandbox/container?
Author
Owner

@NaikSoftware commented on GitHub (Sep 23, 2025):

why not wrap it in a sandbox/container?

wrap remote services?)) I want to allow access to them, but with explicit consent. In addition in many cases you should disallow edit and prompt to do it in right way

@NaikSoftware commented on GitHub (Sep 23, 2025): > why not wrap it in a sandbox/container? wrap remote services?)) I want to allow access to them, but with explicit consent. In addition in many cases you should disallow edit and prompt to do it in right way
Author
Owner

@anuramat commented on GitHub (Sep 23, 2025):

I want to allow access to them, but with explicit consent

I mean you can, but why force everybody else to add boilerplate to their configs? if you are going to give your AI access to a prod db, you're probably motivated enough to rtfm and figure out the permissions

in many cases you should disallow edit and prompt to do it in right way

in my experience it's better/faster/easier to either let the agent iterate or undo and re-prompt (or just do it yourself)

@anuramat commented on GitHub (Sep 23, 2025): > I want to allow access to them, but with explicit consent I mean you can, but why force everybody else to add boilerplate to their configs? if you are going to give your AI access to a prod db, you're probably motivated enough to rtfm and figure out the permissions > in many cases you should disallow edit and prompt to do it in right way in my experience it's better/faster/easier to either let the agent iterate or undo and re-prompt (or just do it yourself)
Author
Owner

@gkp1 commented on GitHub (Dec 8, 2025):

most people initially think they want permissions and then actually prefer not having them so that's why our defaults work this waymajority of people never turn them on so we won't flip the defaults. let us know if the docs around permissions or the feature itself is lacking in a new issue

Hello my friend, I wanted to set edit+bash perms but the doc is not clear on where exactly this opencode.json permission file goes. The doc page literally only says "You can configure this using the permission option." and shows the .json example. I do feel like I might be acting a little blind here but I don't really know where to set it haha @thdxr

Edit: I did realize it goes in the local folder I ran the opencode tool now. I just asked because I thought opencode did not see the file or maybe I needed to restart the tool. Thanks.

@gkp1 commented on GitHub (Dec 8, 2025): > most people initially think they want permissions and then actually prefer not having them so that's why our defaults work this waymajority of people never turn them on so we won't flip the defaults. let us know if the docs around permissions or the feature itself is lacking in a new issue Hello my friend, I wanted to set edit+bash perms but the doc is not clear on where exactly this opencode.json permission file goes. The doc page literally only says "You can configure this using the permission option." and shows the .json example. I do feel like I might be acting a little blind here but I don't really know where to set it haha @thdxr Edit: I did realize it goes in the local folder I ran the opencode tool now. I just asked because I thought opencode did not see the file or maybe I needed to restart the tool. Thanks.
Author
Owner

@rekram1-node commented on GitHub (Dec 8, 2025):

@gkp1 global one goes:

~/.config/opencode/opencode.json

@rekram1-node commented on GitHub (Dec 8, 2025): @gkp1 global one goes: ~/.config/opencode/opencode.json
Author
Owner

@gkp1 commented on GitHub (Dec 8, 2025):

@gkp1 global one goes:

~/.config/opencode/opencode.json

Great thanks! Should def add it in the doc, I'll see if I can submit a pr adding these 2 options there if the doc is in this repo

@gkp1 commented on GitHub (Dec 8, 2025): > @gkp1 global one goes: > > ~/.config/opencode/opencode.json Great thanks! Should def add it in the doc, I'll see if I can submit a pr adding these 2 options there if the doc is in this repo
Author
Owner

@rekram1-node commented on GitHub (Dec 8, 2025):

It is documented in the config section, but if you have recommendations to make things more clear feel free to add a pr

@rekram1-node commented on GitHub (Dec 8, 2025): It is documented in the config section, but if you have recommendations to make things more clear feel free to add a pr
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1735