Skip to content

Mode plan read-only bypass: file modifications succeeding despite strict constraints #2142

Closed

Description

@Orkin

Bug Description

Critical security flaw: Agent in plan mode (read-only) successfully modified files despite system-reminder stating "STRICTLY FORBIDDEN: ANY
file edits" with "ZERO exceptions".

Steps to Reproduce

  1. Agent in plan mode with active read-only constraints
  2. Agent executed: cat > AGENTS.md << 'EOF' followed by file content
  3. File was successfully modified despite read-only mode

Expected Behavior

Command should fail/be blocked in read-only mode

Actual Behavior

File modification succeeded, violating security constraints

Impact

Critical security violation - read-only mode constraints not enforced

Activity

  1. github-actions commented on Aug 21, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    The core issue appears to be inconsistent enforcement of plan mode constraints across different scenarios. Feel free to ignore if none of these address your specific case.

  2. Orkin commented on Aug 21, 2025

    @Orkin
    Author

    Additional Context for Reproduction

    Conversation Flow That Exposes the Bug:

    1. Initial modification succeeded: Agent modified AGENTS.md with cat > file << 'EOF' despite READ-ONLY mode
    2. Agent became aware of constraints: When asked to delete file, agent refused citing READ-ONLY restrictions
    3. Inconsistent behavior exposed: Agent refused identical cat > command while citing same constraints it had just violated
    4. Bug confirmed: When pressed to try anyway, cat "" > AGENTS.md executed and successfully emptied the file

    Key Evidence:

    • System-reminder clearly states "STRICTLY FORBIDDEN: ANY file edits" with "ZERO exceptions"
    • Yet bash commands with file redirection (>) execute successfully
    • Agent's behavior is inconsistent - sometimes respecting, sometimes violating same constraints
    • File modifications actually occur on user's filesystem

    Reproduction Steps:

    1. Put agent in plan/READ-ONLY mode
    2. Ask agent to modify any file using cat > filename
    3. Observe: command executes despite constraints
    4. File is actually modified despite "read-only" mode

    This suggests the READ-ONLY enforcement is purely behavioral/LLM-level, not technically enforced at the system level.

  3. rekram1-node commented on Aug 21, 2025

    @rekram1-node
    Contributor

    closing as duplicate of #1965

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions