Skip to content
These docs are for the next devvm, which isn’t released yet. The docs for the current release are at devvm.dev.
Staying safe

Staying safe

devvm runs installs, project code and coding agents in a VM, so code you didn’t write can’t, on its own, read your credentials, run git hooks on this machine or reach your other projects, and Attack vectors lists the exceptions. On the allowlist tier, which new VMs get by default, that code can send data only to the hosts on the VM’s allowlist, which are devvm’s built-in hosts, such as package registries, GitHub and your agents’ providers, your secrets’ hosts and the hosts you add. A few habits close most of what devvm can’t close on its own, so read this page before you trust a VM with a project.

Some of what devvm protects are your secrets. A secret is a credential devvm keeps on this machine for VMs to use: your GitHub token, Claude Code’s token, an agent’s login or an API key.

The habits

  • Use --clone for a repo or an agent you don’t trust. The VM then works on a clone of its own instead of your folder, so nothing it writes reaches your folder or its .git until you fetch the VM’s work and review it. It’s the safest way to run a repo you don’t know or an agent with its checks off.
  • Run installs, project code and agents in the VM. Whatever the VM writes into the project folder runs as you when a program on this machine runs it, so npm install, make, tests and agents belong in the VM (files the VM writes).
  • Keep VMs on the allowlist or none tier, and keep allowlists short. New VMs get allowlist by default. On the allowlist tier stolen data can go only to the hosts you allowed, on the internet tier to any public host, and on the open tier code in the VM reaches everything this machine can.
  • Review the VM’s changes before you run them on this machine or merge them. Treat its commits as an untrusted contributor’s.
  • Use a fine-grained GitHub token, and bind only the secrets a VM needs. A VM can do whatever its secrets allow, even when it never sees them (secrets and keys the VM may use).
  • Keep credentials out of the project folder and the settings folders of devvm’s agent store. The VM sees every file in them, including a .env file, whatever the VM’s tier (mounts).
  • Leave SSH agent forwarding off, or use devvm’s own agent with only the keys the VM needs.

What a VM can reach

The diagram sorts what’s on this machine by what a VM can do with it, and the table below gives the details.

What a VM can do with what's on this machineThe VM reaches the project folder, read-write, or its own clone with --clone, and what its network tier allows, through the proxy. It gets the shared tools and devvm's agent store's folders read-only, and copies of its settings files, minus your secrets. Out of its reach are the rest of your home folder, the .git hooks and config, which are locked, your SSH agent, unless you turn it on, and your secrets, which stay on this machine.Out of reachRead-only or copiedThe VM reachesthe projectfolder,read-write,or its ownclone with--clonewhat itsnetwork tierallows,through theproxythe sharedtools,read-onlydevvm'sagent store'sfolders,read-onlycopies ofits settingsfiles, minusyour secretsthe rest ofyour homefolder.git hooksand config,lockedyour SSHagent,unless youturn it onyour secretsstay on thismachine
The project folderThe VM reads and writes it. With --clone the folder isn’t mounted, and the VM has a clone of its own (details).
.git hooks and configdevvm locks them on macOS, and on Linux it makes them read-only in the VM where the kernel lets it, and watches them where it doesn’t. It reports what a lock can’t stop without preventing it (details). With --clone they’re out of reach.
Your agents’ settings and logins (skills, settings, logins)The VM mounts the folders of devvm’s agent store read-only and gets copies of its files, but never your agents’ history, and never the agents’ own files in your home folder (details).
The rest of your home folder, other projectsThe VM doesn’t mount them.
Your SSH keysOnly with devvm ssh-agent on, and only while you’re connected. With devvm ssh-agent devvm, the VM can use only the keys you added to devvm’s own agent (details).
The networkOn every tier but open, the VM reaches only its proxy on this machine, which lets it reach what its tier allows. On the open tier it reaches everything this machine reaches, including this machine’s own services on localhost (details).
Your secretsYour GitHub token, Claude Code’s token, the coding agents’ logins and API keys and the MCP secrets Claude Code gets from this machine stay on this machine on every network tier, and the proxy puts them into requests, so code in the VM can still use each secret the VM may use (details). opencode’s and pi’s keys that the proxy can’t put in, such as a local model server’s, stay on this machine too, unless you pass one to VMs in config.toml (opencode logins, pi logins).

Note

Everything here rests on the VM’s boundary: the VM runs its own kernel, apart from this machine’s.

More on staying safe

Last updated on