On a Friday afternoon, the team’s shared cloud drive throws a storage warning. A folder holds a row of file names: “quote final,” “quote final-2,” “quote final-new.” You want to hand “find duplicate files and clean them up” to an AI assistant. To a person, the request is obvious. To an AI agent that can operate on files, an AI assistant that carries out several steps in a row on its own, it’s missing the most important information: which folder is in scope, what evidence counts as a duplicate, whether cleanup means moving files elsewhere or deleting them permanently, and who can bring them back if something goes wrong.

So before handing it over, change the question. A cleanup isn’t judged by how fast it deletes but by whether mistakes can be recovered. AI finds candidate files and evidence; after a person approves, the files first go to a quarantine area, and a sample restore proves they can come back. Permanent deletion is a separate decision.

A “delete” called by code doesn’t always go to the trash

Press delete on screen and a file usually goes to the trash, so many people assume a wrong deletion can be undone. But a “delete” called by a program isn’t necessarily the same.

Google Drive’s developer documentation is clear: files moved to the trash can be restored within 30 days and are then deleted automatically, but when a program calls the delete function, the file is removed immediately and skips the trash, so it can’t be recovered from there. If the target is a folder, the items inside it owned by the user are deleted too. By contrast, a standard delete through Microsoft’s cloud drive API moves items to the recycle bin rather than deleting them permanently.

Both are called “delete,” with completely different consequences. Which one an AI agent uses is usually invisible to the user in the conversation.

Duplicates can’t be judged by file name

Two quotes with the same name may belong to different clients; an older presentation may still be the version an external link points to. So every candidate needs verifiable evidence: file ID, full path, owner, size, modified time, sharing status, and, where the system provides one, a content hash. A hash is a fingerprint calculated from the file’s contents, identical only when the contents are identical.

A content hash is strong evidence, but owner, path, and sharing status still need to be checked alongside it. Cloud-native documents, shortcuts, and different export formats don’t always have hashes that can be compared directly. In that case the correct answer is “insufficient evidence,” not falling back to guessing by name.

Advertisement

Five steps, each with different permissions

If inventory, judgment, moving, and deletion are bundled into one AI run, people usually only get to read the report afterward. A steadier approach separates them:

  1. Read-only inventory: AI reads only one specified folder, with a cap on the number of files, excluding finance, HR, legal, and personal folders.
  2. List candidates and evidence: AI produces a list and moves nothing. For folders, shortcuts, external shares, unknown owners, or version conflicts, it marks the item “to confirm” and stops reasoning about it.
  3. A person approves a small batch: the data owner marks each item as quarantine, keep, or to confirm. The first round can be just 20 files.
  4. Move to quarantine and test a restore: only explicitly approved items are moved into a quarantine folder by a tool whose permissions are limited to that path. The quarantine records the original path, file ID, time moved, who ran it, who approved it, and a scheduled review date. After moving, restore one file from quarantine to its original path and confirm the contents, link permissions, and downstream processes still work. If the restore fails, stop the whole batch.
  5. Decide separately on permanent deletion: after the quarantine period, the data owner re-approves against the list; high-risk data also follows the company’s retention policy. Permanent deletion shouldn’t be the last step this process runs automatically.

Quarantine is not a backup

A quarantine area isn’t a backup. If files are moved to another folder in the same cloud drive, both copies disappear together if the platform has a problem or the account is deleted by mistake. Important files still need a backup somewhere else.

Also, trash and recycle bin retention periods are product settings that administrators may shorten, and sync software may propagate deletions to other devices. None of that replaces your own recovery plan.

Even under heavy storage pressure, don’t trade safety for speed with “delete first, sort it out later.” Start with small files whose contents are identical, that aren’t shared externally, and whose owners are clear. Leave large folders, external links, and client deliverables for a later batch. If a 20-file trial can’t be explained clearly, 200,000 files only magnify the same problem.

As a next step, pick a non-sensitive project folder and have AI do only steps one and two, stopping once the list is produced. If the identity the AI agent uses can inventory, move, and empty the trash all at once, split those permissions first; see Before AI Support Can Change Accounts, Identity Must Come From the System, Not the Chat. For cleaning up when an automated process fails halfway, see When Automation Stops Halfway, Find Out What Already Happened Before Rerunning.

AI handoff card

I want AI to help clean up a shared cloud drive, but first I need to be sure files can be recovered if something goes wrong.
The method comes from this article: https://boosterminiclass.com/en/posts/ai-shared-drive-cleanup-quarantine/
Its view: a cleanup is judged by whether mistakes can be recovered. AI only finds candidate files and evidence in one specified folder; after a person approves, files first go to a quarantine area and a sample restore proves they can come back; permanent deletion is a separate decision.

Inventory only the one folder I specify, read-only: don't move, rename, share, download, or delete any file, and don't empty the trash.
1. First list the folder ID, the number of items you can see, and the permissions you actually have;
2. Find at most 20 candidates that look duplicated or outdated, each with: file ID, full path, owner, size, modified time, sharing status, reason it's a candidate, and content hash where available. Similar file names alone don't count as duplicates;
3. For folders, shortcuts, external shares, unknown owners, version conflicts, hashes that can't be compared, or any missing field, mark the item "to confirm" and stop reasoning about it;
4. Finally, output: a candidate list for the data owner to approve item by item, a draft quarantine batch with original paths and a scheduled review date, and the steps for a sample restore after moving.
If the folder scope or permissions can't be confirmed, the overall verdict is "stay read-only." Any actual moving, deleting, emptying, or permission change must be approved separately by a named owner.
Advertisement

Share

Share this mini class

If this lesson helps untangle a work bottleneck, share it with someone deciding how to use AI.

References