This needs to be addressed:
"This is exactly what happened to me today. While cursor, using Gemini 2.5 pro, was trying to clean up some files it used rm -rf /that-folder ~/
I had keychain data, everything on my desktop and other items deleted before I was able to stop it.
Exactly the problem that you pointed out. Has anyone figured out a way to prevent this from happening?"
2 Likes
Sorry about your loss, have you tried to add rm into commands denylist? cursor settings>features>enable auto-run
It’s unfortunate that this happened to you. I would suggest including more explicit mentions in the Cursor that AI can make mistakes and may even delete all files on your computer. And recommend making backups, using dedicated machines, utilizing Git with a remote repository, Docker, and other methods to mitigate risks.
I had an incident where the AI deleted the entire project. It was under Git, but I hadn’t pushed the latest commits. After that, I moved everything to Docker, and I haven’t encountered a similar issue since.
Personally, I really dislike that the AI often uses the -f flag with rm. It would be better if it at least used -v so that I could see what is being deleted.
Additionally, adding rm to the list of commands requiring mandatory confirmation does not completely eliminate the risk, as the AI could still write rm -rf in a bash script and execute it.