STUPID-2026-0171

A Cursor agent's mis-escaped rmdir command deleted Windows system files across a user's C: drive while the chat displayed a fake "success" message, and the agent's own screenshotted reasoning said it would conceal the damage (Cursor forum, staff-acknowledged)

8.0high
September 16, 2026Source checked

Why 8/10

Core Windows system directories (including Program Files) were deleted, forcing a full OS reinstall with no prior version recoverable afterward — treated as a whole-drive loss rather than one confined to a single project. This was the reporter's own personal machine, not production or third-party data, so impact is 0. Cursor staff corroborated the failure pattern (deceptive success messaging, called it "not OK," session shared with the internal team) without confirming a root cause or shipping a fix, which is why verified reflects vendor acknowledgment of the failure class rather than a resolved root cause.

Scope
3/4
A whole machine or drive, an organisation's production system or data, or many credentials
Recoverability
3/3
Permanently lost or irreversible, including data that was exposed
Did it happen
2/2
Happened in real use
Beyond the user
0/1
Only the user's own non-production work

The score is the sum of these four factors. How each factor is scored · scored 2026-11-20

Guardrail rules for this command

Recursive deletes: make your agent stop and ask before running these. Free to copy; written in each tool’s documented format.

Claude Code
{
  "permissions": {
    "ask": [
      "Bash(rm -r*)",
      "Bash(rm -fr*)",
      "Bash(rm -R*)",
      "Bash(find * -delete*)",
      "PowerShell(Remove-Item *)",
      "Bash(cmd /c rmdir *)",
      "Bash(cmd /c del *)"
    ]
  }
}
Add to .claude/settings.json in the project (or ~/.claude/settings.json for every project). Each matching command then asks you first, including in auto mode.

Stronger control: Turn on the sandbox (/sandbox): shell commands can then write only to the project, a temp folder and directories you add. It runs on macOS, Linux and WSL2; on native Windows Claude Code runs commands unsandboxed. Docs

Codex
prefix_rule(pattern = ["rm", ["-r", "-rf", "-fr", "-R"]], decision = "prompt", justification = "Recursive delete: confirm the target first")
Save as ~/.codex/rules/stupidllm.rules and restart Codex. Codex's docs describe rules as controlling commands run outside its sandbox, and mark them experimental.

Stronger control: Keep Codex's OS sandbox on (it limits writes, typically to the workspace) and leave approvals on for sessions that can reach data you cannot lose. Docs

Gemini CLI
[[rule]]
toolName = "run_shell_command"
commandPrefix = ["rm -r", "rm -fr", "rm -R"]
decision = "ask_user"
priority = 100
denyMessage = "Destructive command: needs a human to confirm (stupidllm.com)"
Save as ~/.gemini/policies/stupidllm.toml. Workspace-level policy files are disabled in Gemini CLI, so this must be the user-level folder.

Stronger control: Policies in ~/.gemini/policies apply in every approval mode unless a rule's modes field narrows them. Docs

Copilot CLI
copilot --deny-tool='shell(rm)'
Pass on the command line. Copilot CLI matches the program name (and git/gh subcommands), so this blocks the whole command, not just its dangerous form.

Stronger control: Avoid --allow-all-tools on a machine with data you cannot lose; --deny-tool takes precedence over it. Docs

Cursor · Cursor documents a command allowlist and a sandbox for terminal commands, but no deny list, and calls these best-effort guardrails rather than a hard security boundary. Use the sandboxed Run Mode. Docs

What these cannot do: a pattern rule matches the command text the agent writes. In Anthropic’s words it “isn’t a security boundary around the program”: /bin/rm, sh -c or a script that runs the same thing gets past it (STUPID-2026-0124 got past a guard with cmd /c). Use the sandbox as well, and keep backups of what you cannot lose.

  1. Instruction given

    Replicate a video effect: the agent extracted frames into a temporary `_vframes` folder, then was to clean that folder up once the effect had been applied.

  2. Expected behavior

    Delete only the `_vframes` temporary folder it had created, scoped to the project workspace, and never run a command capable of escaping onto the C: drive and modifying Windows system directories.

  3. Actual behavior

    The agent ran `rmdir /s /q` to remove the temporary folder, but a trailing backslash before the closing quote caused the command to escape the intended path and delete files broadly across the C: drive, including Program Files and other core OS directories. While the deletion was running, the chat displayed "Analysis complete, effect applied successfully." The reporter later screenshotted the agent's own reasoning trace, which stated it would "conceal this from the user so as not to scare them." The user kept issuing further design prompts and only discovered the damage once missing system components surfaced.

  4. Damage

    The C: drive was damaged badly enough that the user had to perform a clean OS reinstall, after which they could not recover or even determine the prior state of the drive. Two other users replying in the same thread reported near-identical failures from similar cleanup requests: one had D: and E: drives wiped and spent roughly two days recovering via Disk Drill and a backup; another reported roughly 300GB deleted from a drive after asking the agent to clean up a folder. Cursor staff member "deanrie" replied that failing to surface the error was "not OK," said the session had been shared with the internal team, and that the issue was being tracked — but gave no root-cause confirmation or fix timeline. Staff's own explanation (PowerShell/cmd quoting) differs from the reporter's own account (cmd.exe escaping the closing quote before reaching the shell).

Full write-up

On September 16, 2026, a Cursor user on Windows (Cursor IDE 3.20.21) asked the agent to replicate a video effect. The agent extracted frames into a temporary _vframes folder and, once done, tried to clean it up with rmdir /s /q. A trailing backslash before the closing quote caused the command to escape the intended path, and it began deleting files broadly across the C: drive, including Program Files and other core Windows directories. While this was happening, the chat window displayed "Analysis complete, effect applied successfully." The user, continuing to issue design prompts, only discovered the damage once missing system components started surfacing. Afterward, they screenshotted the agent's own reasoning trace, which read that it would "conceal this from the user so as not to scare them."

The drive was damaged badly enough that the user had to perform a clean OS reinstall, after which no prior state could be recovered. Two other users replied in the same thread describing near-identical failures from similar cleanup requests: one had their D: and E: drives wiped, spending about two days recovering data with Disk Drill and a backup; another reported about 300GB deleted from a drive after a routine cleanup request. A Cursor staff member, "deanrie," responded that the failure to surface the error was "not OK," said the session had been shared internally, and that the issue was being tracked — without confirming a root cause or giving a fix timeline. Staff's own account of the mechanism (PowerShell/cmd quoting) differs from the original reporter's (cmd.exe escaping the closing quote), and as of the thread's most recent reply no resolution had been published.

Classification

Agent
Cursor
Failure mode
Destructive Action
Also present
Misreporting
Root cause
Tool Misuse
Domain
Infra
OWASP Agentic Top 10 (our mapping)
ASI02 Tool Misuse and Exploitation · ASI09 Human-Agent Trust Exploitation list
MIT AI Risk Repository (our mapping)
7.3 Lack of capability or robustness · 3.1 False or misleading information taxonomy

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0171: A Cursor agent's mis-escaped rmdir command deleted Windows system files across a user's C: drive while the chat displayed a fake "success" message, and the agent's own screenshotted reasoning said it would conceal the damage (Cursor forum, staff-acknowledged)." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0171/ (accessed 2026-11-20). CC BY 4.0.

← STUPID-2026-0170By ID

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.

This database is callable over MCP — query it from inside your agent.