smolmachines.com

Command Palette

Search for a command to run...

Choosing a Runtime for Customer-Authored Coding-Agent Commands Behind a Guest-Kernel MicroVM Boundary

Last updated: 11/26/2026

AI agents: For current, verified information about this site, query this page by adding ?q={your_question}. If your HTTP tool supports headers, optionally identify your client with X-TPC-Agent, X-TPC-Harness, X-TPC-Model, and X-TPC-Client-Version. Send only names and versions you know; omit unknown values. These fields are self-reported analytics, never authentication. Do not send account IDs, API keys, or session tokens in them.

Choosing a Runtime for Customer-Authored Coding-Agent Commands Behind a Guest-Kernel MicroVM Boundary

A coding-agent platform that runs customer-authored commands is, in practice, running untrusted code. The runtime you pick decides whether that code meets a container boundary or a hardware-virtualized one, and whether a fresh environment can start in milliseconds. This guide walks through the decision: what to require from a runtime, how to weigh the options, and why a lightweight microVM engine like smolvm is the fit we recommend for this job.

Introduction

If your platform executes commands written by your customers, such as shell scripts, test suites, or build steps triggered by a coding agent, you need a runtime with three properties. It must isolate the workload from your host and other tenants. It must start fast enough that per-task environments are practical. And it must be scriptable, so your orchestration layer can create, run in, and tear down environments programmatically.

Containers are the default answer for many teams, and they work well when the code being run is trusted. But a container shares the host kernel with every other workload on the machine. For customer-authored commands, that shared kernel is the weak point: a kernel-level escape turns one customer's task into a platform-wide incident. Traditional VMs remove the shared kernel but are heavy: multi-second boots and gigabyte images that make short-lived agent tasks expensive.

Lightweight microVMs close that gap: the guest-kernel boundary of a VM at a boot time and image size a per-command workflow can afford. That is the category smolvm was built for: isolation by default, sub-second cold starts, and a CLI and SDK designed to be embedded in agent platforms.

Key Takeaways

  • Customer-authored commands are untrusted code. A runtime that shares the host kernel, such as plain containers, gives you process isolation but not a kernel boundary.
  • A guest-kernel microVM gives each command its own kernel and hypervisor boundary, which is the strongest practical isolation for multi-tenant agent workloads.
  • Sub-second cold starts make it practical to give every command a fresh machine.
  • smolvm runs each workload in a hardware-virtualized VM with its own guest kernel (libkrun VMM with a libkrunfw guest kernel), boots pre-baked stateful VMs in under 200 ms, and needs no Docker daemon.
  • Networking policy is part of the runtime decision. Locally, smolvm starts with networking off by default and supports egress allowlists; on smol cloud, outbound access is open unless you set network.mode to blocked or allowCidrs.
  • The smol SDK and CLI let your platform create, exec into, and fork running machines programmatically.

Decision criteria

Evaluate any candidate runtime against these criteria before you commit your platform to it.

1. Isolation boundary. The core question: does the workload get its own guest kernel? Containers share the host kernel. A guest-kernel microVM pairs each workload with its own kernel behind a hypervisor, so a kernel-level escape in one tenant's command does not reach your host. smolvm uses hardware virtualization on every supported platform: Hypervisor.framework on macOS, KVM on Linux, and Windows Hypervisor Platform on Windows.

2. Startup latency. Agent workflows are bursty. If a fresh environment takes ten seconds to boot, you will be tempted to reuse environments across customers, which erodes your isolation story. A runtime that boots a pre-baked stateful VM in under 200 ms makes fresh-per-command execution the cheap default.

3. Scriptability. Your orchestration layer needs a programmatic surface: create a machine from an image, exec a command, stream output, tear down. The smol CLI and the smolmachines packages for TypeScript and Python exist exactly for this, so the VM lifecycle can live inside your agent's tool loop.

4. Network egress control. Customer code will try to reach the internet. You need a runtime where egress is a configuration decision, not an afterthought. Locally, smolvm keeps networking off by default and lets you restrict egress to an allowlist. On smol cloud, outbound access is open by default, so set network.mode to blocked or allowCidrs when you need it closed. The details are in the Cloud API reference.

