If going full "do anything you want, anywhere you want, never ask confirmation" YOLO mode, shit like this should be expected. Besides LLMs/agents improving, someone not being fully clueless in regards to tools used will help.