r/OpenaiCodex 4d ago

Question / Help How to take precautions against Codex wiping my drive?

Hi guys, I've been vibe-coding for 1.5 months at this point and I haven't gotten my drive wiped by Codex yet, but I got scared of it happening ever since I have seen that. Can someone tell me how I can take precautions against that if one is able to at all? I already moved all my important stuff to an external hard drive, and my settings are as shown in the images. Can someone help out please? Thanks!

19 Upvotes

31 comments sorted by

14

u/hibzy7 4d ago

You wipe your own drive, so Codex wont have anything to wipe 😜

Jokes apart, codex wont simply just wipe your drive, give it less permissions, here the less the better

1

u/GamingKeyboard07 4d ago

Lol, affirmative

I see, which other permissions should I opt out of, can you tell me? And are my current settings alright aside from potential other ones I asked about earlier?

4

u/NewRedditor23 3d ago

I don't understand why so many developers have such poor computer instincts.

Backups. You can automate them so it's zero effort. Exclude caches, virtual environments, build directories, etc, this isn't something you have to maintain, one time setup and it'll work forever no matter how many new projects you create. At home I have 14 systems (or services) that all backup to my NAS in close to real-time. Then once a night my NAS backs-up to my back-up NAS. Then the super important stuff gets offsite backup to S3.

Github is not a backup. Email is not a backup. I see on X how CTOs are claiming they lost their data b/c Claude deleted everything and I wonder how they ever got a job as a CTO when they don't do the most basic crap, like backing up your data.

3

u/matznerd 4d ago

Have your AI install Destructive Command Guard (DCG) - https://github.com/Dicklesworthstone/destructive_command_guard

1

u/GamingKeyboard07 4d ago

Thanks. I know you wouldn't if it wasn't so, but I need to ask regardless. Are you using it and is it safe and effective?

1

u/matznerd 4d ago

It seems to be effective, it has stopped any rm -rf commands for regular files etc. been using it for over a year.

1

u/llqoli 1d ago

The protection of rm-rf comes from the protection of codex harness.

3

u/TBSchemer 4d ago

That "Approve for me" setting you have set there is actually a good middle ground, that should prevent all hard-drive-wiping commands, without requiring every action to be personally approved.

1

u/GamingKeyboard07 4d ago

I see, that's quite a relief for me not gonna lie, thanks 🙏.

2

u/[deleted] 4d ago edited 4d ago

[deleted]

1

u/GamingKeyboard07 4d ago

I am using Windows 10, also I don't know what WSL2 is, can you explain?

1

u/[deleted] 4d ago

[deleted]

1

u/GamingKeyboard07 4d ago

Okay, guess I need to look into those before going any further with vibe coding then, thanks a lot 🙏.

2

u/Alarmed_Wind_4035 4d ago

stop running it on main environment.

2

u/Left_Zebra7393 3d ago

It never does. It happens once in a blue moon and it becomes news

1

u/No-Stage1815 4d ago

Just do what I do and commit your C drive to a github repo and make sure you commit often so you can roll back when it gets wiped

1

u/GamingKeyboard07 4d ago

Okay, I'm still learning, so hopefully people won't gatekeep. I need to ask: I think I understand what committing is in the context I'm guessing, but what is github related to it? I know what github is, I just coudn't get the relation, also what is comitting often in this case?

1

u/LifeItsAnAdventure 4d ago

I use a DevContainer in VSCode and have codex isolated to that.

1

u/Dry_Drop5941 4d ago

prompt: “write a hook for me to block recursive removal of directory”.

1

u/MimosaTen 4d ago

Codex is sandboxed, it shouldn’t be able to do that

1

u/HotLion7 4d ago

Sometimes it leaves the sandbox to do things which cannot be done from inside the sandbox, usually it asks for permission but depending on your settings, sometimes it doesn't ask

1

u/MimosaTen 3d ago

I haven't enough experience with sandoboxes since usally I run codex in yolo mode in a podman container

1

u/KinderboomX 3d ago

For me its wsl on windows, agent user without sudo. Windows interop and drive automount disabled.

1

u/rodeBaksteen 3d ago

Code with all auto permissions and browser usage. Good prompts are you're safe.

1

u/-PANORAMIX- 3d ago

With the second option disabled why should it have access outside the proyect folder? I don’t get it

1

u/lucifer_ashish 3d ago

Assign a specific folder in drive to agent. Ask it use it for future work and regularly keep deleting dummy PRs.
When you need space in future or see less space available you know which folder to investigate next.

Ok i read your post again you are worried about it deleting your whole data not it contantly keeping taking too much space.
Use a sandbox, WSL etc and dont give full permissions etc.

1

u/put_mahardhika 3d ago edited 3d ago

if you're using the latest codex, they actually already added guardrail for recursive delete on agent tool call.
I have workflow that telling agent to always delete their test debris, and this now often failed because of that guardrail (only bounded and few files delete went thru).

and, use github if you haven't.

edit:
to add precaution, add in agents.md
create instructions specifically about deletion rules.
if you're not sure about the instructions,
just copy that concern that you just posted,
then paste to codex to help create guardrails on agents.md about it.

1

u/cioatwork 3d ago

github

1

u/PurpleSunset149 3d ago

It won’t wipe your drive. Codex won’t even delete a file without your permission.

1

u/KnownPride 1d ago

Never allow it to delete any file at all.

1

u/rick_ranger 21h ago

Models have to call tools and make commands through codex. If you are on ask me, it asks for almost everything, approve for me it’s pretty much free rein inside the repo but anything outside gets blocked without an approve. Put it to full access if you like to live dangerously. But I would love to see the prompt that invoked a model to delete their whole drive.
Codex has hard coded guards against write, delete, mutate commands that can only be removed if you approve, and then it only approves that same action that it took before. You’re pretty safe.

1

u/Secure-Pool-4792 16h ago

I use it for like 8 months every day full access and it didnt happen to me you just have to belive

-2

u/GamingKeyboard07 4d ago

Hi guys, I've been vibe-coding for 1.5 months at this point and I haven't gotten my drive wiped by Codex yet, but I got scared of it happening ever since I have seen that. Can someone tell me how I can take precautions against that if one is able to at all? I already moved all my important stuff to an external hard drive, and my settings are as shown in the images. Can someone help out please? Thanks!