r/vibecoding • • 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 .

1.1k Upvotes

395 comments sorted by

20

u/RecursiveServitor Feb 19 '26

Don't keep us in suspense. Could you recover the files?

19

u/Former-Airport-1099 Feb 19 '26

I recovered a decent amount of files but a lot of python files are gone, and a lot of files are truncated and duplicates

15

u/Potential-Leg-639 Feb 19 '26

Set up your own Gitea (self hosted) and always also commit to the remote, then you are safe

1

u/Former-Airport-1099 Feb 19 '26

yeah it's my fault thank you for the advice

→ More replies (9)

1

u/im_just_using_logic Feb 19 '26

Was it an SSD or a disk-based hard drive?

→ More replies (3)

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.

4

u/Former-Airport-1099 Feb 19 '26

Yeah lack of experience :/

6

u/deific_ Feb 19 '26

Wait, were you not uploading commits to GitHub? You need to integrate that into your process immediately. Then if this happens you don’t lose your project, sure other stuff is gone, but that’s too much work to chance it.

1

u/Former-Airport-1099 Feb 19 '26

I never really thought of commiting to github, I have just been learning how code actually work made some small projects but never commited anything, but the project that got deleted was the first time I actually spent a lot of time on making it, how this all happened is because I asked codex can you rebrand Killshot to Orie and yeah it somehow deleted everything. I won't make the same mistake anymore.

→ More replies (1)
→ More replies (1)

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.

3

u/Former-Airport-1099 Feb 19 '26

We're cooked lol

→ More replies (1)

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/Former-Airport-1099 Feb 19 '26

it was running in the project directory but I did give it full access tho

→ More replies (12)

3

u/HMHAMz Feb 19 '26

What "project" were you working on called 'killshot' - or maybe we dont want to know 🤣🤣

1

u/Former-Airport-1099 Feb 19 '26

looool well it was an osint investigation tool the name is aggressive lol, guess codex guardrails started tingling when it saw osint and killshot, anyway killshot got killed :')

→ More replies (1)

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.

1

u/Former-Airport-1099 Feb 19 '26

yeah this is exactly what I'm gonna be doing from now on full access or not, thank you for the advice

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.

1

u/Former-Airport-1099 Feb 19 '26

there is default and full access, I gave it full access it could have wiped my whole system32

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. 

2

u/Former-Airport-1099 Feb 19 '26

when you give it full access it stops asking for permission

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

30

u/Evajellyfish Feb 19 '26

Worlds safer with those being deleted actually

8

u/cold-mcspicy Feb 20 '26

after nuking the world I’m really sorry— this was my fault.

3

u/kdenehy Feb 19 '26

Still be safer than where they are now.

→ More replies (3)

2

u/nickk024 Feb 19 '26

“I know Codex should be smart” Oh, honey…

1

u/Former-Airport-1099 Feb 19 '26

😂😂😂 can't wait for AGI

→ More replies (1)

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.

1

u/Former-Airport-1099 Feb 20 '26

No don't worry lol, if I was doing it professionally I would be ashamed to post it on reddit lol

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

1

u/Former-Airport-1099 Feb 22 '26

I'm gonna swallow the pill and install Linux mint or something lighter my laptop is already not that great

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

1

u/Former-Airport-1099 Feb 23 '26

Well yeah I did recover a lot of files, some are truncated some are duplicates, but no matter what I tried I wasn't able to get back a lot of python files.

Also: I agree

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.

20

u/TheOneNeartheTop Feb 19 '26

Don’t delete everything.

… delete everything.

Delete everything!

→ More replies (2)

14

u/manchesterthedog Feb 19 '26

Anything that isn’t version controlled, no direct LLM access

→ More replies (3)
→ More replies (7)

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.

5

u/PleasantAd4964 Feb 19 '26

what vm would you recommend?

9

u/the_shadow007 Feb 19 '26

Codex has sandbox by default

11

u/vayana Feb 19 '26

This is what I don't understand... It's sandboxed and asks for permissions and you should always use git and provide agent instructions in the agents.md file.

It would kind of help if codex just checked the os and terminal it has access to though. I put it in agents file nowadays since it prevents codex from trying to run bash commands in Powershell.

→ More replies (4)
→ More replies (8)
→ More replies (9)
→ More replies (1)

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?

17

u/shakeBody Feb 19 '26

The answer here is yes. Imagine picking up programming without having any preexisting knowledge of the tools available. Even with the recommendations that an LLM gives there is still a whole lot that just won’t enter the picture.

LLMs only amplify the abilities of the user.

6

u/onlyonequickquestion Feb 19 '26

In this case, even if they had their project in git, it deleted EVERYTHING on their F drive, which could have included lots of non vc'd stuff. So they'd be able to recover their project at least, but depending on what else was on that drive, could be a big boo-boo 

4

u/thunderberry_real Feb 20 '26

It’s true that deleting a whole drive is outside of what Git can handle… but the point is your agent is restricted to your Git repo. and only by REALLY being reckless and not doing that (and not needing to confirm such commands) can you get into big trouble like this.

→ More replies (4)

3

u/deific_ Feb 19 '26

It’s kind of crazy isn’t it? Haha. I mean I’m no software dev but I thought GitHub was pretty well known to be the way to do business.

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.

1

