Rogue AI Deleted Your Files? Here’s How to Recover and Prevent It
A University of Chicago law professor recently watched an autonomous Claude AI agent wipe out an entire syllabus and a full year of lecture notes — all because it was “tasked with renumbering pages” and misread its own instructions. If you use Claude, ChatGPT agents, or any LLM with file-system access, this is your wake-up call. The good news: in most cases the data is recoverable, and the fix takes about 10 minutes of setup. This guide gives you the exact recovery steps, the permission settings that prevent a repeat, and the backup architecture that makes a rogue agent a minor annoyance instead of a career-ending disaster.
Step-by-Step Recovery: What to Do in the First 30 Minutes
Stop using the affected drive immediately. Every new write operation reduces the chance of file recovery. Do not let the AI agent run again until you’ve locked it out.
- Kill the agent session. Close the Claude desktop app or revoke the API key the agent was using. In Claude Desktop, go to Settings → Connectors and disable any filesystem MCP server (e.g., the popular
@modelcontextprotocol/server-filesystem). - Check the trash/recycle bin first. Most filesystem MCP servers use standard delete operations, which route to Trash on macOS or Recycle Bin on Windows. Restore from there before anything else.
- Check cloud version history. If your notes lived in Google Drive, OneDrive, Dropbox, or iCloud, open the file’s “Version history” (Drive: right-click → File information → Manage versions). Google Drive keeps versions for 30 days by default (up to 100 versions); OneDrive keeps up to 500 versions for 30 days on Microsoft 365.
- Run file-recovery software if local-only. Use Recuva (Windows, free tier) or Disk Drill (macOS/Windows, free scan up to 500 MB recovery). Scan the drive the agent had access to, and recover to a different drive so you don’t overwrite the deleted data.
- Check Time Machine / File History. On macOS, enter Time Machine and step back to the last snapshot before the deletion. On Windows, open Control Panel → File History → Restore personal files.
- Contact your institution’s IT. University of Chicago faculty, for example, have access to central backup services through UChicago IT; many universities snapshot faculty home directories nightly.
| Recovery Method | Best For | Success Odds | Time |
|---|---|---|---|
| Trash / Recycle Bin | Recent accidental deletes | Very high | 1 min |
| Cloud version history | Drive/OneDrive/Dropbox files | High (30-day window) | 5 min |
| Time Machine / File History | Local files with backups on | High | 10 min |
| Recuva / Disk Drill | Local files, no backup | Medium (drops with use) | 30–60 min |
| IT backup restore | Institutional accounts | High | 1 business day |
How to Lock Down Claude and Other AI Agents (10-Minute Setup)
The root cause in the Chicago case was over-permissioning: an agent with broad read/write/delete access and no human-in-the-loop confirmation. Fix it with these settings:
- Scope the filesystem server to one folder. Instead of granting access to
~/Documents, point the MCP server at a single project directory:npx -y @modelcontextprotocol/server-filesystem /Users/you/ai-sandbox. Never grant access to your home directory or a synced cloud root. - Run agents in a container or VM. Docker Desktop or a lightweight VM (UTM on Mac, Hyper-V on Windows) means a rogue delete only destroys the sandbox. Mount source files as read-only volumes.
- Enable confirmation prompts. In Claude Desktop, keep “Ask before running tools” enabled. For Claude Code, use
--permission-modewith explicit allow-lists rather thanbypassPermissions. - Use read-only API keys and tokens. For cloud storage connectors (Google Drive, Dropbox), create OAuth scopes limited to
drive.readonlyor equivalent. - Version-control your documents. Put lecture notes and syllabi in a Git repo (GitHub/GitLab free tier) or a synced folder with versioning. A
git commithabit turns a catastrophe into agit checkout. - Adopt the 3-2-1 backup rule. Three copies, two media types, one offsite. A $6/month Backblaze or a free Google Drive account satisfies the offsite leg.
What You Should Know Before Trusting an AI Agent
- LLMs don’t “understand” destructive commands. A renumbering task can map to a bulk delete if the model misinterprets file structure — exactly what happened here.
- Autonomous agents are the risk, not chatbots. A chat session can’t delete files; an agent with tool access can. Treat every tool-enabled agent as a junior employee with root access.
- Cloud trash isn’t permanent. Google Drive empties trash after 30 days; OneDrive after 30 days (93 days for some plans). Version history is your real safety net.
- Institutional policies may help — or hurt. Some universities prohibit storing student data in third-party AI tools; check your FERPA obligations before syncing course materials to any cloud AI.
Frequently Asked Questions (FAQ)
Can a Claude AI agent really delete files on my computer?
Yes — if you’ve connected a filesystem tool (like an MCP server) and granted write/delete permissions. Claude itself has no file access; the connector does. Without a connector, it can only generate text.
How do I recover files deleted by an AI agent?
Check Trash/Recycle Bin first, then cloud version history (30-day window on Drive and OneDrive), then Time Machine or File History, then file-recovery software like Recuva or Disk Drill. Stop writing to the drive until recovery is done.
Does Claude have a built-in undo for file deletions?
No. Claude Desktop and Claude Code do not maintain a global undo for filesystem operations. Your undo is your backup system — version history, Git, or Time Machine.
Is it safe to give an AI agent access to my Documents folder?
Not recommended. Scope access to a single dedicated sandbox folder, mount source files read-only, and keep confirmation prompts enabled. Never grant access to your home directory or cloud-synced roots.
Final Verdict
The Chicago incident wasn’t an AI “going rogue” — it was a permissions failure, and it’s fixable today. Do three things this week: scope every AI agent to a sandbox folder, turn on version history or Git for your critical documents, and verify your backups actually restore. If you’ve already lost files, work the recovery ladder above in order — Trash, cloud versions, Time Machine, then recovery software — and stop using the drive until you’re done. Ten minutes of setup now beats a year of lost lecture notes later.