DEV Community

疏影
疏影

Posted on AI-assisted

Why VMs Are Overkill for AI Agent Sandboxing (and What to Use Instead)

The standard advice for sandboxing AI agents is "use a VM" or "use Docker."

That's terrible advice for most people.

The VM tax

Spinning up a VM for every AI task:

  • Takes 30 seconds to boot
  • Uses 2-4 GB of RAM just sitting there
  • Requires you to set up networking, file sharing, tooling inside the VM
  • Is completely disconnected from your actual working environment

Docker is lighter, but you still need to:

  • Set up a container image
  • Mount volumes carefully (or the agent can't see your files)
  • Deal with filesystem permission nonsense
  • Learn Docker

Most people just... don't bother. And then they're running the agent on their main machine with access to everything.

The 10-second solution

On Windows, you can map any folder to a drive letter:

subst Z: C:i-workspaces    ask-1
Enter fullscreen mode Exit fullscreen mode

That's it. Point your AI tool at Z:\. The agent can do whatever it wants inside that drive. It can't see anything outside of it.

This is a real OS-level boundary. The filesystem enforces it, not the AI.

Why I use ScsSubst

The built-in subst command works, but mappings disappear when you reboot. ScsSubst (https://subst.scsoi.com/) makes them persistent, and gives you a GUI to manage all your mapped drives. $9.99 lifetime, one-time purchase.

No VM overhead. No Docker learning curve. Just a drive letter.

When you actually need a VM

If you're running untrusted code from the internet, sure, use a VM. But if you're running your own AI coding assistant on your own machine, and you just want to make sure it can't accidentally delete your home folder — a mapped drive letter is enough.

It's the difference between a bank vault and a locked filing cabinet. You don't need Fort Knox to keep your files safe from a confused AI.

Top comments (0)