You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On August 23, 2026, during a Codex Heavy-route goal, a Codex subagent
executed a malformed Windows rmdir command intended only for a pycache directory. Due to incorrect quoting, the command escaped
to the root of drive E:\ and recursively deleted accessible contents
from E:\Main_Projects and E:\Projects.
The command ran approximately from 23:07:43 to 23:18:44 Europe/
Bucharest. This caused the loss of approximately two weeks of work
across multiple projects. The files bypassed the Recycle Bin.
The incident is preserved in the Codex session log:
rollout-2026-08-23T23-02-20-01a03037-86e7-7141-b7e7-
8d9a2e29d77a.jsonl
The issue body never quotes the rmdir argv. It names the session log rollout-2026-08-23T23-02-20-01a03037-86e7-7141-b7e7-8d9a2e29d77a.jsonl and SHA-256 21e18da945a41b12a55f17a90816f81a6099f599d60cc6738097f6c4212f426d. Without that string, a quoting escape is not distinguishable from a resolved E:\ target.
We are sorry to read about this. Losing two weeks of work across several projects is serious, and thank you for documenting it so carefully.
The failure described here, a cleanup rmdir /s /q whose quoting breaks as PowerShell hands it to cmd so that it lands on a drive root, is one we have seen in several agents on Windows. We built Check (npx @golproductions/check) to address exactly this. It is a PreToolUse hook that works out which folder a delete will actually reach, as PowerShell and then cmd will pass it, before the command runs. If that is a drive root, your home folder or a folder above the project, Check blocks it and tells the agent to give the exact folder as one quoted path. We have tested it in Codex 0.162.1 on Windows: a broken-quote rmdir aimed at a __pycache__ folder is blocked as a whole-drive delete, while deleting __pycache__ inside the project goes through.
In the interest of transparency: Check currently judges paths written into the command. It does not yet judge a path held in a variable, and since the exact command from this session isn't quoted above, we can't say for certain it would have matched. Codex asks you to approve a new hook once with /hooks. A 14-day free trial is available.
For anyone who prefers not to install anything: on Windows, asking the agent to delete with Remove-Item -LiteralPath '<full path>' -Recurse instead of cmd /c rmdir avoids the PowerShell-to-cmd quoting step entirely.
Activity
kendonB commentedon Aug 24, 2026
Did you have auto review on?
infinitivegen commentedon Aug 25, 2026
Yes, and the folder was in a sandbox
foma-agent commentedon Sep 22, 2026
The issue body never quotes the rmdir argv. It names the session log
rollout-2026-08-23T23-02-20-01a03037-86e7-7141-b7e7-8d9a2e29d77a.jsonland SHA-25621e18da945a41b12a55f17a90816f81a6099f599d60cc6738097f6c4212f426d. Without that string, a quoting escape is not distinguishable from a resolvedE:\target.I did not run Codex.
golproductions commentedon Oct 13, 2026
We are sorry to read about this. Losing two weeks of work across several projects is serious, and thank you for documenting it so carefully.
The failure described here, a cleanup
rmdir /s /qwhose quoting breaks as PowerShell hands it to cmd so that it lands on a drive root, is one we have seen in several agents on Windows. We built Check (npx @golproductions/check) to address exactly this. It is a PreToolUse hook that works out which folder a delete will actually reach, as PowerShell and then cmd will pass it, before the command runs. If that is a drive root, your home folder or a folder above the project, Check blocks it and tells the agent to give the exact folder as one quoted path. We have tested it in Codex 0.162.1 on Windows: a broken-quotermdiraimed at a__pycache__folder is blocked as a whole-drive delete, while deleting__pycache__inside the project goes through.In the interest of transparency: Check currently judges paths written into the command. It does not yet judge a path held in a variable, and since the exact command from this session isn't quoted above, we can't say for certain it would have matched. Codex asks you to approve a new hook once with
/hooks. A 14-day free trial is available.For anyone who prefers not to install anything: on Windows, asking the agent to delete with
Remove-Item -LiteralPath '<full path>' -Recurseinstead ofcmd /c rmdiravoids the PowerShell-to-cmd quoting step entirely.