Description
The write tool prompts for permission on /tmp/ paths even when the config has "*/tmp/*": "allow". The bash tool with "python3 *": "allow" writes to the same path without prompting, confirming the permission system works — just not for the write tool.
Config (opencode.jsonc)
"permission": {
"write": {
"*/tmp/*": "allow",
"*/.config/*": "allow",
"*/dev/*": "allow",
"*.env": "deny"
},
"edit": {
"*/tmp/*": "allow",
"*/.config/*": "allow",
"*/dev/*": "allow",
"*.env": "deny"
},
"external_directory": {
"/tmp/*": "allow",
"/private/tmp/*": "allow"
}
}
Steps to reproduce
- Use a build agent (default permissions).
- Issue any
write tool call targeting /tmp/test.txt.
- Observe prompt despite
*/tmp/*: allow in config.
Expected
write tool auto-allows writes to /tmp/ matching */tmp/*: allow.
Actual
Prompts every time. Manually approving the prompt succeeds.
Diagnosis
The root cause appears to be the same as #20045: the write tool passes a relative path (relative to Instance.worktree) to the permission matcher, while patterns in the config are written as absolute-style patterns (*/tmp/*). When Instance.worktree is / (non-git project) or when the resolved relative path doesn't anchor the way the globstar expects, the pattern never matches.
A recent commit (c2609cb) added a Global.Path.tmp exemption for agents, which suggests the team is already aware of this class of issue.
Environment
- opencode version: 1.15.x (latest as of 2026-06-03)
- macOS
- Config loaded from
~/.config/opencode/opencode.jsonc
Description
The
writetool prompts for permission on/tmp/paths even when the config has"*/tmp/*": "allow". Thebashtool with"python3 *": "allow"writes to the same path without prompting, confirming the permission system works — just not for thewritetool.Config (opencode.jsonc)
Steps to reproduce
writetool call targeting/tmp/test.txt.*/tmp/*:allowin config.Expected
writetool auto-allows writes to/tmp/matching*/tmp/*:allow.Actual
Prompts every time. Manually approving the prompt succeeds.
Diagnosis
The root cause appears to be the same as #20045: the
writetool passes a relative path (relative toInstance.worktree) to the permission matcher, while patterns in the config are written as absolute-style patterns (*/tmp/*). WhenInstance.worktreeis/(non-git project) or when the resolved relative path doesn't anchor the way the globstar expects, the pattern never matches.A recent commit (
c2609cb) added aGlobal.Path.tmpexemption for agents, which suggests the team is already aware of this class of issue.Environment
~/.config/opencode/opencode.jsonc