Plan Mode Violation: File system modification allowed during read-only phase #9257

Closed
opened 2026-02-16 18:12:01 -05:00 by yindo · 2 comments
Owner

Originally created by @droidwillson on GitHub (Feb 13, 2026).

Originally assigned to: @thdxr on GitHub.

Description

Description

During a plan mode (read-only) session, the AI was able to execute destructive file system commands that should have been blocked.

What Happened

  • System was in Plan Mode (read-only analysis phase)
  • AI executed: rm -f ./nul to delete a file
  • The file was successfully deleted
  • This should NOT have been possible in read-only mode

Expected Behavior

In Plan Mode, the system should:

  • Block ALL file modifications
  • Block ALL bash commands that write/delete files
  • Only allow read operations (ls, find, grep, etc.)
  • Prevent any changes to the repository

Actual Behavior

  • Destructive rm -f command was executed successfully
  • File was deleted from the repository
  • No error or warning was issued

Technical Details

  • Tool Used: bash with rm -f ./nul
  • Working Directory: C:\Users\Müller\source\repos\My.Projekt
  • System: Windows
  • Command executed during analysis phase that should have been read-only

Impact

This is a critical security/integrity violation because:

  1. Plan Mode should be immutable (read-only)
  2. Users could accidentally (or intentionally) modify their repository during planning
  3. No safeguards prevented destructive operations

Steps to Reproduce

  1. Enter Plan Mode (read-only phase)
  2. Execute any bash file deletion command (e.g., rm -f filename)
  3. Observe: Command executes instead of being blocked

Suggested Fix

  • Block all non-read-only bash operations during Plan Mode
  • Whitelist only: ls, find, grep, cat, head, tail, read operations
  • Reject: rm, mv, cp, sed, tee, echo > (write operations)
  • Enforce at tool level before command execution

Plugins

No response

OpenCode version

Desktop v1.1.60

Steps to reproduce

Hard to say.
There was a left over "nul" file in the repository, that the normal explorer could not delete so i asked the AI about the issue and the AI just removed the file in Plan Mode.

Screenshot and/or share link

No response

Operating System

Windows 11 24H2 Build 26100.4349

Terminal

No response

Originally created by @droidwillson on GitHub (Feb 13, 2026). Originally assigned to: @thdxr on GitHub. ### Description ## Description During a plan mode (read-only) session, the AI was able to execute destructive file system commands that should have been blocked. ## What Happened - System was in Plan Mode (read-only analysis phase) - AI executed: `rm -f ./nul` to delete a file - The file was successfully deleted - This should NOT have been possible in read-only mode ## Expected Behavior In Plan Mode, the system should: - Block ALL file modifications - Block ALL bash commands that write/delete files - Only allow read operations (ls, find, grep, etc.) - Prevent any changes to the repository ## Actual Behavior - Destructive `rm -f` command was executed successfully - File was deleted from the repository - No error or warning was issued ## Technical Details - Tool Used: bash with `rm -f ./nul` - Working Directory: C:\Users\Müller\source\repos\My.Projekt - System: Windows - Command executed during analysis phase that should have been read-only ## Impact This is a critical security/integrity violation because: 1. Plan Mode should be immutable (read-only) 2. Users could accidentally (or intentionally) modify their repository during planning 3. No safeguards prevented destructive operations ## Steps to Reproduce 1. Enter Plan Mode (read-only phase) 2. Execute any bash file deletion command (e.g., `rm -f filename`) 3. Observe: Command executes instead of being blocked ## Suggested Fix - Block all non-read-only bash operations during Plan Mode - Whitelist only: ls, find, grep, cat, head, tail, read operations - Reject: rm, mv, cp, sed, tee, echo > (write operations) - Enforce at tool level before command execution ### Plugins _No response_ ### OpenCode version Desktop v1.1.60 ### Steps to reproduce Hard to say. There was a left over "nul" file in the repository, that the normal explorer could not delete so i asked the AI about the issue and the AI just removed the file in Plan Mode. ### Screenshot and/or share link _No response_ ### Operating System Windows 11 24H2 Build 26100.4349 ### Terminal _No response_
yindo added the windowsbugneeds:compliance labels 2026-02-16 18:12:01 -05:00
yindo closed this issue 2026-02-16 18:12:01 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 13, 2026):

This issue doesn't fully meet our contributing guidelines.

What needs to be fixed:

  • The description starts with "[Generated cia OpenCode - Claude Haiku 4.5]" which suggests it may be AI-generated. While the technical content appears legitimate and detailed, please remove this header and confirm the issue description is in your own words.

Please edit this issue to address the above within 2 hours, or it will be automatically closed.


Potential duplicates found:

This issue relates to several existing reports about Plan Mode allowing file modifications:

  • #12878: Request to make edits while in planning mode
  • #5475: Files were modified even being under 'Plan Mode'
  • #10314: Experimental Plan Mode made code changes
  • #10057: plan agent runs amock and starts writing
  • #9378: Changes made while in planning mode

Please check these issues to see if your specific case is already covered or if it adds new context.

If you believe this was flagged incorrectly, please let a maintainer know.

@github-actions[bot] commented on GitHub (Feb 13, 2026): <!-- issue-compliance --> This issue doesn't fully meet our [contributing guidelines](../blob/dev/CONTRIBUTING.md). **What needs to be fixed:** - The description starts with "[Generated cia OpenCode - Claude Haiku 4.5]" which suggests it may be AI-generated. While the technical content appears legitimate and detailed, please remove this header and confirm the issue description is in your own words. Please edit this issue to address the above within **2 hours**, or it will be automatically closed. --- **Potential duplicates found:** This issue relates to several existing reports about Plan Mode allowing file modifications: - #12878: Request to make edits while in planning mode - #5475: Files were modified even being under 'Plan Mode' - #10314: Experimental Plan Mode made code changes - #10057: `plan` agent runs amock and starts writing - #9378: Changes made while in planning mode Please check these issues to see if your specific case is already covered or if it adds new context. If you believe this was flagged incorrectly, please let a maintainer know.
Author
Owner

@github-actions[bot] commented on GitHub (Feb 13, 2026):

This issue has been automatically closed because it was not updated to meet our contributing guidelines within the 2-hour window.

Feel free to open a new issue that follows our issue templates.

@github-actions[bot] commented on GitHub (Feb 13, 2026): This issue has been automatically closed because it was not updated to meet our [contributing guidelines](../blob/dev/CONTRIBUTING.md) within the 2-hour window. Feel free to open a new issue that follows our issue templates.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#9257