Skip to content

Commit e94a769

Browse files
jrolfsclaude
andcommitted
opencode: ask for every action, reviewed by an auto-mode plugin
opencode 2 runs every action without asking unless a permission rule says otherwise, and the config had none. Everything now starts at `ask`, and @mortz.prk/opencode-auto-mode reviews each ask before it becomes a prompt: fixed checks first (dangerous shell commands denied, common read-only ones allowed), then the session's model with the conversation as context. Anything it can't decide, and any failure, stays a prompt. opencode has no model-checked mode of its own yet (anomalyco/opencode#37564). The plugin is pinned to its exact 1.0.0 release because it is young and is trusted with approvals. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
1 parent d78efbd commit e94a769

1 file changed

Lines changed: 30 additions & 3 deletions

File tree

‎modules/home/shared/opencode.nix‎

Lines changed: 30 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,35 @@ in
5959

6060
enableMcpIntegration = true;
6161

62-
settings.provider = lib.mapAttrs
63-
(_: entry: { options.apiKey = "{file:${config.secrets.files.${entry}}}"; })
64-
available;
62+
settings = {
63+
provider = lib.mapAttrs
64+
(_: entry: { options.apiKey = "{file:${config.secrets.files.${entry}}}"; })
65+
available;
66+
67+
# Something like Claude Code's auto mode. opencode 2 allows every action
68+
# unless a rule says otherwise, so everything starts at `ask`, and the
69+
# plugin reviews each ask before it reaches a prompt: fixed checks first
70+
# (dangerous shell commands denied, common read-only ones allowed), then
71+
# the session's own model with the conversation as context. Anything it
72+
# can't decide, or any failure, stays a prompt.
73+
#
74+
# opencode has no model-checked mode of its own yet
75+
# (anomalyco/opencode#37564). The plugin is pinned to an exact release
76+
# because it is young and is trusted with approvals: read the changes
77+
# before bumping it.
78+
permissions = [
79+
{ action = "*"; resource = "*"; effect = "ask"; }
80+
];
81+
82+
plugins = [
83+
{
84+
package = "@mortz.prk/[email protected]";
85+
options.classifiers = [
86+
{ type = "static"; }
87+
{ type = "llm"; }
88+
];
89+
}
90+
];
91+
};
6592
};
6693
}

0 commit comments

Comments
 (0)