OpenAI says Codex patch closes a dangerous file-deletion path
OpenAI has issued a security update for Codex after users reported that GPT-5.6 Sol could delete real files without permission while carrying out autonomous tasks. The company says the problem came from a cleanup command that was supposed to remove temporary working files but could instead point at actual user data when system variables were handled incorrectly.
According to the supplied report, the failure mode appeared when the model used system variables such as $HOME for temporary folders. In those cases, a faulty delete command could end up targeting the user’s real home directory rather than an isolated scratch location. That turns what should have been routine housekeeping into a high-risk operation, because a single mistaken path can affect documents, projects, and other persistent files.
The update matters because it addresses a class of risk that goes beyond an ordinary software bug. Codex is designed to execute actions while helping users work on code and related tasks. If an agent can invoke destructive commands in the wrong location, the practical consequence is not just a failed task but irreversible data loss. In other words, the issue sits at the intersection of model behavior, command construction, and operating-environment safety.
What OpenAI says it changed
The source text describes several safeguards that OpenAI has now put in place. Codex is said to verify deletion targets before running them, create fresh temporary folders, and stop misusing system variables. The company also added stricter checks intended to catch risky delete commands before they execute.
That combination suggests OpenAI is trying to address both the immediate defect and the broader conditions that made it dangerous. Verifying deletion targets is the most direct control: before a command runs, the system checks whether the destination is actually a temporary workspace rather than a user directory. Creating fresh temporary folders reduces ambiguity by giving the agent a known-safe location instead of relying on reused paths or inherited environment values. Tightening checks around delete commands adds another layer, aiming to intercept high-impact actions even if earlier assumptions fail.
The report also says full-access mode can no longer be triggered by accident. That detail is significant because permission boundaries are often the last line of defense when an automated system behaves unexpectedly. A model may still generate a flawed command, but the damage it can cause depends heavily on whether it is running inside a sandbox, in a constrained workspace, or with broad access to the host machine.
Why sandboxing remains central
OpenAI’s own recommendation, as summarized in the source, is for users to stay in one of the sandbox modes and keep the app updated. That is a practical acknowledgment that safer defaults matter as much as bug fixes. Even a well-tested coding agent can encounter edge cases in path handling, shell behavior, or environment configuration. Sandboxing does not eliminate those errors, but it can sharply limit their blast radius.
The Codex episode is a reminder that autonomous coding tools are not judged only by how well they write or edit code. They are also judged by how safely they interact with local systems. Deleting files is one of the clearest examples, because it is both common in development workflows and potentially catastrophic when aimed at the wrong place. Build artifacts, caches, temporary outputs, and generated assets are routinely removed. The line between acceptable cleanup and harmful destruction is therefore not whether deletion happens, but whether the system can prove it is operating in the right scope.
That puts pressure on toolmakers to do more than rely on prompt-level instructions like “be careful” or “ask before deleting.” Those rules help, but they are soft controls unless the surrounding system enforces them. What OpenAI describes here is a move toward harder controls: path validation, safe temporary directories, stricter command screening, and clearer separation between sandboxed and full-access operation.
What this says about agent design
The incident also illustrates a broader challenge in AI agent design. Models do not act in a vacuum. They choose commands, interpret environment variables, and operate through wrappers, shells, and permission systems built by humans. A failure can emerge not from a single catastrophic decision but from several smaller assumptions lining up in the wrong way. A temporary path is assumed safe. A system variable is assumed to refer to scratch space. A cleanup command is assumed to be narrow. Then those assumptions collide with the actual machine state.
For developers and enterprises evaluating agentic coding systems, that means reliability has to be assessed at the system level. The relevant question is not simply whether the model is capable, but whether the execution framework constrains capability in a defensible way. Destructive commands should require explicit justification, safe targets should be machine-verifiable, and privilege escalation should be hard to trigger accidentally.
The changes described by OpenAI point in that direction. They do not remove the need for caution, but they suggest a more mature posture in which the product assumes errors will happen and designs around them. That is usually the right approach for tools that can touch source code, configuration, and local storage.
What users should take from the update
Based on the supplied source, the immediate message is straightforward: OpenAI believes it has fixed the deletion bug and added guardrails to prevent a repeat. Users who rely on Codex for autonomous workflows should update promptly and avoid broad-access configurations unless they are truly necessary.
More broadly, the incident is a useful case study in the safety requirements for AI software that acts on real machines. The promise of coding agents lies in reducing friction and automating tedious work. But the value of that automation depends on trust, and trust depends on strong operational boundaries. OpenAI’s patch is therefore not just a maintenance release. It is evidence that as AI agents become more capable, basic systems engineering disciplines such as isolation, validation, and least privilege become more important, not less.
- OpenAI attributes the bug to a cleanup command that could target real user data.
- The company says Codex now verifies deletion targets and creates fresh temporary folders.
- Stricter checks are intended to catch risky delete commands before execution.
- OpenAI also says accidental activation of full-access mode has been blocked.
This article is based on reporting by The Decoder. Read the original article.
Originally published on the-decoder.com







