by postalcoder · 11mo ago · 0 comments
What I've done is write a PreToolUse hook to block all `rm -rf` commands. I've also seen others use shell functions to intercept `rm` commands and have it either return a warning or remap it to `trash`, which allows you to recover the files.
One obviously safe way to do this is in a VM/container.
Even then it can do network mischief
I could certainly see it happening in a VM or container with an overlooked mount.