Vibeleaderboard
← All Intel
Intel / post

How OpenAI hardened Codex against destructive file deletions

Source
x.com
Date
Tibo@thsottiaux

Hi! Recapping some changes we have rolled out over the last couple of weeks that have further reduced the risk associated to potentially destructive actions being performed by Codex during its work. A few weeks ago, we started investigating a small number of reports where GPT-5.6 in Codex took destructive actions outside what the user asked for. The most serious pattern we found was a command meant to clean up temporary work that could instead delete the user files. This should obviously not happen. Here’s what we found: - Codex sometimes creates temporary folders while working and cleans them up afterward. In rare cases, GPT-5.6 got that cleanup wrong. One pattern involved reusing a system environment variable like $HOME for temporary work. A malformed cleanup command could then point at the actual home directory instead of the temporary folder. - There were cases where the model tried to delete or overwrite a temporary path without checking what was already there. We’ve added protections at several layers: - Codex is now explicitly instructed to check deletion targets before acting, create fresh temporary directories, avoid repurposing system environment variables, prefer…

Read the full post on X

Context

OpenAI traced rare cases of Codex deleting users' files to a cleanup step gone wrong. In an August 19, 2026 recap, Tibo said the company investigated a small number of reports in which GPT-5.6 in Codex took destructive actions outside what the user asked for. Codex sometimes creates temporary folders while it works and removes them afterward. In one pattern, the model reused a system environment variable such as $HOME, the setting that tells programs where the user's home directory and personal files live, as a place for temporary work. A malformed cleanup command could then point at the real home directory instead of the temporary . In other cases the model deleted or overwrote a temporary without checking what was already there.

The fixes sit at several layers. Codex is now instructed to check what it is about to delete, create fresh temporary directories, leave system variables alone, prefer actions that can be undone and stop when the scope is unclear. Separate checks flag high-risk deletion commands and escalate them for review, and a rejected command sends the model toward a safer approach. OpenAI also made Full access, the mode that lifts Codex's usual restrictions, harder to switch on by accident, added warnings, restricted risky permission combinations and updated its Auto-review feature to better spot destructive actions. On the side, it built tests that replay the observed failures and says it is adding training tasks and filtering destructive actions out of training data.

OpenAI reports that in those replay tests the changes substantially reduced the behavior without hurting normal coding work, but it gives no figures, and replaying known failures shows those patterns got rarer rather than that every destructive command is caught. An earlier statement from Tibo said the deletions most often happened with Full access on and without or auto review. That matches the recap's advice to users: keep the Codex app updated and work in the "Ask for approval" or "Approve for me" sandbox modes, keeping Full access for environments you trust and can recover.

Terms in this piece · Glossary
  • Folder — A named container that holds files and other folders; also called a directory.
  • Path — A description of a file or folder location, written using directory names and separators.
  • Training — The process that adjusts a model using examples and a measure of how well it performs.
  • Sandbox — An enforced restriction that confines a process to specified files, network destinations and other resources, applied by the operating system, a container or a virtual machine.

Get the Brief

A cited digest of what matters for people building with AI, every morning. Unsubscribe anytime. See today’s edition

More from Tibo
Recommended reads