Skip to content
Download

Search the user guide, questions, pages, the blog and release notes.

Keeping an AI agent away from your files

By Admiral CapyUpdated Written for version 1.1.8

One wrong path in a cleanup command is enough. AI coding agents have deleted whole home folders and drives this way, when a path in a delete command came out as the drive’s root, or a cleanup script followed a link out of the project. The agent’s undo covers only the edits it made with its own tools, not what a shell command deleted.

CapyWatcher gives you two guards. A lock refuses every delete, move and rename in a folder, whichever program asks. A delete alert tells you, within a couple of seconds, which program is deleting files in a folder, so you can stop it.

Set up your folders first

  1. Open CapyWatcher and select Tracked folders in the left column. Check the folders that must stay, such as Documents and Pictures, and the folder where the agent works, as Choosing folders to track shows.
  2. On each folder that must stay, select the lock at the right end of its row, then Lock. Locking a folder explains what a lock refuses and what still works.
  3. On the folder where the agent works, select the bell at the right end of its row, then Turn on. Delete alerts explains the bell.
  4. Keep CapyWatcher running while the agent works. Closing its window leaves it in the tray, the row of small icons next to the clock, while Close to tray is on in Options, as it is at first.
  5. When a notification such as “Files deleted in the my-app folder” shows and you didn’t expect it, select Lock folder in it. No program can delete what’s left in the folder until you unlock it.
  6. Then find out what happened before you let the agent go on: the notification names the program, and Delete notifications explains its buttons.

Why not lock the project folder

The agent and its build tools delete and rename files in the project all the time, and many programs save a file by writing a new copy and renaming it over the old one. A lock would refuse all of that and break the agent’s work. Lock the folders the agent never needs to change, and put an alert on the one it does.

New files can still be saved in a locked folder, so an agent can still write there. It can’t delete, move or rename anything.

See what the agent made

The same tracking records every new file the agent and its programs create. Seeing what your AI agent wrote shows how to list them in History.

Important

A lock doesn’t stop changes inside a file: a program can still empty or overwrite a file in a locked folder, and History doesn’t record such changes. Keep a backup, or turn on Windows’ File History in Control Panel. A program running as administrator, with the rights to change Windows for every account, can remove a lock. The app puts it back within 2 seconds, and in that moment the program can still delete files. An alert shows only while CapyWatcher runs and monitoring is on, and files deleted before you lock the folder don’t come back.

On this page
Keeping an AI agent away from your files

Still stuck? Write to me at support@capywatcher.com or send a DM to @CapyWatcherApp (opens in a new tab) on X. The support page says what to put in your message.