Skip to content

Default permissions allow editing files and executing any commands #2632

Closed

Description

@NaikSoftware

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.

Activity

  1. changed the title [-]Default permissions allows to edit files and execute any commands[/-] [+]Default permissions allow editing files and executing any commands[/+] on Sep 16, 2025
  2. github-actions commented on Sep 16, 2025

    @github-actions
    Contributor

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

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

  3. rekram1-node commented on Sep 16, 2025

    @rekram1-node
    Contributor

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

  4. NaikSoftware commented on Sep 16, 2025

    @NaikSoftware
    Author

    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)

  5. thdxr commented on Sep 17, 2025

    @thdxr
    Member

    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

  6. NaikSoftware commented on Sep 17, 2025

    @NaikSoftware
    Author

    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)

  7. rekram1-node commented on Sep 17, 2025

    @rekram1-node
    Contributor

    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

  8. NaikSoftware commented on Sep 17, 2025

    @NaikSoftware
    Author

    @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

  9. rekram1-node commented on Sep 17, 2025

    @rekram1-node
    Contributor

    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

  10. NaikSoftware commented on Sep 17, 2025

    @NaikSoftware
    Author

    @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.

  11. anuramat commented on Sep 23, 2025

    @anuramat

    why not wrap it in a sandbox/container?

  12. NaikSoftware commented on Sep 23, 2025

    @NaikSoftware
    Author

    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

  13. anuramat commented on Sep 24, 2025

    @anuramat

    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)

  14. gkp1 commented on Dec 8, 2025

    @gkp1

    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.

  15. rekram1-node commented on Dec 8, 2025

    @rekram1-node
    Contributor

    @gkp1 global one goes:

    ~/.config/opencode/opencode.json

  16. gkp1 commented on Dec 8, 2025

    @gkp1

    @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

  17. rekram1-node commented on Dec 8, 2025

    @rekram1-node
    Contributor

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

  18. Michael-Z-Freeman commented on Mar 27, 2026

    @Michael-Z-Freeman

    Just installed opencode, which looks great. However, I was very surprised by this decision. If developers want this then great. But it's really essential that there should be a warning on the first run of Open Code that it is set like this. I was working on an important project and noticed the model running away doing all sorts of things and had to press escape. The model made various git hub commits without asking me first. Thankfully the project wasn't ruined in any way but it was a bit weird to be honest. Thanks.

  19. T3rm1 commented on Apr 8, 2026

    @T3rm1

    You should never run opencode without very restrictive permissions in place. Even simple bash commands like find can be very destructive if combined with the -exec parameter. I experienced this myself while being in plan mode. The whole security concept for opencode is flawed. So much can go wrong.
    The llm shouldn't use these commands to do basic work. Instead, there should be tools shipped with the cli to perform these operations in a safe manner.

  20. Mart-Bogdan commented on Apr 13, 2026

    @Mart-Bogdan

    Furthermore, I don't want content of my homedir to be read by agents, except some specific dirs, like reading memory from calude code.

    Perhaps somebody have sane opencode.jsonc file with permissions so I can use it?

  21. NaikSoftware commented on Apr 13, 2026

    @NaikSoftware
    Author

    @Mart-Bogdan you can setup but OpenCode can ignore your rules randomly.

  22. Mart-Bogdan commented on Apr 15, 2026

    @Mart-Bogdan

    Well, I'm telling not about RULES.md but about restrictions on tool calling. I know that it can use bash to read any files.

    I've set up some rules in opencode.jsonc. Desktop mode of open code ignored them, lol.

  23. patcon commented on Jul 11, 2026

    @patcon

    fwiw this thread gives me such bad vibes. Not trying to throw shade, but just being honest about how much i feel like I'm taking crazy pills while reading things here that are presumably the views of the maintainers. Feels very irresponsible as defaults, and not respecting agency or thoughtful ways to enter into agentic coding (ie. watching it first and building trust)

  24. NaikSoftware commented on Aug 9, 2026

    @NaikSoftware
    Author

    fwiw this thread gives me such bad vibes. Not trying to throw shade, but just being honest about how much i feel like I'm taking crazy pills while reading things here that are presumably the views of the maintainers. Feels very irresponsible as defaults, and not respecting agency or thoughtful ways to enter into agentic coding (ie. watching it first and building trust)

    yep, project looks promising but I switched to Claude Code / Codex where I can control everything and UX more predictable. Maintainers should find real problems and improve product, instead it they are improving TUI interface, search of files, another optional staff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions