1. Home
  2. Syntax

Nov 6

Securing dev environments with devvm

21 min → 3:14

Overview

CJ demonstrates `devvm`, an open-source tool he created to easily run coding projects and AI coding agents inside isolated virtual machines without exposing host API keys, credentials, or networks.

3 things to know

Privileged Developer Environment Risk

Developer machines hold high-value API keys, credentials, and broad resource access, making them prime targets for attackers.

More

While running code in containers or sandboxes is the recommended defense, traditional tools like `Dockerfile` and `devcontainer.json` can feel clunky to set up for everyday use, which prompted CJ to build `devvm` as a creator and maintainer of the project (on the Syntax show, which is sponsored by Sentry).

▶ Watch at 0:03

External Credential Proxying

When running AI coding agents (such as Claude Code, Codex, or OpenCode) inside a sandbox, putting real API keys or OAuth tokens inside the environment still leaves them vulnerable to exfiltration. `devvm` solves this by running a proxy on the host machine outside the VM; the agent inside the VM uses a dummy key, and the host proxy intercepts outbound requests to LLM APIs to inject the real API keys or OAuth credentials on the outside.

▶ Watch at 10:07

Default-Deny Outbound Network Allowlisting

By default, `devvm` blocks all outbound network traffic from the VM except for essential domains required by the selected toolchain (such as `registry.npmjs.org`, `api.anthropic.com`, and `api.openai.com`).

More

While CJ notes that hitting consecutive blocks for third-party binaries like Prisma or Playwright represents "the growing pains of using a network block," this approach exposes and stops hidden background traffic, such as VS Code Remote-SSH attempting to contact `169.254.169.254:80` (a cloud metadata IP) and Microsoft telemetry servers.

▶ Watch at 0:58

Also in this episode

Sandboxed Dependency Execution

Running commands like `pnpm i` inside an isolated VM ensures that any arbitrary script execution happens strictly inside the sandbox and cannot touch the host operating system.

More

Package managers frequently trigger `preinstall` or `postinstall` scripts and reach out to numerous third-party domains (`prisma.sh`, `playwright.dev`, `googleapis.com`) during routine installations.

▶ Watch at 6:06

File Syncing vs. Clone Mode Isolation

By default, `devvm` syncs the project folder read-write between the host and the VM, which CJ notes that "for most use cases that's totally fine." However, for untrusted repositories or when a developer does not want an AI agent directly modifying local host files, `--clone` mode creates an isolated Git clone inside the VM and configures a `devvm` Git remote on the host so changes are only pulled in when explicitly fetched and merged.

▶ Watch at 11:36

Cached Base Layers and VM Architecture

Built on top of Lima (requiring macOS 13 or newer on `arm64` or `x86_64` and Lima 1.0 or newer), `devvm` uses a cached, read-only base layer built on Ubuntu (`20261016`) pre-loaded with CLI tools (`oh-my-bash`, `zoxide`, `tldr`, `tree`, `bat`, `fd`, `eza`, `btop`, `fzf`).

More

Although the initial build takes 5 to 10 minutes to download images and layers (consuming `5.9G` for shared images/tools and `3.3G` in Lima's download cache in CJ's demo), subsequent VMs spin up in about 5 seconds.

▶ Watch at 1:35

Composable Layers and Container Conversion

Rather than relying solely on host-level services, developers can layer additional capabilities into the VM, including built-in toolchains (`node`, `python`, `rust`, `go`), environments (`desktop` with Xfce, `docker` for running `docker compose up -d` with Postgres, MySQL, and Redis inside the VM, or `nix`), and `devcontainer.json` configs.

More

Users can also boot a full VM directly from a Docker image using `devvm --from <image>`, though CJ hedges that this currently only supports Debian, Ubuntu, or Alpine images because "these are just the ones I've tested so far."

▶ Watch at 13:29

Quotes

“As a developer, you are a target for hackers these days. They want to get your API keys, they want to get your credentials, and pretty often developer machines are privileged, they have access to a lot of stuff.”

▶ Watch at 0:03

“So devvm actually has a proxy that sits outside of the VM, and that intercepts all requests to any specific agent or LLM that you're using, and injects the API keys on the outside. So your API keys, your OAuth keys, none of that ever makes it into the VM, it always lives outside of the VM.”

▶ Watch at 2:16

“And again, this is running inside the VM, so nothing is touching my machine. If there were any approve builds or like postinstall or preinstall that any of those npm scripts would have run, it would have happened inside of the VM.”

▶ Watch at 6:09

Full summary

Episode Overview

  • CJ demonstrates devvm, an open-source tool he created to easily run coding projects and AI coding agents inside isolated virtual machines without exposing host API keys, credentials, or networks.
  • The episode addresses the growing security threat of hackers targeting privileged developer machines through malicious dependencies and compromised coding environments.
  • CJ walks through the core architecture of devvm, explaining how it pairs cached Ubuntu virtual machines with a strict outbound network allowlist and an external credential proxy.
  • Through live terminal demonstrations, the episode covers practical developer workflows, including dependency installation, OAuth token handling, isolated Git clones, Docker-in-VM setups, and external agent orchestration.

Key Concepts

  • Privileged Developer Environment Risk: Developer machines hold high-value API keys, credentials, and broad resource access, making them prime targets for attackers. While running code in containers or sandboxes is the recommended defense, traditional tools like Dockerfile and devcontainer.json can feel clunky to set up for everyday use, which prompted CJ to build devvm as a creator and maintainer of the project (on the Syntax show, which is sponsored by Sentry).
  • External Credential Proxying: When running AI coding agents (such as Claude Code, Codex, or OpenCode) inside a sandbox, putting real API keys or OAuth tokens inside the environment still leaves them vulnerable to exfiltration. devvm solves this by running a proxy on the host machine outside the VM; the agent inside the VM uses a dummy key, and the host proxy intercepts outbound requests to LLM APIs to inject the real API keys or OAuth credentials on the outside.
  • Default-Deny Outbound Network Allowlisting: By default, devvm blocks all outbound network traffic from the VM except for essential domains required by the selected toolchain (such as registry.npmjs.org, api.anthropic.com, and api.openai.com). While CJ notes that hitting consecutive blocks for third-party binaries like Prisma or Playwright represents "the growing pains of using a network block," this approach exposes and stops hidden background traffic, such as VS Code Remote-SSH attempting to contact 169.254.169.254:80 (a cloud metadata IP) and Microsoft telemetry servers.
  • Sandboxed Dependency Execution: Package managers frequently trigger preinstall or postinstall scripts and reach out to numerous third-party domains (prisma.sh, playwright.dev, googleapis.com) during routine installations. Running commands like pnpm i inside an isolated VM ensures that any arbitrary script execution happens strictly inside the sandbox and cannot touch the host operating system.
  • File Syncing vs. Clone Mode Isolation: By default, devvm syncs the project folder read-write between the host and the VM, which CJ notes that "for most use cases that's totally fine." However, for untrusted repositories or when a developer does not want an AI agent directly modifying local host files, --clone mode creates an isolated Git clone inside the VM and configures a devvm Git remote on the host so changes are only pulled in when explicitly fetched and merged.
  • Cached Base Layers and VM Architecture: Built on top of Lima (requiring macOS 13 or newer on arm64 or x86_64 and Lima 1.0 or newer), devvm uses a cached, read-only base layer built on Ubuntu (20261016) pre-loaded with CLI tools (oh-my-bash, zoxide, tldr, tree, bat, fd, eza, btop, fzf). Although the initial build takes 5 to 10 minutes to download images and layers (consuming 5.9G for shared images/tools and 3.3G in Lima's download cache in CJ's demo), subsequent VMs spin up in about 5 seconds.
  • Composable Layers and Container Conversion: Rather than relying solely on host-level services, developers can layer additional capabilities into the VM, including built-in toolchains (node, python, rust, go), environments (desktop with Xfce, docker for running docker compose up -d with Postgres, MySQL, and Redis inside the VM, or nix), and devcontainer.json configs. Users can also boot a full VM directly from a Docker image using devvm --from <image>, though CJ hedges that this currently only supports Debian, Ubuntu, or Alpine images because "these are just the ones I've tested so far."

Quotes

  • At 0:03 - "As a developer, you are a target for hackers these days. They want to get your API keys, they want to get your credentials, and pretty often developer machines are privileged, they have access to a lot of stuff." - framing the core security vulnerability that makes local sandboxing necessary for modern software development.
  • At 2:16 - "So devvm actually has a proxy that sits outside of the VM, and that intercepts all requests to any specific agent or LLM that you're using, and injects the API keys on the outside. So your API keys, your OAuth keys, none of that ever makes it into the VM, it always lives outside of the VM." - explaining the architectural mechanism that protects authentication tokens from prompt-injected agents or malicious dependencies.
  • At 6:09 - "And again, this is running inside the VM, so nothing is touching my machine. If there were any approve builds or like postinstall or preinstall that any of those npm scripts would have run, it would have happened inside of the VM." - demonstrating how isolating package installations prevents malicious lifecycle scripts from compromising the host system.

Takeaways

  • Authenticate and run AI coding agents via a host proxy: Use devvm agent login <agent> on your host machine to store OAuth tokens in the host's agent store, allowing agents inside your VMs to operate without ever having access to your actual credentials.
  • Audit and selectively unblock outbound network requests: Monitor blocked connections using devvm network log or the in-VM devvm-why command, and only permit necessary domains from the host using devvm network allow <domain> when tools like Prisma or Playwright require external binary downloads.
  • Manage VM lifecycles, Git isolation, and host resources: Use devvm --clone when working with untrusted codebases (pulling reviewed work back to the host via git fetch devvm and git merge), connect external tools like VS Code (devvm code), Herdr, or T3 Code via SSH (remembering to manually cd from /home/<user>.guest into your host-matching project directory path when using external orchestrators), and run devvm rm when finished with a project to free up host CPU and RAM while automatically archiving agent session histories to ~/.local/share/devvm/exports/.

Watch the full episode 21 min

Read along with the audio summary

CJ warns that as a developer, you are a prime target for hackers who want your application programming interface keys, credentials, and broad resource access. On this episode of the Syntax show, which came out on November 6, 2026, CJ demonstrates devvm, an open source tool he created and maintains. By the end, you will learn how to run coding projects and artificial intelligence agents inside isolated virtual machines, or simulated computers, without exposing your host credentials or networks.

Why your developer machine needs an easier sandbox. Running code inside isolated containers is the recommended defense against attackers, yet traditional setups like Dockerfile and devcontainer configurations can feel clunky for everyday use.

Keeping your real security keys completely out of the sandbox. Even inside a virtual machine, putting real authentication tokens or keys into the environment leaves them vulnerable to being stolen when running artificial intelligence coding agents like Claude Code, Codex, or OpenCode. Devvm solves this by giving the agent inside the virtual machine a dummy key, while a proxy on the host machine intercepts outbound requests to large language model interfaces and injects the real credentials on the outside.

How blocking outbound network traffic exposes hidden background requests. By default, devvm blocks all outbound traffic except for essential domains needed by your chosen tools, such as the Node package registry, Anthropic, and OpenAI. While CJ notes that hitting repeated blocks for third party binaries like Prisma or Playwright represents the growing pains of using a network block, this strict rule exposes and stops hidden background traffic, like Visual Studio Code Remote Secure Shell trying to contact a cloud metadata address and Microsoft telemetry servers.

Stopping package installers from touching your main operating system. Routine dependency installations frequently trigger automated preinstall or postinstall scripts and reach out to third party domains like Prisma, Playwright, and Google APIs. Running a package manager install command inside an isolated virtual machine ensures any arbitrary script execution happens strictly inside the sandbox and cannot touch your host machine.

Protecting your local files from untrusted code and artificial intelligence edits. When you do not want an agent directly modifying local files, a clone mode creates an isolated Git version control copy inside the virtual machine. You can use the devvm clone flag when working with untrusted codebases, and only pull reviewed work back to your host using standard Git fetch and merge commands.

Spinning up a fresh virtual machine in about five seconds. Built on top of the Lima virtualization tool for recent Mac systems, devvm achieves this speed by reusing a cached, read only Ubuntu base layer preloaded with helpful command line tools.

Stacking custom environments and booting directly from container images. Rather than relying only on host services, you can layer capabilities directly into the virtual machine. You can also boot a full virtual machine directly from a Docker image using the from flag, though CJ hedges that this currently only supports Debian, Ubuntu, or Alpine images because these are just the ones he has tested so far.

Isolating your development environment protects your machine only when your credentials, network, and host resources stay strictly under your control. When you finish with a project, run the devvm remove command to free up host processor and memory while automatically archiving your agent session histories to your local share directory.

Related Episodes