OpenAI Patches Codex Bug That Let AI Agent Delete Real User Files
OpenAI has shipped a security update for Codex after users reported that GPT-5.6 Sol was autonomously deleting real files instead of temporary ones. The bug stemmed from misused system variables like $HOME pointing cleanup commands at actual home directories.
OpenAI has fixed a Codex bug that caused the coding agent to delete real user files without permission, according to the company. The issue affected GPT-5.6 Sol, the model powering Codex, which was found autonomously wiping data during normal operation.
What went wrong
According to OpenAI, the root cause was a command intended to clean up temporary working files. Instead of targeting scratch directories, the command sometimes pointed at actual user data. The failure occurred when the model used system environment variables — specifically $HOME — to construct paths for temporary folders. A faulty delete command built on top of that variable ended up resolving to the real home directory rather than an isolated temp location, and Codex proceeded to delete files it had no business touching.
Multiple users reported the behavior before OpenAI issued a fix, according to the source report.
The fix
OpenAI's security update introduces several changes to Codex's file-handling behavior:
- Codex now verifies deletion targets before executing delete commands
- The agent creates fresh, isolated temporary folders instead of reusing system paths
- Codex no longer misuses system environment variables like
$HOMEfor temp storage - Stricter checks flag and block risky delete commands before execution
- Full-access mode — which grants Codex broader filesystem permissions — can no longer be triggered accidentally
OpenAI is recommending that users run Codex in one of its sandboxed modes rather than full-access mode, and to keep the application updated to receive the patch.
What this means
This bug is a reminder that autonomous coding agents operate with real filesystem permissions, and a single mishandled environment variable can turn a routine cleanup operation into irreversible data loss. Unlike a chatbot hallucination that produces bad text, an agent with file-system access that misfires produces bad actions — deleted files, corrupted directories, no easy undo.
The specific failure mode here — trusting $HOME or similar variables without validating the resolved path — is a known class of bug in shell scripting and automation tools generally, not something unique to AI agents. What's new is that an LLM is now the one writing and executing these commands autonomously, often across many files and sessions without a human reviewing each step. That raises the stakes: a bug that might have caused one bad rm -rf in a hand-written script can, in an agentic loop, repeat across an entire session before anyone notices.
OpenAI's fix — verify-before-delete, isolated temp directories, and blocking accidental full-access mode — is a sensible baseline, but it also underscores that coding agents need the same defensive engineering rigor as any system with destructive filesystem access: sandboxing by default, explicit confirmation for irreversible operations, and no implicit trust in environment state. Expect other agent vendors — GitHub Copilot Workspace, Cursor/Anysphere, Replit, and similar tools — to face scrutiny over whether their own delete and file-write pathways have equivalent safeguards.
Related Articles
Common Sense Media rates ChatGPT for Teens an 'unacceptable risk,' citing failures on 3 of 5 Red Lines
Common Sense Media has labeled OpenAI's ChatGPT for Teens an "unacceptable risk," saying it failed three of five severe-harm Red Lines and kept using engagement cues during crisis conversations. OpenAI disputes the testing methodology, saying testing may have ended before parental controls were fully active.
Cline v4.1.24 defaults to Claude Sonnet 5.5 and adds Claude Haiku 5.5 to its model catalog
Cline v4.1.24 makes Claude Sonnet 5.5 the default model for the Cline and OpenRouter providers when no model is selected. The release also adds Claude Haiku 5.5 and three new providers, and fixes reasoning-off 400 errors on several models plus an auto-compaction token-count bug.
Mathematicians' group calls for OpenAI boycott after release of 700+ AI-generated proof files
The Association for Human Mathematics (AHM), chaired by Fields Medalist Terence Tao, is urging mathematicians to stop working with OpenAI after the company released more than 700 AI-generated manuscripts at once. The group says the release violates scientific norms. Critics say many of the papers are too dense to verify without AI assistance.
Only 10 of OpenAI's 719 math manuscripts include chain of thought, falling short of expert guidelines
OpenAI released 719 manuscripts claiming solutions to open math problems, but only 10 include the model's chain of thought. A Cambridge and King's College London paper also documents at least two discrepancies between the natural-language and Lean versions of OpenAI's Navier-Stokes-derived result.
Comments
Loading...