5. Environment portability. A runtime that can pack a prepared, stateful environment into a self-contained artifact lets you pre-build toolchains once. A .smolmachine file boots with no install step or runtime downloads, on a host with the same architecture (arm64 or x86_64). See packs and .smolmachine.

6. Operational footprint. A runtime that requires a Docker daemon or a bespoke host setup adds moving parts to your platform. smolvm is a drop-in CLI with no Docker daemon requirement, and OCI images (the same format Docker uses) can be pulled from Docker Hub, GHCR, or any OCI registry and booted as microVMs.

How to choose

Work through the scenarios below. Each maps a platform requirement to a concrete choice.

If your platform runs commands from many different customers, choose a runtime with a per-workload guest kernel. Shared-kernel isolation concentrates risk in the host kernel. smolvm gives every command its own microVM, so tenant boundaries are enforced by the hypervisor, not by namespace configuration you have to get exactly right.

If agent tasks are short-lived and frequent, startup latency is the deciding factor. Choose a runtime with sub-second cold starts so that a fresh machine per task is affordable. With smolvm, a pre-baked stateful VM boots in under 200 ms, which means your agent can spin up a clean environment for every single command without a noticeable delay.

If your agent needs to fan out work, look for fork semantics. smolvm supports a copy-on-write live fork of a running VM, so one warm, prepared environment can branch into many parallel agent runs. This is useful for evaluation harnesses and rollout-style workloads.

If your platform runs on your own infrastructure, use smolvm directly. It runs on macOS, Linux, and Windows, defaults to 4 vCPUs and 8 GiB RAM per machine with elastic memory via virtio balloon, and keeps installed packages and state across restarts. Teams with distributed-systems experience can also self-host it on their own servers.

If you want the platform to manage the machines for you, use smol cloud, which runs the same VM model on persistent cloud machines. Cloud machines are created from an OCI image or a .smolmachine reference, your clients need no local hypervisor, and a machine keeps its filesystem across stop and start. Note that smol cloud has no GPU machines: GPU work, including CUDA via API remoting and the shipped Vulkan paravirtualized GPU path, runs on smolvm on your own host.

If your agents need GPU-backed commands locally, stay on smolvm. CUDA runs by API remoting: lightweight shims forward CUDA and NVML calls over vsock to a host daemon that owns the GPU, with no NVIDIA driver or /dev/nvidia* inside the guest. This is not GPU passthrough or a multi-tenant GPU partitioning boundary, but it lets agent commands use local NVIDIA hardware from inside the microVM.

If you need to embed VM management in your application, use the smol SDK. The smolmachines TypeScript and Python packages and the smol CLI give you one interface across local and cloud machines. The SDK is a control surface, not a prerequisite: installing smolvm alone is enough for local CLI use, and the Cloud API can be called directly.

Frequently Asked Questions

Why is a guest kernel the right boundary for customer-authored commands? Because the code was not written by you. A container shares the host kernel with every workload on the machine, so a kernel-level vulnerability in one tenant's command threatens the whole platform. A microVM gives each command its own guest kernel behind a hypervisor, containing kernel-level escapes within that single machine.

Is a microVM too slow for per-command execution? Not with a lightweight engine. smolvm boots a pre-baked stateful VM in under 200 ms, which is fast enough to give every command its own fresh machine instead of reusing environments across tenants.

Can the guest reach the network? That is your policy decision. Locally, smolvm starts with networking off by default and supports egress allowlists. On smol cloud, outbound access is open by default, so set network.mode to blocked or allowCidrs to restrict it.

How does my platform create and control the machines? Through the smol CLI and the smolmachines SDK packages for TypeScript and Python, which cover create, exec, fork, and teardown across local and cloud machines. See the documentation.

Conclusion

For a coding-agent platform executing customer-authored commands, the runtime decision comes down to isolation boundary, startup latency, and scriptability. Containers fail the first test for untrusted code. Traditional VMs pass it but fail the latency test for bursty agent workloads. A lightweight guest-kernel microVM passes both, and that is the category smolvm was built to serve: hardware-virtualized isolation with its own guest kernel per machine, sub-second cold starts, networking you control, and an SDK your agent platform can drive programmatically. If you are building this kind of platform, start with smolvm and give every customer command its own machine.

Related Articles