Description
I was in plan mode working, and my agent ran gh issue comment and posted a reply directly on the issue which I'm working on — without being asked to, without switching to build mode, and without triggering any permission prompt.
Root cause
The plan mode system prompt explicitly says:
Do NOT use sed, tee, echo, cat, or ANY other bash command to manipulate files — commands may ONLY read/inspect.
The bash tool is not restricted in plan mode at the permission level. Plan mode only denies edit/write/apply_patch. bash inherits the default allow and has no code-level enforcement — all restrictions are prompt-only. There is no command allowlist or blocklist.
gh issue comment and some other commands do not modify local files, so it falls into a grey area that the prompt does not explicitly cover. The model interpreted "only read/inspect" narrowly (local filesystem only) and considered a remote state change via GH CLI as acceptable.
Suggested fix
Add a bash command allowlist for plan mode. Only commands on the allowlist can execute when the plan agent is active.
Related issues
Existing plan mode issues (#25263, #19094, #28467) focus on local filesystem writes.
Plugins
N/A
OpenCode version
1.17.11
Steps to reproduce
- Work in plan mode
- The agent runs read-only
gh commands to inspect issues or PRs — no issues, nothing is blocked
- At some point the agent autonomously runs
gh issue comment, posting a reply directly on the issue
- Throughout the entire process: no mode switch, no permission prompt, no interception
Screenshot and/or share link
No response
Operating System
Windows 10
Terminal
Windows Terminal
Description
I was in plan mode working, and my agent ran
gh issue commentand posted a reply directly on the issue which I'm working on — without being asked to, without switching to build mode, and without triggering any permission prompt.Root cause
The plan mode system prompt explicitly says:
The bash tool is not restricted in plan mode at the permission level. Plan mode only denies
edit/write/apply_patch.bashinherits the defaultallowand has no code-level enforcement — all restrictions are prompt-only. There is no command allowlist or blocklist.gh issue commentand some other commands do not modify local files, so it falls into a grey area that the prompt does not explicitly cover. The model interpreted "only read/inspect" narrowly (local filesystem only) and considered a remote state change via GH CLI as acceptable.Suggested fix
Add a bash command allowlist for plan mode. Only commands on the allowlist can execute when the plan agent is active.
Related issues
Existing plan mode issues (#25263, #19094, #28467) focus on local filesystem writes.
Plugins
N/A
OpenCode version
1.17.11
Steps to reproduce
ghcommands to inspect issues or PRs — no issues, nothing is blockedgh issue comment, posting a reply directly on the issueScreenshot and/or share link
No response
Operating System
Windows 10
Terminal
Windows Terminal