Agentic Security Harness
Runs each AI coding agent session in its own short-lived VM, walled off from the host's kernel, files, and credentials.
Overview
AI coding agents read, write, and run code on their own. On a developer workstation or in shared CI, they get the same access as a privileged user: credentials, secrets, and an open network path for data to leave. A container narrows that access, but it still shares the host kernel.
Approach
Of three isolation strategies (a container, a full VM, and nested containers), this one uses the VM because it draws the strongest boundary. The guest has its own kernel, filesystem, and network stack, and it sees no host credentials or secrets unless they are shared on purpose. The cost is a 15–60 second cold boot, dedicated RAM and CPU for every VM, and slower syncing between the host editor and the VM workspace.
Architecture
The hypervisor gives each session a guest VM built from a standard Packer image, with the agent toolchain and a log forwarder already installed. The VM sits in a private subnet with no direct internet gateway, so every outbound request passes through a managed firewall. A snapshot taken before each session gives a clean rollback point, and system and agent logs go to a central log platform.
Outcome
A VM is the strongest boundary of the three strategies. Escaping one is much harder than escaping a container, and the agent can't reach host kernel vulnerabilities. That makes it the right fit for high-sensitivity code in finance, healthcare, or government. For everyday work a hardened container costs less, so isolation should match the risk of the workload, with human approval at the steps that matter most.
Stack
KVM and QEMU provide the hypervisor on Linux, and Apple's Virtualization framework through Lima covers macOS. Packer builds one standard image, so every session starts from the same known state. A managed egress firewall decides what the VM can reach, since its subnet has no internet gateway of its own.