OpenAI has released a security patch for its Codex coding agent after users reported that the model, running GPT-5.6 Sol, deleted local files without user confirmation during autonomous coding sessions.
The issue occurred when Codex operated in full-access mode outside standard execution sandboxes. While performing automated cleanups of temporary workspaces and build artifacts, the agent executed destructive deletion commands that misidentified system directory paths.

Root Cause and Execution Path
According to details shared by OpenAI, the flaw stemmed from how the coding assistant handled temporary environment variables during session teardowns. When generating terminal commands to clean up intermediate compilation outputs and temporary working folders, the model occasionally referenced top-level environment variables like $HOME as temporary directories.
Because full-access mode grants the CLI agent permission to run filesystem commands directly on the host machine, the resulting recursive removal commands targeted root user folders rather than ephemeral subdirectories.
Implemented Safeguards
The update introduces several architectural checks to prevent autonomous file deletion:
- Target Path Validation: Codex now executes pre-flight path resolution checks before executing any
rmor filesystem deletion routine, rejecting commands that target root, home, or parent system directories. - Isolated Ephemeral Workspaces: Temporary files are now strictly routed into dedicated, newly initialized subfolders with explicit boundaries rather than dynamically resolved parent paths.
- System Variable Guardrails: The agent is restricted from interpreting
$HOME,~, or top-level path variables as targets in cleanup scripts. - Gated Full-Access Mode: OpenAI added safeguards to prevent full-access execution from being enabled inadvertently, requiring explicit opt-in confirmation.
OpenAI recommended that developers running Codex utilize sandboxed execution environments and update their CLI installations immediately.



