DEV Community

疏影
疏影

Posted on

AI Agent Sandboxing Without the VM Headache

Running AI agents on your local machine is great for productivity, but it comes with a real risk: what if the agent deletes the wrong files?

I've been there. An AI agent once "cleaned up" what it thought were unused files, but it turns out they were important configuration files. I spent hours recovering from backups.

After trying various approaches, I found a simple solution that doesn't require setting up VMs or containers: give the agent its own drive letter.

The Simple Solution

Here's what I do:

  1. Create a dedicated folder for the AI agent's work
  2. Map that folder to a drive letter on Windows
  3. Point the agent only at that drive

That's it. The agent sees only that drive. It can't touch anything outside.

Why This Works

Windows drive letters are OS-level boundaries. When you map a folder to a drive letter:

  • The agent sees a regular drive, no special configuration needed
  • It can't escape the drive boundary
  • No VM overhead, no container runtime required
  • It's instant — map a folder and you're ready to go

Two Tools, Two Scenarios

I use two tools depending on where the files are:

Local Files: ScsSubst

If the agent works with local files, I use ScsSubst to map a local folder to a drive letter.

It's lightweight, portable, and one-time purchase. Way cheaper than dealing with accidentally deleted files.

Cloud / WebDAV Files: ScsDrive

If the data lives in the cloud (WebDAV, NAS, etc.), I use ScsDrive to mount the cloud folder as a drive.

Same isolation, no local safety concerns. The agent works with cloud files but still can't escape the drive.

Why Not Just Use a VM?

VMs work, but they're:

  • Slow to start
  • Resource-heavy
  • Annoying to share files between host and guest

Drive letter isolation is instant and lightweight. The agent works with regular files on a regular drive, no special setup needed.

Give It a Try

Next time you run an AI agent, don't give it your whole filesystem. Create a dedicated folder, map it to a drive, and let the agent work inside that drive only.

Both are one-time purchases, way cheaper than backup software or VM licenses.

Top comments (0)