Skip to content

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

Closed as not planned

Description

@droidwillson

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

Activity

  1. github-actions commented on Feb 13, 2026

    @github-actions
    Contributor

    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:

    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.

  2. github-actions commented on Feb 13, 2026

    @github-actions
    Contributor

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingneeds:complianceThis means the issue will auto-close after 2 hours.windows

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions