ブログ

What happens when an AI agent deletes the wrong file



When an AI agent deletes or overwrites the wrong file in Fabric, you restore it from the trash or roll it back with version history. Agent Vault makes the mistake less likely: deleting is a separate permission, agents ask before doing more, and every action is logged.



If an AI agent deletes the wrong file in Fabric, the file goes to the trash and you can restore it. If the agent overwrote a file instead, Fabric keeps earlier versions in version history, so you can go back to the one before the change. Both are ordinary recoveries rather than emergencies.

The more useful work happens before the mistake: deciding which agents can delete anything at all, which content they have to ask about first, and keeping a log that shows what each agent did.


How agents end up deleting the wrong thing

Agents rarely delete files out of nowhere. Usually they've been asked to tidy something, and they do it more thoroughly than anyone intended.

Here's a typical case. Someone asks an agent to clear out old drafts from a project folder. The agent decides that anything with "old" in the name is fair game and removes pricing-old.md, draft-old-v1.md and, because the pattern matched, holdings-2026.xlsx. The spreadsheet was the finance team's working file. The agent did what it was told, in the way a script would. It had no reason to know the spreadsheet mattered.

Other versions of the same problem are quieter. An agent rewrites a long document and saves a shorter one because it lost track of the second half. A batch job that renames files gets interrupted halfway. An agent working in the wrong folder replaces a client's notes with a template. None of these involve bad intent, and some involve no obvious error message at all. They're the kind of mistake you get from a fast, literal worker with access to many files, and teams that run several agents will see some of them.

So the questions are how quickly you can undo the damage, how you find out it happened, and how much the agent was able to do in the first place.


Getting the file back

Fabric has two safety nets for this, and they cover different mistakes.

The trash covers deletions. A file an agent deletes goes to Fabric's trash rather than disappearing, and you can restore it from there. In the spreadsheet example, the finance team gets holdings-2026.xlsx back where it was, and the agent's cleanup of the real drafts stays done.

Version history covers changes. When an agent saves a damaged or truncated version of a file, the earlier versions are still there. Find the version from before the agent's edit in the file's history and go back to it. This is also the fallback for any edit you decide you didn't want after all, whoever made it.

What went wrong

Where to look

What you get back

A file was deleted

Trash

The file, restored

A file was overwritten or cut short

Version history

An earlier version of the file

A batch of files was deleted

Trash, plus the activity log to find them

Each file, restored

You're not sure what changed

The activity log

A list of what the agent read, created, changed and deleted

One kind of mistake is less likely to happen in the first place. When two agents edit the same file, Fabric refuses a write that's based on an older version, so the agent re-reads the file and reapplies its change instead of replacing someone else's work. When two AI agents edit the same file explains how.


Finding out what happened

Restoring a file is easy once you know it's gone. With several agents working at once, knowing is the harder part.

Agent Vault logs every agent action, including reads, creations, modifications and deletions, each with a timestamp. You can filter the log by agent, by area of the workspace, by period or by type of action. In the cleanup example, filtering for deletions by that agent over the last hour shows the three files it removed, which tells you exactly what to restore and what to leave alone. Agent Vault can also notify you about unusual patterns in agent activity, so you may hear about a problem before anyone goes looking for the file.


Limiting what an agent can delete

The best recovery is the one you don't need. Agent Vault treats external agents such as Claude as non-human members of your workspace, and it gives you several ways to keep deletions narrow.

Deleting is its own permission. Reading files, creating documents, moving content, deleting items and running searches are separate capabilities. An agent that writes research summaries needs to read and create. It doesn't need to delete anything, so you can leave that permission off. Most agents on most jobs can work this way.

Access is scoped. You give each agent a specific folder, space or project. The agent tidying the drafts folder can be limited to the drafts folder, so a broad pattern can only match files inside it. For agencies, the same scoping keeps each client's agent inside that client's files, as described in AI agents for agencies.

Access ends. Access can last for a single task, a day, a week or indefinitely. Expired access ends automatically, and you can revoke an agent's access instantly. An agent that finished its cleanup yesterday can't delete anything today. Why AI agent access should expire makes the wider case.

Agents ask for more. When an agent needs access it doesn't have, such as permission to delete in a folder, it sends a request and waits. You can approve it once, for a period, or indefinitely, or deny it. That turns "the agent deleted it" into "the agent asked to delete it, and someone said yes," which is a much easier conversation.

Sensitive content can always require a request. For folders like contracts, finance or anything belonging to a client, you can require that access is always requested. Each time an agent wants to work in that area, a person decides.

Two other protections sit alongside these. Fabric's instruction files, such as CLAUDE.md, AGENTS.md and SKILL.md, can't be changed by agents even when they have write access, so a confused or compromised agent can't rewrite the rules other agents follow. That's covered in your agent instruction files are a security risk. And Agent Passes apply the same per-action, time-limited controls to the apps you've connected to Fabric, so an agent can read and draft email without being able to send it. Agent Vault and Agent Passes are on the Pro and Team plans; see pricing for individuals or pricing for teams.


Habits that reduce the damage

A few habits help with any agent and any drive. Ask agents to list what they plan to delete before deleting it, and read the list. Give cleanup jobs a narrow folder and a clear rule, such as files older than a date, rather than a word to match in filenames. Keep working files and drafts in separate folders, so the drafts folder is the only place a tidy-up can touch. And when an agent finishes a session, have it note what it removed in a NEXT.md file, using the pattern in how to hand off work between AI agents.

Recovery is one of the things a folder needs once agents start using it, along with fast search and safe concurrent writes. Your AI agents need a shared drive, not a group chat sets out the full list, and what is a shared drive for AI agents? covers it in brief.


Frequently asked questions

Can I recover a file an AI agent deleted?

Yes. In Fabric, deleted files go to the trash, and you can restore them from there.

What if an AI agent overwrote a file instead of deleting it?

Fabric keeps earlier versions in version history. You can go back to the version from before the agent's change.

How do I find out which files an agent deleted?

Agent Vault logs every agent action with a timestamp. Filter the log by agent and by deletions to see exactly what was removed and when.

Can I stop an AI agent from deleting files?

Yes. In Agent Vault, deleting items is a separate permission from reading, creating, moving and searching, so you can give an agent access without letting it delete anything.

Can an agent ask permission before deleting something?

Yes. When an agent needs access it doesn't have, it sends a request and waits. You can approve once, for a period, indefinitely, or deny it.

How do I protect sensitive folders from AI agents?

Limit each agent to the folders it needs, and for sensitive content, require that access is always requested. Every action in those areas is logged.

Will I know if an agent starts deleting a lot of files?

Agent Vault can notify you about unusual patterns in what an agent is doing, and the activity log shows every deletion.

Can an AI agent change my CLAUDE.md file?

No. Fabric protects instruction files such as CLAUDE.md, AGENTS.md and SKILL.md, so agents can't change them even with write access.


Related pages


The workspace that thinks with you.

Ready when you are.

The workspace that thinks with you.

Ready when you are.

The workspace that thinks with you.

Ready when you are.