u/Former-Airport-1099 Feb 19 '26

I don't know actually I guess I was like oh llms are getting very smart and it's codex 5.3 and it had god access for little while nothing happened. Dumb behavior I know :/

13

u/xRmg Feb 19 '26

And thats why you use devcontainers with named volumes kids.

→ More replies (3)

12

u/t3ramos Feb 19 '26

codex with powershell sucks, and this is why it happened. install wsl2 and nether look back

8

u/SnooPuppers1978 Feb 19 '26

Why not just use linux like a normal person? Well I mean dualboot so you can still game.

→ More replies (4)
→ More replies (1)

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.

→ More replies (2)

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?

15

u/dvghz Feb 19 '26 • Regret

Welcome to the team. I stopped using Gemini because of this. Happened TWICE

17

u/BabyJesusAnalingus Feb 19 '26

Why not just use VMs? Seems like a very simple solution after the FIRST time it happened. Versus just avoiding Gemini, that is. Let me know if you need any help, boss.

4

u/BreathingFuck Feb 19 '26

This is exactly what I do. I run everything inside a VM on Compute Engine per project. It’s not even just about AI. Sometimes I fuck up the computer and need to nuke it and restart. VM with a backup disk makes that a 30 second task.

→ More replies (2)

3

u/dvghz Feb 19 '26

Thank you but that was when Gemini 2 came out, and I was using Gemini CLI on an old laptop I had laying around. Now I just sandbox them

→ More replies (1)
→ More replies (2)

4

u/recigar Feb 19 '26

gemini dgaf about overwriting stuff. I’ll be like here’s an idea based on this, can you give suggestions and it’ll just start overwriting it lmao. I have to add “do NOT overwrite anything”, altho now I just don’t use gemini

2

u/anarchist1312161 Feb 19 '26

That's your fault, not the fault of Gemini. Use a VM or Sandbox.

→ More replies (3)
→ More replies (1)

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.

11

u/twijfeltechneut Feb 19 '26

Devcontainers are your friend. You can install your AI agent into the container and mount your project folder into them. The agent can run with full permissions while never being able to touch anything on your system.

→ More replies (1)

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/Former-Airport-1099 Feb 20 '26

alright no need to attack me like that the codebase wasn't a sloppy mess, I don't really use codex much I just thought let me ask it to do a rebrand of my project like change names from imports and any mentions and making sure it doesn't break the project, I gave it full access so I don't have to accept everything, it's completely my fault, and to be completely honest the command that did it all I wouldn't even have thought it would cause all that damage because it does look innocent here is what codex said:

so why did my files get deleted ?

Because I ran a bad delete command with broken quoting, and cmd interpreted it as “delete from drive root.”

I ran:

Get-ChildItem -Recurse -Directory -Filter __pycache__ | ForEach-Object { cmd /c "rmdir /s /q \"$($_.FullName)\"" }

What went wrong:

  • In PowerShell, \" is not valid escaping like in bash.
  • That broke the quoted path being passed to cmd /c.
  • rmdir ended up targeting \ (root of F: in that session) instead of each __pycache__ directory.
  • So it started deleting far beyond the project folder.

So yes: this was my command error, not something you asked for.

one question why did you decide to target pycache ?

Because I saw old __pycache__/.pyc files during the rename cleanup and tried to remove them as harmless build artifacts.

That decision itself was unnecessary and not required for your rebrand request. I should have left them alone.

→ More replies (1)

1

u/No-Hamster-5870 Feb 19 '26

you get what you deserve

1

u/Former-Airport-1099 Feb 19 '26

yeah I deserve my files to get deleted you are right

→ More replies (1)

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

2

u/IllicitDreamer Feb 20 '26

you know an instruction is not the same as ‘running in sandbox’ right?

→ More replies (1)

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?

→ More replies (1)

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

1

u/Employer-Dizzy Feb 20 '26

Like I don’t even understand how a prompt can even get close to doing something this insane that Shi is crazy

1

u/Former-Airport-1099 Feb 20 '26

I literally just asked it to do a rebrand of the project change the mentions of the old name and make sure nothing breaks and it went to delete cache and other stuff and then the issue was in this part:

Instead of using native PowerShell:

Remove-Item -Recurse -Force $_.FullName

it used:

cmd /c "rmdir /s /q \"$($_.FullName)\""

That crosses:

PowerShell ➝ cmd.exe ➝ rmdir

→ More replies (1)

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.

→ More replies (1)

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

Powershell

Why are you not using Codex inside WSL?!

2

u/[deleted] Feb 19 '26

That's what you get for using wind0ze

8

u/pmckizzle Feb 19 '26

Yeah because it wouldnt just run rm -rf / and half of the people who call themselves vibe coders just go gee ok

→ More replies (5)
→ More replies (1)

1

u/lllorrr Feb 19 '26

So, instead of using sed or "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?

→ More replies (1)

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/argus404 Feb 19 '26

honest mistake tbh

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/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/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/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/MegaDork2000 Feb 20 '26

Dang. Here I am forbidding Codex from even adding files to git while you are here allowing full access to delete your entire hard drive. Welp. Unfortunately rmdir does 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/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?

→ More replies (5)

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/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

The bug: " is not valid quote escaping when you mix PowerShell and cmd /c.

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 🤣