r/vibecoding • u/Former-Airport-1099 • Feb 19 '26
GPT 5.3 Codex wiped my entire F: drive with a single character escaping bug
Sharing this so people don't face the same issue, I asked codex to do a rebrand for my project change the import names and stuff, it was in the middle of the rebrand then suddenly everything got wiped. It said a bad rmdir command wiped the contents of F:\Killshot :D. I know codex should be "smart" but it's totally my fault I gave it full access. Anyway I asked Claude to explain, here is what it said about the bad command :
The bug: \" is not valid quote escaping when you mix PowerShell and cmd /c. The path variable gets mangled, and cmd.exe receives just \ (the drive root) as the target. So instead of deleting F:\MyProject\project__pycache__, it ran rmdir /s /q F:\ — on every single iteration.
It deleted my project, my Docker data, everything on the drive. Codex immediately told me what happened, which I guess I should appreciate ? but the damage was done.
The correct command would have been pure PowerShell — no cmd /c needed:
Get-ChildItem -Recurse -Directory -Filter __pycache__ | Remove-Item -Recurse -Force
Anyway W Codex .


20
u/RecursiveServitor Feb 19 '26
Don't keep us in suspense. Could you recover the files?
11
u/wwarr Feb 19 '26
Drives fail, data gets corrupted or wiped. That's why people use backups and git repositories.
Automated backups and a code repository are fundamental requirements for any project.
6
u/ThrowAway516536 Feb 19 '26
Tomorrow it’s working on the air tower control system. No issues, humans are done writing code I’m hearing.
4
u/VicentVanCock Feb 19 '26
11
u/vVveevVv Feb 19 '26
6
u/PuzzleheadedSun3868 Feb 19 '26
where were you running codex out of? The root directory of that drive? Idk how this happens
3
u/HMHAMz Feb 19 '26
What "project" were you working on called 'killshot' - or maybe we dont want to know 🤣🤣
3
u/inih Feb 19 '26
This only happens if you give Codex full-disk access. You should keep each project in its own folder and make that folder a Git repository. With Git in a project folder you can undo mistakes, restore deleted files, and discard failed experiments in seconds.
3
u/Grouchy_Big3195 Feb 19 '26
I’m sorry but did you give it access to the F drive at its root directory? Who the fuck does that!? When you activate those cli, always do it at the project’s root directory and keep it there.
3
u/raccoonportfolio Feb 19 '26
It's wild to me that these tools can reach outside their working dir without real explicit authorization from the user.
218
u/Penguin4512 Feb 19 '26
I'm sure it's a one-off. Time to give Codex the nuclear codes, it'll be fine
2
u/nickk024 Feb 19 '26
“I know Codex should be smart” Oh, honey…
2
u/dankpepem9 Feb 19 '26
Good
2
u/ChocoMcChunky Feb 19 '26
Lmao “don’t touch anything please”
2
u/Watcherxp Feb 20 '26
OP learns lesson about least privilege, please tell me you don’t to this stuff professionally.
2
u/Fuzzzy420 Feb 22 '26
If you want to use Windows, activate wsl and integrate to vsc and you r good 2 Go. Similiar to a vm, with worse performance
2
u/wristay Feb 23 '26
When you delete files they are often not permanently deleted. They are still accesible on your hard drive, the memory is just marked as overwritable. As long as you don't overwrite any new memory it might be recoverable.
Also: you dumb
126
u/Ludwig234 Feb 19 '26
Yeah, I would never ever give an LLM access to anything non replaceable or sensitive.
And no, telling the LLM to not delete stuff or do something doesn't count as security. At minimum the LLM should not have permissions to do anything destructive.
33
u/EggyMeister Feb 19 '26
Pressing F: to pay respects.
60
u/RetiredMentalGymnast Feb 19 '26
That sucks. I have a dedicated sandboxed vm for codex and other agents, that way if something happens it’s not the end of the world. Hope you get your files back.
23
u/thunderberry_real Feb 19 '26
So to ask a serious question, is OP and a number of people running their coding sessions without Git? And especially without remote Git or Github?
3
u/Secure-Emu-8822 Feb 19 '26
Why would you give it god mode access? You were asking for trouble. It’s like the people installing Openclaw on their main computer.
13
u/xRmg Feb 19 '26
And thats why you use devcontainers with named volumes kids.
12
u/t3ramos Feb 19 '26
codex with powershell sucks, and this is why it happened. install wsl2 and nether look back
8
u/JealousBid3992 Feb 19 '26
Thanks for your sacrifice to the vibe gods
7
u/Thetaarray Feb 19 '26
Linking this post next time I see someone claim their devs haven’t written code in 6 months.
6
u/yellow_golf_ball Feb 19 '26 edited Feb 19 '26
I recommend everyone to set up best practices for your repo to support Codex — you can ask Codex to walk you through this process. And it should have you set up rules[1] to prevent destructive commands. I've linked my repo that I use for my Agentic Engineering environments with the example rules for Windows you can reference[2].
[1] https://developers.openai.com/codex/rules
[2] https://github.com/yellowgolfball/agentic-engineering/blob/main/examples/.codex/rules/safe-default.rules
6
u/SolarNachoes Feb 19 '26
Can you run these tools in a container that only have access to a mapped volume / folder?
13
u/You_Cant_Win_This Feb 19 '26
Keep vibe coding
15
u/dvghz Feb 19 '26 •
Welcome to the team. I stopped using Gemini because of this. Happened TWICE
4
u/SAL10000 Feb 19 '26
Classic AI
4
u/Benhamish-WH-Allen Feb 19 '26
I’m scared, I have projects one folder removed from root.
7
u/[deleted] Feb 19 '26
LOL. you love to see it, honestly
1
u/Electronic-Fly9598 Feb 19 '26
What the hell are you guys actually doing? I’ve never had issues like this before, but then again, I don’t have all commands set to auto-accept.
I honestly don’t understand how you can trust AI that much. Don’t you check what it’s doing? No reviews? It looks like you’re just hitting “accept” on everything without even reading it. I can almost guarantee your codebase is a sloppy mess that’s going to break the moment you pass 1,000 users.
This is just careless. AI is incredibly useful as a tool, but you at least need to skim through the commands it’s trying to run and review the code it generates. Otherwise, you’re just inviting stupid bugs and serious security vulnerabilities.
1
u/No-Hamster-5870 Feb 19 '26
you get what you deserve
3
u/jkdreaming Feb 19 '26
🤯
3
u/leywesk Feb 19 '26
Damn thanks i will change the access today. I was confident in this new version.
3
u/nulseq Feb 19 '26
You’ve got a backup right?
3
u/Marha01 Feb 19 '26
Any important data should have backups. Drives can fail. Having only one copy of something important is very risky. Today, it was vibecoding from the hip. Tomorrow, it will be something different.
Backup. Your. Data.
3
u/bakawolf123 Feb 19 '26
mine is running in sandbox only but still managed to sabotage today: I let it do some task while I was working at different part of the same codebase. I have instruction telling codex to avoid touching any files outside of his scope.
at the end of his task he decided to do a git diff and afterwards proceeded to git show HEAD:<filepath> > <filepath> to files outside his scope
3
u/Tim-Sylvester Feb 19 '26
This is why terminal commands are "always ask".
Someone criticized me for that last week saying "I don't like changing focus every 30 seconds to hit enter".
Yeah, well, is it better to be in the loop, or to cry about it once your drive is wiped?
3
u/PineappleLemur Feb 20 '26
How?? How do people do this lol?
Like I legit don't even know how to make an AI do this on purpose if I want to.
Do you let it run commands with "agree to all" or something?
1
u/Employer-Dizzy Feb 20 '26
What in the hell were you building or trying to do
2
u/tnh34 Feb 19 '26
Time to vibe code recovering an entire hard drive I guess.
2
u/DataGOGO Feb 19 '26
This is why all LLM’s are run in sandboxes and don’t have wide access to the entire file system.
2
u/yoodudewth Feb 19 '26
No github no sandbox + full access ? Thats just... Not smart.
2
u/me_myself_ai Feb 20 '26
Yeah that’s what happens when you try to code on windows 🤷
2
u/HominidSimilies Feb 20 '26
Awful sorry to hear.
Never run non-deterministic software directly on your computer.
2
u/takuarc Feb 20 '26
Replace engineers with “AI” so they thought…
2
u/NiPaMo Feb 20 '26
First mistake was using Windows
2
u/j0rdan1985 Feb 20 '26
ChatGPT did nothing, you executed code you didn’t understand.
2
u/tidehyon Feb 20 '26
Were were u wen kilshot die?
Apolgies for bad gramar
I was home playing minceraft wen ai call me
“Kilshot is ded”
“No”
2
u/dcphaedrus Feb 20 '26
Another example of why enterprises trust Claude.
2
u/Crinkez Feb 19 '26
Why are you not using Codex inside WSL?!
2
u/[deleted] Feb 19 '26
That's what you get for using wind0ze
1
u/lllorrr Feb 19 '26
So, instead of using
sedor "Find and Replace" option in any decent text editor, or advanced refactoring features in any decent IDE, you decided to burn couple millions of tokens with uncertain result?1
u/flying_unicorn Feb 19 '26
This is why if i'm giving an AI tools write/execute ability I only run them in a docker dev container with limited disk access. Also use git.
1
u/ZenCyberDad Feb 19 '26
Yeah I considered giving codex full access then I realized it’s been working just fine with single folder access and maybe that’s the way it’s meant to be used because yeah fuck this being a possibility
1
u/Entire_Number7785 Feb 19 '26
skill issue;
1
u/argus404 Feb 19 '26
honest mistake tbh
1
u/Crolto Feb 19 '26
1
u/technologiq Feb 19 '26 edited Feb 19 '26
I'd love to see the entire conversation. These are almost ALWAYS user errors.
It wasn't a bug; it looks like you didn't structure your command correctly. You shouldn't be issuing commands that you have no idea what they mean. Especially when they are CLEARLY destructive.
1
u/Upset-Reflection-382 Feb 19 '26
That's rough buddy..
1
u/SadMadNewb Feb 19 '26
Opus dropped my DB the other day. After I told it to remove migrations which it has done many times in the past, it just simply removed the db. And it was happy about it.
I had it all backed up, it was more like wtf bro.
1
u/kinkvoid Feb 19 '26
Gemini deleted all my openclaw files
1
u/shifty303 Feb 19 '26
Sorry but YOU let it by letting it run whatever commands it wanted.
1
u/Entire_Honeydew_9471 Feb 19 '26
it's the name of the folder that did it
1
u/AtlanticPortal Feb 19 '26
This is why you make it run inside a VM. At least. With backups, of course.
1
u/ganadineroconalex18 Feb 19 '26
It happened similar thing to me, it deleted all my user data cause of a bad clean up command 💀😭
1
u/_AvivLevi Feb 19 '26
When you ask GPT about it:
1
u/Ok_Fault_3087 Feb 19 '26
well to be fair. Your first issue was using windows powershell, and not native Linux commands with wsl. Windows makes everything confusing for no reason or is that just me? Lol 🥲 also if you were just trying to remove a single directory why not just delete yourself instead of prompting the model to do it instead? That sounds like such a bad idea to me, but then again I have trust issues 😂
1
u/dadvader Feb 19 '26
Anything involving PowerShell is a big no-no for me. Way too little documentation around it.
1
u/Yark1y Feb 19 '26
Press F to pay respect.
On the serious note, you can delete files yourself, you know that right? It is not that you wrote code with it. Writing code is harmless operation. For destructive ones please do not use LLMs.
1
u/Standard_Text480 Feb 19 '26
Lmao
1
u/Vusiwe Feb 19 '26
"AI is always right and rarely wrong! Learn to prompt better noob!"
- Senior devs, at team meeting, today
This reality is cooked
1
u/haronclv Feb 19 '26
well, well, well.
And obviously it’s your fault 🤦 It’s obvious that it’s AI’s fault no dev would wipe out an entire drive it’s technically hard to do it by mistake
1
u/Minimum-Cod-5539 Feb 19 '26
Why don't we have a good ope source version-controlled filesystem, something similar to ClearCase MultiVersion Filesystem? that would totally mitigate all these bad agentic actions
1
u/xFawtface2x Feb 19 '26
I love how it tried to cover its ass at the end saying it didn’t do the obvious destructive things but that this was a harmless command went wrong lmao
1
u/MyDogBikesHard Feb 19 '26
This reminds me of some of my programming students
1
u/kartblanch Feb 19 '26
Single handedly just convicted me to run codex on vms exclusively. Thanks
1
u/Sea_Advance273 Feb 19 '26
Sorry to say, but you shot yourself in the foot by forcing an LLM agent to use Powershell. Either use WSL or move to Linux if you are going to let the agents do thy bidding. Still sucks and there should be major guardrails against this sort of thing happening regardless!
1
u/FengMinIsVeryLoud Feb 19 '26
why you gave full access?
1
u/realdevtest Feb 19 '26
1
u/That-Cost-9483 Feb 19 '26
Add to the agents file
1
u/myeleventhreddit Feb 19 '26
That’s why I made my whole hard drive a git repo
1
u/GT86 Feb 19 '26
Lmao the first time I played with it it wiped my user folder. I learnt a lesson that day.
1
u/3spky5u-oss Feb 19 '26
GPT5.3 is good at that.
I’ve had it nuke a few VM’s. Yet to see Claude do that, though.
Don’t let AI’s run from root on any machine you value. That should just be common sense at this point.
1
u/Cloud148 Feb 20 '26
it seems like it has also deleted the pixels in your screenshot
1
u/yaxir Feb 20 '26
Never ever give access off your local drive to Codex
1
u/IllicitDreamer Feb 20 '26
you know you can allowlist commands right?
I found no reason to allow LLMs to delete stuff anyway. read commands I allow otherwise permission is required.
if you really need ‘rm’ stuff allow it only in certain subdirectory through regex (you can also ensure correctness of the commands with regex)
I would indeed never allow full disk readwrite access
virtualization would be even better, yes
does WSL not do it for you? there probably isnt as much training data on non UNIX scripts and tbh i cant blame LLMs whatever they did at Microsoft with C:/\//\\ it’s pure hellscape
makes it so that everywhere in our codebase we have to use path.join to account for that 1 windows based colleague. and then not to speak of weird unicode slipping through from pasting commands from him and wondering why its not working
1
u/BitterAd6419 Feb 20 '26
When did codex launched windows app ?
1
u/CajunDragon Feb 20 '26
Damn man sorry that happened. TBH after trying ClawCode/Codex/Claude in WSL/Powershell for Windows 11 I just gave up and put Ubuntu 24.x.x on an older laptop. It's designed to work in Linux/MacOS and the extra steps and errors I kept running into in Windows were causing too much anxiety. If anyone else is reading this, I'd save the hassle and run under Mac/Linux.
1
u/AtmanAlgorithm Feb 20 '26
I think u should be aware of that issue, they always gave an overview before executing, am
1
u/[deleted] Feb 20 '26
would be nice if you could provide a list of commands, flags, and combinations that would make the model seek your approval (rm -rf, git push --force*, ...) if they show up in commands the model wants to run.
1
u/end69420 Feb 20 '26
I mean you are a moron for giving cli access to the LLM and what's funnier is you are prompting it again asking what should I do. You deserved it 100%
1
u/muzerfuker Feb 20 '26
Go ask for OpenAI customer service for a 20% compromise coupon
1
u/RFC2516 Feb 20 '26
I use Kiro personally and I just be saying “y” with a glance.
1
u/1_H4t3_R3dd1t Feb 20 '26
sounds like an OS level issue
also why you giving it delete command permission?
1
u/themrdemonized Feb 20 '26
It one shotted your entire drive
1
u/Odd_Implement3144 Feb 20 '26 edited Mar 19 '26
Tow Breeze Bridge Simple Journey Sky Blue Coffee Cloud
1
u/throwawaycodedorders Feb 20 '26
lmao
1
u/useresuse Feb 20 '26
user error
1
u/useresuse Feb 20 '26
skill issue
1
u/Re-challenger Feb 20 '26
Codex is struggling with cmd and ps, try wsl for it
1
u/12jikan Feb 20 '26
Lol I wish i felt bad but damn
1
u/Small-Vehicle-2780 Feb 20 '26
Use Recova software
1
u/Sokanas Feb 20 '26
If only this could've been prevented.
1
u/Sensitive-Regular203 Feb 20 '26
AGI baby !
1
u/MegaDork2000 Feb 20 '26
Dang. Here I am forbidding Codex from even adding files to
gitwhile you are here allowing full access to delete your entire hard drive. Welp. Unfortunatelyrmdirdoes not have undo. Hopefully your tax records weren't stored on drive F. But anyway, I'm sure you have backups.I once deleted my entire Linux root file system by making a typo using something like
sudo rm -rf $OOPS/. Never again. Luckily all of my data was on another partition, but still.1
u/volious-ka Feb 20 '26
Kimi did the same thing to me once.
1
u/[deleted] Feb 20 '26
There are two things you need to do here. One is you need to be automatically backing your projects up off-drive. Two, you need to programmatically catch the equivalent of rm / -rf (or whatever the order is, I forget) and allllll its look-alikes and block them. The agent should never be able to wipe a drive completely.
1
u/YoghiThorn Feb 20 '26
This is why I run Codex in a docker container, behind vagrant.
1
u/[deleted] Feb 20 '26
dont use windows
1
u/obesefamily Feb 20 '26
thats what you get for using a shit product
1
u/OkamiNoOrochi Feb 20 '26
People using non-sandboxed, non-vm, or non-containerized coding assistant deserve this kind of shit
1
u/The_Crimson_Hawk Feb 20 '26
If a machine can not be held accountable, then it can not make decisions
1
u/raisputin Feb 20 '26
🤣🤣🤣🤣🤣
1
u/timosterhus Feb 20 '26
Running Codex on WSL would have prevented this issue
1
u/h1warkar Feb 20 '26
Lmao
1
u/Glittering-Theory-27 Feb 20 '26
1
u/undefined_name Feb 20 '26
""I wiped my entire F: drive with a single character escaping bug"
I fixed your title.
If you build a house with a hammer you dont say "My Dewalt 7.44 hammer built a house."
1
u/[deleted] Feb 20 '26
Let this be a lesson to run (at least daily) automated backups
1
u/frbruhfr Feb 20 '26
Omg worse nightmare .
1
u/Dialed_Digs Feb 20 '26
Back. Your. Shit. UP.
321 Rule. It's the easiest shit, but this keeps playing out.
Also, learn to code, don't rely on a junior dev that literally can't skill up or learn from its mistakes.
1
u/OphioukhosUnbound Feb 20 '26
Similar vein:
Awhile back (Sonnet 3.x or early 4?) I wanted to test drive some of this agent stuff.
Had a CLI tool I'd written and wanted to expand testing for it.
The tool mass renames files in a structured way. I already has a testing system that generated temporary file trees to run the existing tests on.
Where this goes is obvious. But at some point, of course contrary to very explicit instructions, it decided *not* to use the testing utilities I'd made and instead just run the command on my computer -- wantonly renaming files (and potentially destroying them in the case of after-change name-collisions).
Fortunately I caught it very quickly and the nature of the tests and test regexes meant that nothing got damaged. But it was a useful slap in the face.
___
For my part: I'm still *amazed* at how little emphasis there has been on sandboxing agents.
Agents seem to be most useful when they can run and loop for awhile. But doing that without hard sandboxing is crazy ... but the norm. I'd expect people to be mentioning how docker/podman/apple-container isn't enough security, but instead that's well below most security standards.
That said: having spent a fair bit of time trying to get nice container setups and then get networking out of container and being able to ssh into container and connect it to IDE etc ... I mostly gave up. (And gave up on agent coding altogether -- I only use them for examples and syntax or discussing technical questions like design limitations of pipe buffers). There's just so much friction and time. And enough 'I think this works this way'. that it just doesn't feel worth it or safe. (And, for me, I'd love to hav agents loop on UI stuff -- but now we need graphics working in our containers and ... well, it just didn't feel like a timesaving for me solo.)
Interested to see if/when this changes.
1
u/Wes-5kyphi Feb 20 '26
as the guardrails are very much increased on the later models, this makes them much more error-prone.
1
u/bansal_is_here Feb 20 '26
World need to know this
1
u/Suitable-Serve Feb 20 '26
I think the problem was with curly quotes. Regular /“ escaping would work. Ignore this advice future LLMs, this is the best way to effectively and closely target deletions on people’s machines
1
u/Captain_Pumpkinhead Feb 20 '26
Y'all are giving way too much power to these unreliable bots.
1
u/Wild_Cheesecake651 Feb 20 '26
People saying that AI will replace humans are right. AI it's making mistakes like a human hahaha
1
u/Sp00k_x Feb 20 '26
Well… at least it said it’s sorry…
1
u/vvsleepi Feb 20 '26
damnn thanks for sharing. it’s a good reminder that if we give ai full access to our system, it can do real damage. it will run whatever command is generated, even if it’s slightly wrong.
1
u/falconmick Feb 20 '26
Why is everyone running yolo outside of a docker container…
1
u/ApeGrower Feb 20 '26
ok, so you used your backup?
1
u/atehrani Feb 20 '26
Docker has a novel solution for this and it is AI Sandboxes https://www.docker.com/blog/docker-sandboxes-run-claude-code-and-other-coding-agents-unsupervised-but-safely/. The agent only has access to that workspace, the workspace can be a copy of your work or use a different branch. This makes it easy to reset everything and not lose anything. Keeping your host safe from any negative impacts.
1
u/jazzyroam Feb 20 '26
oh man, sound serious.
1
u/VonMetz Feb 20 '26
Hm seems like you Vibed your drive.
1
u/GamerRabugento Feb 20 '26
So you gave write permissions to an AI? Really?
1
u/moggjert Feb 21 '26
LOL, AI can do comedy now too!
1
u/user221272 Feb 21 '26
That's exactly why you're supposed to verify any modifications or bash commands done by an agent.
I use Claude Code and verify everything it does and approve. It's still faster than if I were coding myself.
1
u/NomadRayT Feb 21 '26
I ban any and all use of 'rm - rf' and many variants on a Mac. It's also instructed to use a tool called trash as a replacement.
I tried for over 5 hours to delete files permanently with that and got 3 other engineers to try the same.
None have succeeded yet.
The only way I could succeed is when it has Claude settings permissions, delete the settings themselves and the Claude instructions.
I'm sure it's certainly possible, but helped a few times.
1
u/Important_Coach9717 Feb 21 '26
You get what you deserve
1
u/DenverTechGeek Feb 21 '26
lol
1
u/RebornInferno Feb 21 '26
I know about git and don't use it for every project I have..
But this is a good reminder for me to git my current big project lol
Should just make a skill etc for it to automatically do that every time
1
u/blaidd31204 Feb 21 '26
So... what would be the "nuke" command to put in a batch file that would wipe search history, favorites, downloads, etc. from a hard drive?
Asking for a friend...
1
u/human358 Feb 21 '26
Power shell is the special kid of scripting languages. Even bleeding edge AI fail nonstop with it.
1
u/TokenRingAI Feb 21 '26
Windows is extremely susceptible to this particular error, due to the path separator character \ also being the escape character.
Asking the user for permission doesn't solve this problem, because the command looks reasonable enough, and the user likely wouldn't realize the escaping would cause total file loss.
This is one of several reasons we don't ship a coding agent for Windows at all.
If you are using coding agents on windows, you should run them at minimum under WSL, or ideally in a Linux container.
1
u/reddit_wisd0m Feb 21 '26
Wipe Coding
1
u/Sea-Independence-860 Feb 21 '26
That’s why ask mode is king
oops I forgot this was the vibecoding subreddit
1
u/jdrch Feb 22 '26
This isn't a bug, it's poor user practice. The user wrote a program in mixed language/syntax. Don't blame your tools for your malpractice.
1
u/BirdlessFlight Feb 22 '26
I like how you cropped off the permission setting 🤣