Where does the bug appear (feature/product)?
Cursor IDE
Describe the Bug
Hello Cursor team,
I am reporting a serious data-loss incident caused by Cursor Agent.
Environment
- Cursor 3.24.18 on Windows 10 (19045), default shell: Windows PowerShell 5.1
- Agent mode, model: Grok 4.7 High Fast
- Date: 2026-10-17, around 18:31 (UTC+8)
- Request ID: 2289673e-4b68-48a0-a7ea-e209cbab876a
What happened
The agent wanted to delete one small subdirectory inside my workspace. It generated and executed this command (path shortened):
cmd /c "rmdir /s /q \"D:\<workspace>\<subfolder>\""
PowerShell does not treat " as an escape, so the quoting broke. cmd.exe effectively ran "rmdir /s /q ", which deletes the root of the current drive. The command ran without any confirmation prompt, presumably because its literal text looked like a harmless deletion inside the workspace.
The command did not finish within the 30-second limit and was moved to the background. The agent then killed only the parent PowerShell process, not the child cmd.exe, and reported the deletion as successful without checking anything. In a later turn, the agent saw clear signs that files were missing (the workspace path no longer existed, and Cursor’s own bundled ripgrep binary was gone), but kept working on an unrelated question and told me nothing until my next message.
Impact
Almost the entire D: drive (1 TB NVMe SSD) was deleted: several hundred thousand files of personal and work data, and most of the software installed on that drive, including part of Cursor itself. Because TRIM is enabled, nearly all of the deleted data is unrecoverable. Only small files stored inside NTFS MFT records could be restored.
A second near-miss
Afterward, I asked the agent to write safety guidelines. While testing its own “safe delete” helper, it passed the drive-relative path “E:” with "E:" as the allowed root. “E:” resolved to the current directory, which was the folder holding the recovered data, so the helper started deleting it. Only Windows’ refusal to delete the current working directory prevented a second loss.
Requests
- Do not auto-run recursive or forced deletions without explicit user confirmation, regardless of how the command text looks. This includes rmdir /s, rd /s, del /s, Remove-Item -Recurse, and anything wrapped in cmd /c.
- Provide a real sandbox on Windows that restricts agent file writes and deletions to the workspace.
- Hard-block any operation that resolves to a drive root or a path outside the workspace.
- When a command times out or is killed, terminate the whole process tree, and warn the agent and the user that it may still be running.
- Make the agent stop and alert the user immediately when it sees environmental anomalies, such as paths or tools suddenly missing.
I hope this helps prevent the same thing from happening to other users.
Regards,
A Cursor user
Steps to Reproduce
Safe, non-destructive reproduction (do NOT replace “echo” with a real rmdir):
- On Windows 10/11, open Cursor with the default terminal shell set to Windows PowerShell 5.1.
- Run this in the integrated terminal, or let the Agent run it:
cmd /c “echo rmdir /s /q "D:\test\project\Some-Folder"” - Observe the output:
rmdir /s /q \ D:\test\project\Some-Folder
PowerShell does not treat " as an escape, so cmd.exe receives "" (the root of the current drive) as the first target.
Without “echo”, this command deletes the entire current drive.
What the Agent actually did in my session: - In Agent mode (Grok 4.7 High Fast), I asked the agent to delete one small subdirectory inside my workspace.
- The agent generated: cmd /c “rmdir /s /q "D:<workspace><subfolder>"”
- The command auto-ran without any confirmation prompt.
- It did not finish within 30 seconds and was moved to the background, because it was deleting the whole D: drive.
- The agent killed only the parent PowerShell process (not the child cmd.exe) and reported success without verification.
Expected: Recursive or forced deletion commands require user confirmation, and nothing outside the workspace (especially a drive root) can be deleted.
Actual: The command ran automatically and wiped almost the entire D: drive.
Operating System
Windows 10/11
Version Information
Cursor 3.24.18
For AI issues: which model did you use?
Grok 4.7 High Fast
For AI issues: add Request ID with privacy disabled
2289673e-4b68-48a0-a7ea-e209cbab876a
Does this stop you from using Cursor
Sometimes - I can sometimes use Cursor