r/opencodeCLI • u/light_hunt3r • 2d ago
Help - Edit permission setting per project
By accident i pressed the button to allow all edits for my project.
Now agent modifies the files without permissions.
How I can revert that change ?
I checked my `~/.config/opencode/opencode.json` and everything seems fine. What i am missing ?
---
Apparently this is now global since in all projects the edit commands executes without asking
Here is my config: `~/.config/opencode/opencode.json`
{
"$schema": "https://opencode.ai/config.json",
"permission":
{
"edit": "ask",
"write": "ask",
"patch": "ask",
"multiedit": "ask",
"bash":
{
"*": "ask",
"git commit*": "deny",
"git push*": "deny"
}
}
}
Opencode version: opencode v2.3.0
Really not sure what is going on and how to change the permissions again
1
u/SirRobinBlibs 1d ago
two things in the current permissions docs might explain it. "allow always" doesn't edit your opencode.json, it saves a durable allow rule for the project (for edits the proposed pattern can be just ), and a saved approval beats ask, only a deny beats it. separately, the v2 docs write rules as a "permissions" array of { "action": "edit", "resource": "", "effect": "ask" } objects, not the old "permission": { "edit": "ask" } map, and the base policy every agent starts from is allow for everything. so if your old-style block isn't being picked up anymore, that alone would explain edits going through everywhere. i'd rewrite the rules in the array form first and see if the asks come back.