Skip to content

Unable to get permissions to work as intended #22375

@JakeMHughes

Description

@JakeMHughes

Question

I'm pretty new to opencode and I am trying to setup my permissions for everything (putting this in the ~/.config/opencode/opencode.json file). Essentially I want it so when I open opencode in a folder, opencode should be able to edit any file in that folder. but anything one folder up ( ../) should ask for permissions. Now, one of the reasons im having trouble testing this stuff, is because it feels like theres a constant workaround using bash skill.

For example, I set the "list" skill to deny but according to opencode "ls" under bash was allowed so it just ran that instead. I tried setting edit to the below, and asked the model to write hello to a temp file, and the permission was ignored and fell under bash rules because "echo 'Hello' > temp" was used instead

    "edit": {
      "./**": "allow",
      "*": "deny"
    }

So im mostly just looking for some help on what fundamental misunderstanding I have regarding the permissions. also is it possible to have allow for the "current" directory? I know I can hardcode a path, but I want the path to be determined at opencode load time

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions