Files
devvm/docs/content/docs/internals/security.md
T
CJandClaude Opus 5.5 81f3feeecf docs: each page's social card shows its title and what it covers (#21)
## What this changes

Every page on devvm.dev and next.devvm.dev gets its own Open Graph card,
which Hugo draws when it builds the site. Each card is the brand card
(the pixel logo with the lock, black, the lime bar, devvm.dev) with the
page's section in lime capitals, its title, and a short explainer of
what the page covers.

> [!NOTE]
> The six preview cards in `docs/og-preview/` were for review only.
`chore(docs): drop the preview social cards` removes them again, so the
squashed commit doesn't have them, and the images below still show from
the commit that added them.

- **The template**, `docs/assets/images/og-template.png`, is
`docs/static/images/social-card.png` with the headline and tagline rows
filled with the background's exact black. The repo has no SVG or
generator for the card: it was a headless Chrome screenshot of the logo
SVG and text. The old card has only four colors (`#000000`, `#7fff00`,
`#eeeeee`, `#8f93a2`) and no antialiasing, so filling those rows leaves
no marks. The logo, `devvm.dev` and the bar match the card pixel for
pixel, and the template has those four colors and nothing else.
- **The drawing**, `docs/layouts/_partials/og-image.html`, uses
`images.Text` with Departure Mono at multiples of 11px (22px for the
section label, 66, 55 or 44px for the title, whichever fits it in two
lines, and 33px for the explainer). Every line starts on a whole pixel,
so the generated cards also have exactly the template's four colors and
no antialiasing: they are as crisp as the logo. `og-wrap.html` wraps
lines by length, because the font is monospaced. The block is centered
between the logo and devvm.dev. The section is the page's section title,
*Docs* on a section's own page, and none on the home, branding and
taxonomy pages.
- **The font:** Departure Mono **v1.500**, the release the site's woff2
comes from (checked: the woff2 in the release zip is byte-identical to
`docs/static/fonts/departure-mono/DepartureMono-Regular.woff2`, sha256
`5b4fed1d…`, and so is the LICENSE). That release ships an OTF, not a
TTF. Hugo's `images.Text` reads it fine, so
`docs/assets/fonts/departure-mono/` has `DepartureMono-Regular.otf`
(sha256
`4d53f663155cf8bf7ffc8e688776e719625f7bbb80a8d90073438b249261a2e0`) and
its OFL. Source: `gh release download v1.500 -R
rektdeckard/departure-mono`, `DepartureMono-1.500.zip`, sha256
`bf3e48059aeef4617ec585bdea81dcc3491c576b3e7a472f52faf40e09ee5c3a`.
- **The tags:** `custom/head-end.html` writes `og:image`,
`og:image:type`, `og:image:width`/`height`, `og:image:alt` and
`twitter:image:alt`. The alt text is `devvm docs: TITLE: EXPLAINER`.
`_partials/_funcs/get-page-images.html` replaces Hugo's own, which
Hugo's `twitter_cards.html` and `schema.html` call, so `twitter:card` is
`summary_large_image` and `twitter:image` and `itemprop=image` are the
same card. `params.images` is removed from `hugo.yaml`, so Hextra's
`opengraph.html` writes no second `og:image`. In the built site, every
one of the 115 HTML pages (the 404 included) has exactly one `og:image`,
and each card is different.
- **The explainer** is a new front matter key, `explainer`, not
`description`. `description` is the page's meta description,
`og:description`, the search snippet and its `llms.txt` line. Those want
a sentence or two, and only two pages have one. A 4–9 word card line
would be a weak search snippet. Every hand-written page has one. The CLI
pages get their command's `Short` from `internal/cli/docgen` (`mise run
cli-docs` rerun), and the reference's index gets a fixed one. The home
page also sets `cardTitle: One VM for every project` (the hero's
headline), because its title, `devvm`, would repeat the logo.
- **The guard:** `TestExplainers` in
`internal/cli/docgen/explainer_test.go` fails when any page under
`docs/content` has no `explainer`. It also fails when the explainer
takes more than two card lines of 48 characters (33px), or when the
title (or `cardTitle`) takes more than two lines of 36 characters
(44px). Those are the card's real limits, and they also cover the
longest `Short`s. It runs in `mise run test` and in `mise run
lint:docs`, next to `TestDocLinks`. `TestFrontMatter` and
`TestWrappedLines` cover its parsing.
- **Docs:** Contributing › Writing docs describes the cards, the key and
the test. The branding page says each page has its own card.
`social-card.png` stays as the brand asset.

### Numbers

| | Before (main) | After |
| --- | --- | --- |
| Built site (`hugo -s docs --minify`, apparent size) | 40,194 KB |
42,138 KB (+1.9 MB) |
| Cards | 1 static card | 115 PNGs, 14.9–16.6 KB each, 1.84 MB total |
| Build time, image cache cold (`--ignoreCache`) | ~1.0 s | 1.4–1.95 s |
| Build time, image cache warm | ~1.0 s | ~1.0 s |

The cards are smaller than the prototype's estimate (about 16 KB, not
22–34 KB), because they have only four colors.

next.devvm.dev: `hugo -s docs --minify --config hugo.yaml,next.yaml`
gives `og:image`, `twitter:image` and `itemprop=image` as
`https://next.devvm.dev/images/og-template_hu_….png` on every page.

### Examples

| Home | Short title |
| --- | --- |
|
![home](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/home.png?raw=true)
|
![Installing](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/getting-started-install.png?raw=true)
|
| **Longest title (two lines)** | **CLI page, longest explainer** |
| ![What devvm keeps on this
machine](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/using-space.png?raw=true)
| ![devvm
limactl](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/cli-devvm-limactl.png?raw=true)
|
| **Section index** | **How it works page** |
| ![Using
devvm](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/using.png?raw=true)
| ![.git
protection](https://github.com/devvmhq/devvm/blob/f679f00e3536fa4ca224d12d3c33aff2b48b676a/docs/og-preview/internals-git-protection.png?raw=true)
|

### Every page's card

From a local `hugo -s docs --minify` build. "(none)" is a page whose
card has no section label or no explainer. The 404 page's card, titled
*404 Page not found*, isn't listed.

| Section | Page | Title | Explainer | Card |
| --- | --- | --- | --- | --- |
| (none) | `/branding/` | Branding | devvm's logo, icons, colors and
fonts | 15.6 KB |
| (none) | `/categories/` | Categories | (none) | 15.0 KB |
| Docs | `/docs/backends/` | Backends | The program that runs devvm's
VMs | 15.7 KB |
| Backends | `/docs/backends/lima/` | Lima | What Lima needs, and how
devvm uses it | 15.7 KB |
| CLI reference | `/docs/cli/devvm_adopt/` | devvm adopt | Give this
folder the VM made for an earlier folder or path | 16.3 KB |
| CLI reference | `/docs/cli/devvm_agent_import/` | devvm agent import |
Copy the agents' settings and logins from this machine into devvm's
store | 16.6 KB |
| CLI reference | `/docs/cli/devvm_agent_login/` | devvm agent login |
Log an agent in, in this folder's VM, and save the login in devvm's
store | 16.6 KB |
| CLI reference | `/docs/cli/devvm_agent_save/` | devvm agent save |
Copy the agents' settings from this folder's VM into devvm's store |
16.5 KB |
| CLI reference | `/docs/cli/devvm_agent/` | devvm agent | Fill devvm's
store of the agents' settings and logins that every VM gets | 16.6 KB |
| CLI reference | `/docs/cli/devvm_build/` | devvm build | Build an
image and the images under it, unless they're built | 16.4 KB |
| CLI reference | `/docs/cli/devvm_clone/` | devvm clone | Show or
change whether this folder's VM has its own clone of the repo | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_code/` | devvm code | Open this
folder's VM in VS Code over Remote-SSH | 15.9 KB |
| CLI reference | `/docs/cli/devvm_completion/` | devvm completion |
Print the shell completion script for bash, zsh or fish | 16.3 KB |
| CLI reference | `/docs/cli/devvm_desktop/` | devvm desktop | Open this
folder's VM's desktop in a VNC viewer | 16.0 KB |
| CLI reference | `/docs/cli/devvm_doctor/` | devvm doctor | Check what
devvm needs on this machine | 15.8 KB |
| CLI reference | `/docs/cli/devvm_gc/` | devvm gc | Delete stale
images, unused tools, old files and the Nix cache over its cap | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_git-protect/` | devvm git-protect |
Show or change .git protection for this folder's VM | 16.3 KB |
| CLI reference | `/docs/cli/devvm_group_join/` | devvm group join | Put
this folder's VM in a group of VMs | 15.9 KB |
| CLI reference | `/docs/cli/devvm_group_leave/` | devvm group leave |
Take this folder's VM out of its group | 16.0 KB |
| CLI reference | `/docs/cli/devvm_group/` | devvm group | Show the
group this folder's VM is in | 15.9 KB |
| CLI reference | `/docs/cli/devvm_history_export/` | devvm history
export | Save this folder's VM's agent history to a .tar.gz | 16.5 KB |
| CLI reference | `/docs/cli/devvm_history_import/` | devvm history
import | Put an export of agent history into this folder's VM | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_history/` | devvm history | List the
saved exports of agents' history | 16.0 KB |
| CLI reference | `/docs/cli/devvm_host/` | devvm host | Get this
folder's VM ready for ssh and editors, and show its host name | 16.4 KB
|
| CLI reference | `/docs/cli/devvm_images_rm/` | devvm images rm |
Delete images, by name or by key | 15.9 KB |
| CLI reference | `/docs/cli/devvm_images/` | devvm images | List the
images and the shared tools | 15.9 KB |
| CLI reference | `/docs/cli/devvm_layer_add/` | devvm layer add | Make
this folder's VM again with more layers, then open a shell in it | 16.6
KB |
| CLI reference | `/docs/cli/devvm_layer_new/` | devvm layer new | Start
a layer of your own | 15.8 KB |
| CLI reference | `/docs/cli/devvm_layer_rm/` | devvm layer rm | Make
this folder's VM again without some of its layers, then open a shell in
it | 16.6 KB |
| CLI reference | `/docs/cli/devvm_layer/` | devvm layer | Make image
layers of your own, or change this folder's VM's layers | 16.6 KB |
| CLI reference | `/docs/cli/devvm_limactl/` | devvm limactl | Run
Lima's limactl for debugging, which starts VMs unconfined, whatever
their tier | 16.6 KB |
| CLI reference | `/docs/cli/devvm_link_add/` | devvm link add | Link
this folder's VM to a port of another VM | 16.0 KB |
| CLI reference | `/docs/cli/devvm_link_publish/` | devvm link publish |
Show or add the ports this folder's VM offers to links | 16.3 KB |
| CLI reference | `/docs/cli/devvm_link_rm/` | devvm link rm | Remove
one of this folder's VM's links | 15.8 KB |
| CLI reference | `/docs/cli/devvm_link_unpublish/` | devvm link
unpublish | Stop offering ports of this folder's VM to links | 16.1 KB |
| CLI reference | `/docs/cli/devvm_link/` | devvm link | List this
folder's VM's links to your other VMs | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ls/` | devvm ls | List the project
VMs | 15.7 KB |
| CLI reference | `/docs/cli/devvm_network_allow/` | devvm network allow
| Allow hosts for this folder's VM | 15.9 KB |
| CLI reference | `/docs/cli/devvm_network_deny/` | devvm network deny |
Deny hosts for this folder's VM | 15.9 KB |
| CLI reference | `/docs/cli/devvm_network_log/` | devvm network log |
Show what this folder's VM connected to and what its proxy blocked |
16.5 KB |
| CLI reference | `/docs/cli/devvm_network_rm/` | devvm network rm |
Remove rules from this folder's VM | 15.8 KB |
| CLI reference | `/docs/cli/devvm_network/` | devvm network | Show or
change the network tier of this folder's VM | 16.2 KB |
| CLI reference | `/docs/cli/devvm_ports_add/` | devvm ports add |
Forward more ports from this folder's VM | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ports_rm/` | devvm ports rm | Stop
forwarding some ports from this folder's VM | 16.1 KB |
| CLI reference | `/docs/cli/devvm_ports/` | devvm ports | Show or
change which ports this folder's VM forwards | 16.3 KB |
| CLI reference | `/docs/cli/devvm_rebuild/` | devvm rebuild | Build an
image again, and delete the old one | 16.0 KB |
| CLI reference | `/docs/cli/devvm_restart/` | devvm restart | Restart
this folder's VM and open a shell in it | 16.0 KB |
| CLI reference | `/docs/cli/devvm_retention/` | devvm retention | Show
or change what devvm deletes on its own | 15.9 KB |
| CLI reference | `/docs/cli/devvm_rm/` | devvm rm | Delete this
folder's VM, or a VM whose folder is gone | 16.1 KB |
| CLI reference | `/docs/cli/devvm_secret_rm/` | devvm secret rm |
Delete a saved secret | 15.7 KB |
| CLI reference | `/docs/cli/devvm_secret_set/` | devvm secret set |
Save a secret on this machine | 15.8 KB |
| CLI reference | `/docs/cli/devvm_secret_unuse/` | devvm secret unuse |
Stop this folder's VM using a secret | 16.0 KB |
| CLI reference | `/docs/cli/devvm_secret_use/` | devvm secret use | Let
this folder's VM use a secret | 15.8 KB |
| CLI reference | `/docs/cli/devvm_secret/` | devvm secret | List the
secrets kept on this machine, for VMs to use | 16.2 KB |
| CLI reference | `/docs/cli/devvm_setup/` | devvm setup | Choose base's
features, and new VMs' size, network tier, coding agents and layers |
16.6 KB |
| CLI reference | `/docs/cli/devvm_size/` | devvm size | Show or change
this folder's VM's size | 15.9 KB |
| CLI reference | `/docs/cli/devvm_space/` | devvm space | Show what
devvm keeps on this machine and the space it takes | 16.3 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent_add/` | devvm ssh-agent add
| Load a key into devvm's own SSH agent | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent_rm/` | devvm ssh-agent rm |
Remove a key from devvm's own SSH agent | 16.0 KB |
| CLI reference | `/docs/cli/devvm_ssh-agent/` | devvm ssh-agent | Show
or change SSH agent forwarding for this folder's VM | 16.4 KB |
| CLI reference | `/docs/cli/devvm_stop/` | devvm stop | Stop this
folder's VM | 15.6 KB |
| CLI reference | `/docs/cli/devvm_tools_add/` | devvm tools add | Add
shared tools to this folder's VM, then open a shell in it | 16.3 KB |
| CLI reference | `/docs/cli/devvm_tools_rm/` | devvm tools rm | Take
shared tools out of this folder's VM, then open a shell in it | 16.3 KB
|
| CLI reference | `/docs/cli/devvm_tools_update/` | devvm tools update |
Move this folder's VM to the newest shared tools, then open a shell in
it | 16.5 KB |
| CLI reference | `/docs/cli/devvm_tools/` | devvm tools | Show or
choose this folder's VM's shared tools | 15.9 KB |
| CLI reference | `/docs/cli/devvm_update/` | devvm update | Bring this
folder's VM up to date, then open a shell in it | 16.3 KB |
| CLI reference | `/docs/cli/devvm_upgrade/` | devvm upgrade | Install
devvm's newest release | 15.8 KB |
| CLI reference | `/docs/cli/devvm/` | devvm | Open a shell in this
folder's VM, creating it first | 16.1 KB |
| Docs | `/docs/cli/` | CLI reference | Every devvm command, with its
arguments and flags | 16.1 KB |
| Docs | `/docs/contributing/` | Contributing | Build devvm, run its
tests and follow its rules | 15.8 KB |
| Contributing | `/docs/contributing/maintaining/` | Maintaining | Bump
pinned versions, release devvm and run the docs sites | 16.3 KB |
| Contributing | `/docs/contributing/testing/` | Testing on other hosts
| Run devvm's tests on Linux, x86_64 and other hosts | 16.3 KB |
| Getting started | `/docs/getting-started/commands/` | Everyday
commands | The commands you use most, in their groups | 16.0 KB |
| Getting started | `/docs/getting-started/first-vm/` | Your first VM |
Make a project's VM and start an agent in it | 16.0 KB |
| Docs | `/docs/getting-started/` | Getting started | From installing
devvm to your first VM | 15.9 KB |
| Getting started | `/docs/getting-started/install/` | Installing |
Install devvm and check what it needs | 15.8 KB |
| (none) | `/docs/` | Docs | The guides, in the order you'll need them |
15.6 KB |
| How it works | `/docs/internals/backends/` | Backends | What a backend
gives devvm, and how VMs are named | 16.1 KB |
| How it works | `/docs/internals/design/` | Design notes | Why devvm is
built this way, and what's open | 15.9 KB |
| How it works | `/docs/internals/desktop/` | The desktop | How devvm
desktop serves a VM's desktop | 15.9 KB |
| How it works | `/docs/internals/git-protection/` | .git protection |
What devvm locks in .git, and when | 15.9 KB |
| How it works | `/docs/internals/images/` | Images and caching | How
images and shared tools are built and cached | 16.2 KB |
| Docs | `/docs/internals/` | How it works | How devvm works, for
reviewers and contributors | 15.9 KB |
| How it works | `/docs/internals/install/` | Installing and updating |
What the install script and devvm doctor check | 16.1 KB |
| How it works | `/docs/internals/lima/` | Lima | How devvm sets up,
confines and clones Lima's VMs | 16.0 KB |
| How it works | `/docs/internals/network/` | Network tiers | How the
proxy confines VMs and keeps your secrets | 16.2 KB |
| How it works | `/docs/internals/overview/` | Overview | What devvm
does at each step of a VM's life | 15.8 KB |
| How it works | `/docs/internals/ports/` | Port forwarding | How devvm
forwards a VM's ports to this machine | 16.1 KB |
| How it works | `/docs/internals/security/` | Security model | What
devvm protects, how, and what it doesn't | 16.0 KB |
| Staying safe | `/docs/safety/attack-vectors/` | Attack vectors |
Common attacks, and what devvm does about each | 15.9 KB |
| Staying safe | `/docs/safety/git-protection/` | .git protection | Keep
code in the VM out of your .git | 16.0 KB |
| Docs | `/docs/safety/` | Staying safe | How devvm keeps untrusted code
off your machine | 16.0 KB |
| Staying safe | `/docs/safety/network/` | Network tiers | Choose what
each VM can reach on the network | 15.9 KB |
| Using devvm | `/docs/using/clone/` | Working on a clone | Give a VM
its own clone of the repo | 15.9 KB |
| Using devvm | `/docs/using/coding-agents/` | Coding agents | Run
Claude Code, Codex and opencode in a VM | 16.0 KB |
| Using devvm | `/docs/using/command-line/` | The command line | Help,
flags, questions, JSON output and completion | 16.3 KB |
| Using devvm | `/docs/using/customizing/` | Customizing images | Add
your own layers and choose base's features | 16.1 KB |
| Using devvm | `/docs/using/desktop/` | A VM's desktop | Add a desktop
to a VM and open it | 15.8 KB |
| Using devvm | `/docs/using/devcontainer/` | devcontainer.json | Set up
a VM from a project's devcontainer.json | 16.1 KB |
| Using devvm | `/docs/using/from/` | Starting from a container image |
Start base from a Debian, Ubuntu or Alpine image | 16.6 KB |
| Using devvm | `/docs/using/images/` | Images and tools | The images
VMs are made from, and their tools | 16.1 KB |
| Docs | `/docs/using/` | Using devvm | What you change in your VMs as
you work | 15.9 KB |
| Using devvm | `/docs/using/limits/` | Known limits | What devvm can't
do, and where | 15.7 KB |
| Using devvm | `/docs/using/links/` | Links between VMs | Let one VM
reach a service in another by name | 16.1 KB |
| Using devvm | `/docs/using/ports-size/` | Ports and size | Forward a
VM's ports and change its size | 15.9 KB |
| Using devvm | `/docs/using/settings/` | Settings and files | The files
you edit and the files devvm keeps | 16.2 KB |
| Using devvm | `/docs/using/space/` | What devvm keeps on this machine
| Each file devvm keeps, and how it's cleaned up | 16.5 KB |
| Using devvm | `/docs/using/ssh/` | SSH and editors | Reach VMs by name
from ssh and VS Code | 15.9 KB |
| Using devvm | `/docs/using/toolchains/` | Toolchains | The toolchains
VMs get, and the files that choose them | 16.2 KB |
| Using devvm | `/docs/using/troubleshooting/` | Troubleshooting | What
to do when something fails | 15.9 KB |
| Using devvm | `/docs/using/upgrading/` | Upgrading and uninstalling |
Upgrade devvm, or remove it and what it keeps | 16.5 KB |
| Using devvm | `/docs/using/vms/` | Managing VMs | Open, stop, delete
and list your VMs | 15.9 KB |
| (none) | `/` | One VM for every project | An isolated sandbox for you
or a coding agent | 16.1 KB |
| (none) | `/tags/` | Tags | (none) | 14.9 KB |

## How it was tested

- `mise run fmt && mise run lint && mise run test` passes on macOS.
`mise run lint:docs` passes: markdownlint, Vale, lychee, `TestDocLinks`,
`TestCommandLines`, `TestExplainers` and the `--panicOnWarning` build.
- I built devvm.dev and next.devvm.dev, checked that every HTML page has
exactly one `og:image`, and opened the cards for the home page, a short
title, the longest title, the longest CLI explainer, a section index, a
How it works page and the 404. I checked each card's color histogram:
four colors, so there's no antialiasing and no marks from the template.
- No e2e: the change is docs only.

## Checklist

- [x] The title is a Conventional Commit, `type(scope): summary`,
because it becomes the squashed commit's subject.
- [x] `mise run fmt && mise run lint && mise run test` passes.
- [x] New behaviour has tests, and every behaviour change updates its
page in `docs/content/docs/`.
- [x] A changed command follows the cli skill, and `mise run cli-docs`
is rerun when its help changed. (No command changed. `cli-docs` was
rerun for the generated explainers.)
- [x] Nothing here belongs in a private security advisory instead (see
SECURITY.md).

**Ready to merge:** the previews are removed and main (#25) is merged
in. The gate passes on macOS (2362 tests).

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
2026-11-07 15:17:55 -07:00

15 KiB

title, explainer, weight
title explainer weight
Security model What devvm protects, how, and what it doesn't 7

devvm treats everything in a VM as untrusted, including a coding agent with root, because the VM's user has passwordless sudo. This page explains how devvm keeps that code away from the rest of your machine. Staying safe lists what a VM can reach and the habits that keep you safe, and Attack vectors goes through common attacks one by one and lists what devvm leaves open.

All of it rests on the VM's boundary.

What devvm protects, and how

Only the project folder

A VM mounts its project folder read-write at the same path. The only other things it mounts from the host are the shared tools and its agents' config folders, both read-only, so it never mounts your home folder, which Lima's own templates do. A --clone VM doesn't mount the project folder either. It has its own clone, and its work reaches the repo only when you fetch it. When you run devvm in a subfolder and it uses the project folder's VM, that VM mounts nothing more than it already did (a subfolder's VM).

devvm refuses a project folder that would hand the VM more than the project:

  • A folder that is or holds your home folder, devvm's settings (~/.config/devvm), its state (~/.local/share/devvm, which holds its binaries and other VMs' disks) or its Lima home (unsafe_folder).
  • A folder inside devvm's own folders (unsafe_folder_inside). A VM in ~/.config/devvm/layers could rewrite the scripts that every image build runs, and a VM in devvm's data folder could rewrite the files devvm runs on the host.

--unsafe-folder mounts such a folder anyway, and devvm says so. A --clone VM mounts nothing, so devvm doesn't refuse its folder.

One VM per folder

A VM belongs to the folder it was made for, which devvm knows by its path and by the folder itself: its device and inode, and its birth time where the file system keeps one. When you delete a folder and make it again at the same path, or clone another repo where an old one was, devvm refuses to give the new folder the old folder's VM, so the new folder never quietly gets what's in the old VM's disk. devvm rm deletes the old VM and devvm adopt gives it to the new folder, and each does so only after you confirm (a folder made again). When you move or rename the folder, the folder at its new path is the same folder, so devvm offers it the VM, and moves the VM only after you confirm (a moved or renamed folder). It never offers a VM to a copy, to a folder another user owns, or on a file system that may give a new folder the inode number of a deleted one, so a VM never moves to a folder that only looks like its own.

A project's devcontainer.json

A project's devcontainer.json belongs to the project, and so to the VM, which can rewrite it for the folder's next VM, or for the VM itself when you run devvm update. devvm reads it only when it makes a VM, new or again, and uses only what it can do inside the VM. Nothing in it runs on this machine, so initializeCommand never runs. Nothing in it reaches this machine's files, because devvm doesn't follow a link out of the folder, or this machine's environment, because devvm refuses ${localEnv:…} before it makes anything. It can't add a mount or change the VM's network tier or other confinement.

Its commands run in the VM as the VM's user, confined like anything else in it. Its features can only be devvm's own layers, so devvm never fetches or runs a feature's script, and it refuses docker-outside-of-docker. devvm uses its image only when the image's registry gives it to anyone who asks anonymously, so it never uses a container image that only your Docker has or that only your registry login reaches. It refuses a registry named localhost or by an address that isn't the internet's, and its lookup connects only to the internet's addresses, so it never uses an image on this machine or its network, except through a company proxy, which resolves the registry's name itself (attack vectors).

An existing VM never changes when the file does, until you run devvm update, which says it reads the file again and asks before it makes the VM again. The file read again is held to the same refusals as a new VM's, and it can't replace a base you chose with --from, bring back a port you took out with devvm ports rm, or change its network tier, size, SSH agent or .git protection, which devvm keeps.

Its forwardPorts are added to the VM's ports, as devvm ports add adds them, even beyond a list you narrowed, both when devvm makes the VM and when devvm update reads the file again. They go through the one port forwarder, so they listen on this machine's loopback alone (127.0.0.1 and ::1), never take a port that a program on this machine has, and never take a port another VM forwards (port forwarding). What a cloned repo's file opens is so only what devvm ports add could open, but it reaches whatever on this machine connects to those ports, a browser's pages included (attack vectors).

Read-only and confined builds

devvm builds images with nothing from the host mounted, and it confines their builds so that they reach the internet but not your machine's own services (details). Credentials never go into images.

A tool build writes into a folder of its own and never into the shared tools, and devvm checks each tool image, moves it in and writes its record, with its hash (details). Tool images for glibc, which any VM may mount, build only in devvm's own Ubuntu base, never in a --from image, and musl ones are keyed by the digest of the --from base they build in, so a container image's code never reaches another VM's tools. devvm's VMs live in a Lima home of their own, so Lima settings you made for other VMs never reach them. devvm also refuses a VM with a network it didn't give the VM, because that network would reach around the proxy (details).

.git protection

The VM can't change the parts of .git that run code on the host, because devvm locks hooks and config with a flag the VM can't clear (details).

Network tiers

A VM on a confined tier, internet, allowlist or none, reaches nothing but its own proxy on the host and the links you added to it. On macOS its Lima process runs under a macOS sandbox, and on Linux QEMU's network is restricted (details). Even root in the VM can't get around that. A link's connections don't use the VM's network, because this machine carries them over ssh, and only to a port that another VM on the same tier or a stricter one publishes. An open VM runs on its backend's own network, and its proxy applies no rules.

The proxy applies the tier's rules, and it refuses the host's own addresses and internal addresses unless a rule names them (the proxy). The one thing that VMs share through their proxies is the shared Nix cache, for those with the nix layer. Only the host writes it, with packages from cache.nixos.org whose signature it checked, and nothing a VM sends is stored, so a VM can make the host fetch but can't change what another VM gets. After each start, devvm checks that the VM still runs confined and can't connect out directly, and it stops a VM that fails the check instead of opening it (the self-check).

ssh into VMs

ssh and editors reach a running VM by name through the entries that devvm writes (ssh access by name). Each entry is built so that ssh connects only to that VM and the connection gives the VM nothing else of this machine's:

  • Each entry checks the VM's own host keys, which devvm keeps in the VM's folder, ~/.local/share/devvm/vms/<hash>/run/known_hosts, as a record of the VM's current start. devvm reads them from the VM through its backend, instead of over the network, once each start, after the VM runs, and the record names the start it was read for, so the keys of an earlier start are read again rather than trusted, whoever started the VM. devvm also removes the record before each start of its own. A VM whose Lima config changed gets new host keys when it boots. A VM whose keys devvm can't read gets no entry, and ssh refuses a host key that doesn't match. devvm's port forwarder, the sessions of links between VMs and a --clone VM's git all check the VM against the same record.
  • Only host keys go into the record. devvm keeps a line the VM shows only when its key decodes and names its own type, which works for every key type ssh has, and it drops certificates, markers such as @cert-authority, patterns and anything else. So the VM can't add a line that would make ssh trust another host, or trust a key for another name.
  • Each connection is its own. The entries set ControlMaster no, so a session never rides on a connection that another program opened. Of Lima's own ssh settings for the VM, devvm copies only the address, port, user and login key, because Lima's settings turn host key checks off.
  • The entries turn off everything else your ssh could share with the VM. They set ForwardX11 no, ForwardX11Trusted no, Tunnel no, PermitRemoteOpen none, AddKeysToAgent no, ProxyJump none, ProxyCommand none, UpdateHostKeys no and HashKnownHosts no, whatever your own Host * says. That turns off X11, tunnels, remote SOCKS forwards and adding keys to an agent. PermitRemoteOpen needs OpenSSH 8.7 or newer (ssh -V), and an older ssh refuses the entries.
  • Your agent is forwarded only as the VM's SSH agent choice says. devvm's own connections to a VM follow the same choice, the one the VM's current start was made with, and each carries that VM's agent alone. devvm finds the VM's agent socket, which is yours, devvm's own or none, and gives it to the backend's start of that VM, to its shell and to the commands that set it up, such as the setup devvm sends and the devcontainer.json commands. The backend's other commands get no agent, and neither do the reads of a VM's host keys, the self-check's probe or the checks of a --clone VM's clone. devvm never changes its own environment, so when one run reaches several VMs, such as a group's links, no VM gets another VM's agent. devvm's background processes, such as the proxy and the port forwarder, start without an agent, and its own ssh to a VM uses the VM's login key alone. devvm limactl runs without your agent too, because Lima's ssh shares one connection per VM, kept open after the command ends, and an agent forwarded over it is the agent of whichever command opened it. With your agent, a devvm limactl shell could open that connection and pass your agent to devvm's later sessions of a VM whose choice is devvm's agent or none.

A session carries the VM's connections through your machine only where your ssh asks for it. The entries can't turn off a RemoteForward of yours without also refusing an ssh -R you type, so a RemoteForward still applies. The VM's sshd allows local forwarding (-L and -D, which VS Code uses), and it allows remote forwards only on addresses in 127.77.0.0/16, which devvm keeps for links between VMs, so a remote forward on the VM's localhost, as ssh -R asks by default, is refused. It allows no tunnels or X11. Root in the VM can change all of that, so it's your ssh that decides, and remote forwards you add says what's left open.

Secrets stay on the host

devvm saves secrets in the macOS Keychain, or elsewhere in files only you can read, and it never puts a secret in a process's arguments (where secrets are saved). A VM uses only the Claude Code token, when its image has claude, and the secrets you bind to it. On every tier, a VM's secrets and its agents' logins stay on your machine, and its proxy puts them only into requests for their own hosts.

The secrets work only for that VM. Its proxy needs the VM's own password, and the VM's placeholders end in a random value of the VM's own, which isn't the password, so a placeholder that the VM sends elsewhere gives nothing away. Another VM, or a program on the host that reaches the proxy's port, gets no secret. The password is in files only you can read, and never in a process's arguments or in devvm's run logs, and only you can read the proxy's logs.

Each VM's proxy reads traffic to the hosts it puts secrets in for with the VM's own CA, which devvm keeps in the VM's run folder, ~/.local/share/devvm/vms/<hash>/run/ca/ (the VM's CA). Your machine never trusts it, but inside its VM it vouches for any site, and no other VM trusts it. Only you can read the keys, they never leave this machine, and devvm keeps them out of Time Machine. Each CA lasts 30 days, and the next one, which the VM already trusts, takes over a week before the current one ends. The certificates that the proxy makes never outlast their CA. What a copy of a key could do, and for how long, is under the proxy's CA keys.

Set-id files on Linux hosts

Root in a VM can set the set-user-id and set-group-id bits on files in the project folder. On macOS these bits don't reach the host, because virtiofs drops them, but on Linux they do. A file that a Lima VM writes is yours, so a set-user-id file runs as you for anyone else on the machine who runs it. A set-user-id file that your machine's root owns runs as root for anyone who runs it, you included, and since the VM's writes are yours, such a file came from something else on this machine.

devvm names such files when it makes a VM and once a VM is stopped, by devvm stop or found stopped at a launch, but not at a launch into a running VM, because the search reads every file's metadata and takes about a second for 200,000 files. It skips .git folders, which hold most of a big project's files and whose files nothing runs by their path. It lists root's files apart with setid_root_files, and you shouldn't run them but delete them with sudo rm. It lists the rest with setid_files, and chmod u-s,g-s FILE clears their bits.

What it doesn't protect

Each defense on this page leaves something open, such as what allowed hosts and secrets permit, open VMs, files the VM writes into the project folder, links between VMs, and escapes from the VM itself through bugs in Lima, Apple's Virtualization framework or QEMU. Attack vectors keeps the one list of them, under Narrowed, not closed and Left to you, and each entry there links back to its mechanism.

Found a way out of a VM? See SECURITY.md.