Repository navigation
Plan mode is editing my files (gemini 3 pro) #7292
Description
Description
Twice now when working on a plan I've provided plan feedback and instead of updating the plan it's gone ahead and made the changes.
I think both times were with gemini 3 pro. (which I've been working with with because gemini are the blessed models at the day job).
A share link of this happening to me is attached, along with a screenshot.
You can see that my second prompt resulted in a pretty good plan. My third prompt was plan refinement, but it went ahead and started making changes with sed and rm
I haven't altered any agent settings. The only thing in my opencode.jsonc is a local nixos mcp server.
It looks like there are attempts to prevent this.
| - Avoid using Bash with the `find`, `grep`, `cat`, `head`, `tail`, `sed`, `awk`, or `echo` commands, unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands: |
| "*": "deny", |
opencode/packages/opencode/src/session/prompt/plan.txt
Lines 4 to 6 in d5f0e3f
| CRITICAL: Plan mode ACTIVE - you are in READ-ONLY phase. STRICTLY FORBIDDEN: | |
| ANY file edits, modifications, or system changes. Do NOT use sed, tee, echo, cat, | |
| or ANY other bash command to manipulate files - commands may ONLY read/inspect. |
But it's obviously not working. I wonder if there should be more granular permissions around the bash tool? maybe enforcing more granular permissions? I would feel better if bash was more locked down.
Plugins
none
OpenCode version
1
Steps to reproduce
- use gemini 3 pro
- use native plan agent
- ask it to make a plan
- ask for a change
- plan agent makes the changes 😱
Screenshot and/or share link
Session share: https://opncd.ai/share/mvxL26AW
Here's a screenshot of the session showing it in on the plan agent.
Operating System
nixos (linux kernel v 6.18.3)
Terminal
terminal inside zed editor, I think the other time this happened was in ghostty on mac os.
Activity
github-actions commentedon Jan 8, 2026
This issue might be a duplicate of existing issues. Please check:
Feel free to ignore if none of these address your specific case.
thdxr commentedon Mar 25, 2026
To stay organized issues are automatically closed after 90 days of no activity. If the issue is still relevant please open a new one.
scorpioares commentedon Mar 26, 2026
I have encountered a similar situation where files were modified directly in plan mode using
claude-opus-4-6.pcastellazzi commentedon Apr 2, 2026
This is another variation on the theme. Downloading and executing stuff from the internet should not be allowed in plan.
FurkanTokmak commentedon Apr 24, 2026
I have encountered this issue today. It asked for edit and I denied.
neuhaus commentedon May 1, 2026
I can't believe this critical issue is still unfixed after 5 months.
I've had the same issue today: Despite plan mode the model was allowed to do "git commit" and "git push".
Plan mode protections were removed in commit 351ddee on Jan 1st 2026.
The documentation states that plan mode has "bash" set to "ask" (which is of course expected behaviour), but in fact it doesn't right now.
@thdxr @adamdotdevin @rekram1-node @kitlangton
kkavish commentedon May 21, 2026
Exactly the same issue.
neuhaus commentedon May 22, 2026
@rekram1-node „not planned“?
Care to elaborate? Is opencode getting rid of plan mode because it‘s not working as documented?
RenanMsV commentedon Jul 26, 2026
OpenCode v1.18.5 - Nemotron 3 Ultra
The agent did not care about the rules 😎🤣
He literally said he was going to ask for clarification... and then went ahead and wrote it anyway. 🤣🤣
When he got called out, he said: