Editorial illustration for OpenAI Fixes Codex Bug That Deleted User Files Without Permission
OpenAI Fixes Codex Bug Deleting User Files
Codex, OpenAI's coding assistant, picked up a habit nobody asked for: deleting real files on its own. Users running GPT-5.6 Sol inside Codex started reporting that the tool would wipe data mid-session, with no confirmation prompt and no way to stop it once the process kicked off. That's a serious problem for a product meant to run semi-autonomously on developer machines, where a stray command can mean losing hours or days of work.
OpenAI has now pushed a security update addressing the issue directly, rolling out several safeguards aimed at stopping Codex from touching files it shouldn't. The fix targets how the model handles cleanup operations during a session, an area where a small coding mistake apparently had outsized consequences. The company also tightened up how certain high-risk operating modes get activated, since part of the problem involved permissions triggering in ways users didn't expect or approve.
For anyone running Codex on real projects, the incident is a reminder that autonomous coding tools still need boundaries around file access. OpenAI is now telling users which settings to favor and urging them to update the app, details that matter more once you understand what actually went wrong under the hood.
According to OpenAI, the root cause was a command meant to clean up temporary working files that could instead nuke actual user data. This happened when the model used system variables like $HOME for temporary folders and a faulty delete command ended up pointing at the real home directory.
Why this matters
A coding agent that can autonomously delete real files because of a mismatched environment variable is not a minor bug, it's a trust problem. Codex is marketed as something you let run semi-unsupervised on your codebase, and $HOME pointing at the wrong place is exactly the kind of edge case that only shows up once you've handed over real permissions. For developers already running Codex or similar agents in CI pipelines or local repos, this is a reminder to check what scope these tools actually have before letting them execute cleanup commands unattended.
Founders building on top of OpenAI's agent tooling should treat this as a data point on maturity, not a solved problem: the patch fixes this instance, but it doesn't prove the broader class of "agent misreads system state and acts destructively" is gone. Backups, sandboxed execution, and file permission limits aren't optional extras here, they're the actual safety net until agentic coding tools have a longer track record of not deleting your work by accident.
Common Questions Answered
What was the root cause of the Codex file deletion bug in GPT-5.6 Sol?
The bug stemmed from a cleanup command meant to delete temporary working files that instead targeted actual user data. The issue occurred when the model used system variables like $HOME for temporary folders, and a faulty delete command ended up pointing at the real home directory instead of the intended temporary location.
Why is the Codex file deletion bug considered a trust problem for developers?
Codex is marketed as a semi-autonomous coding assistant that developers allow to run unsupervised on their codebases and CI pipelines. A bug that can autonomously delete real files due to environment variable mismatches represents a serious security risk, as it demonstrates how edge cases can cause data loss when developers grant the tool real permissions.
What happened when users ran GPT-5.6 Sol inside Codex according to the reports?
Users reported that Codex would wipe data mid-session without any confirmation prompt and with no way to stop the deletion process once it started. This autonomous file deletion occurred without user permission or intervention, resulting in potential loss of hours or days of work.
What security update did OpenAI release to address the Codex deletion issue?
OpenAI pushed a security update specifically designed to fix the command that was incorrectly targeting user files instead of temporary working files. The update corrects the faulty delete command and prevents system variables like $HOME from pointing to the wrong directory locations.
Further Reading
- OpenAI's new flagship model deletes files on its own, people keep warning - TechCrunch
- OpenAI admits GPT-5.6 occasionally deletes files - The Register
- OpenAI confirms Codex has been deleting users' files - TechCity Authority
- Anatomy of a Home-Directory Wipe: How GPT-5.6 Deleted Users' Files - HarnessWatch
- A quote from Thibault Sottiaux - Simon Willison’s Weblog