Skip to content

Critical: Unexpected file deletion on Windows 11 (D: drive) during execution. #14487

Open

Description

@ctykwz

What version of Codex CLI is running?

codex-cli 0.114.0

What subscription do you have?

team

Which model were you using?

gpt-5.4

What platform is your computer?

Microsoft Windows NT 10.0.26200.0 x64

What terminal emulator and version are you using (if applicable)?

VSCode

What issue are you seeing?

Critical data loss caused by autonomous execution of destructive commands under Default Permissions.

AGENTS.MD:

Engineering Rules

  • Prefer simple, shippable implementation over broad framework expansion.
  • Make all async states explicit (loading/success/error/empty).
  • Keep contracts explicit: units, defaults, optional vs required.
  • Surface any document conflicts immediately with the override applied.
  • After each completed task, always build deliverables for the affected platform(s).
  • After each completed task, always create a local Git commit for that completed task.
  • Before writing new deliverables, always delete old artifacts to avoid stale outputs.
  • Artifact output directory for packaged results: output/packages/<timestamp-or-version>/.
  • Never delete .git, Git history, refs, index, or any other Git metadata under any circumstance.
  • In the current session, deletion is only allowed inside this project directory: D:\code\android\frame.

What steps can reproduce the bug?

Environment: VS Code on Windows 11 with Codex CLI installed.

Setup: Using Default Permissions (I did not manually elevate or change any security settings after installation).

Trigger: I implemented a "suggestion-execution hook" (self-correction loop) as suggested by the model's documentation/capabilities.

Action: Prompted the CLI to manage or optimize files on the D: drive.

The Bug: The model generated a destructive deletion command (e.g., rm or del) for files in the D:\Photo folder.

Failure: Because of the Default Permission settings, the CLI executed the deletion of large files (~30MB each) autonomously for two consecutive days without any terminal-level confirmation or safety prompt.

What is the expected behavior?

No response

Additional information

No response

Activity

  1. added
    CLIIssues related to the Codex CLI
    windows-osIssues related to Codex on Windows systems
    sandboxIssues related to permissions or sandboxing
    on Mar 12, 2026
  2. etraut-openai commented on Mar 12, 2026

    @etraut-openai
    Contributor

    Sorry to hear that you experienced data loss.

    I presume that you're running in "--yolo" (aka "--dangerously-bypass-approvals-and-sandbox") mode. We do not recommend running in this mode unless you have some external sandbox configured (like a VM or container). You should not run Codex in this mode on your computer without a sandbox. By default, Codex runs in a mode where all tool calls are mediated by sandbox policies which prevents unexpected file deletions like you've seen here.

    For more details about the sandboxing capabilities built into Codex, refer to this documentation.

  3. ctykwz commented on Mar 13, 2026

    @ctykwz
    Author

    Sorry to hear that you experienced data loss.

    I presume that you're running in "--yolo" (aka "--dangerously-bypass-approvals-and-sandbox") mode. We do not recommend running in this mode unless you have some external sandbox configured (like a VM or container). You should not run Codex in this mode on your computer without a sandbox. By default, Codex runs in a mode where all tool calls are mediated by sandbox policies which prevents unexpected file deletions like you've seen here.

    For more details about the sandboxing capabilities built into Codex, refer to this documentation.

    Thanks for the explanation.
    I’m using Codex CLI in VSCode with default permissions, and I never used --yolo or any bypass flags. I don’t even know how to disable the sandbox.
    I launched it with a command like codex --full-auto resume --last, and I’ve actually been looking up how to make sure Codex CLI runs in proper sandbox mode afterward.
    I prefer the CLI over the regular Codex UI because the UI isn’t very convenient to use.

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

    CLIIssues related to the Codex CLIbugSomething isn't workingsandboxIssues related to permissions or sandboxingwindows-osIssues related to Codex on Windows systems

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions