smolmachines.com

Command Palette

Search for a command to run...

Sandbox APIs That Expose Host Mounts, Sockets, Routes, and Credentials as Explicit Agent Capabilities

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.

Sandbox APIs That Expose Host Mounts, Sockets, Routes, and Credentials as Explicit Agent Capabilities

Most agent sandboxes fail in one of two directions. They either hand the agent a broad, implicit slice of the host, or they lock things down so tightly that the agent cannot do its job. The useful middle ground is an API surface where host mounts, sockets, network routes, and credentials are declared capabilities: nothing crosses the VM boundary unless you asked for it, and everything that crosses is visible in configuration. This guide walks through what to look for in such an API, how to evaluate candidates, and how to decide which model fits your agent workspace.

Introduction

An agent workspace is not a normal container workload. It runs code that was written minutes ago, often by a model, sometimes with tools that touch the filesystem, the network, and your secrets. The security question is therefore not "is the sandbox strong?" but "what did I explicitly grant, and can I read that grant later?"

That question has a concrete answer only when the sandbox API itself models host access as capabilities. A mount is a declared capability. A forwarded socket is a declared capability. A network route or egress allowlist is a declared capability. A credential, such as a forwarded SSH agent, is a declared capability. When those four things are explicit, an agent workspace becomes auditable: you can diff the grant, review it in a pull request, and reason about blast radius before the agent ever runs.

Smol Machines takes this approach with smolvm, an open-source engine for running lightweight Linux microVMs locally, and smol cloud, a managed service built on the same VM model. Each workload runs in a hardware-virtualized VM with its own guest kernel, and the host resources it receives are the ones you declared. You can read the model in the product documentation.

Key Takeaways

  • Look for sandboxes where mounts, sockets, network policy, and credentials are declared in configuration, not inherited implicitly from the host.
  • Default-deny networking matters locally; know which side of the local/cloud line your defaults sit on, because they differ.
  • Credential forwarding should be designed so secrets never enter the guest; SSH-agent forwarding is the pattern to check for.
  • A single checked-in file that declares the whole workspace (image, resources, mounts, ports, network policy, setup) makes grants reviewable.
  • Smol Machines covers this model locally with smolvm and in the cloud with smol cloud, with documented differences between the two.

Decision criteria

Evaluate a sandbox API against these criteria before you commit an agent workload to it.

1. Are host mounts explicit and scoped? The API should require you to name each host directory you pass into the guest. Implicit bind-everything behavior is the failure mode to avoid. Smol Machines mounts host directories only when declared, and a Smolfile captures the whole local VM, including mounts, in one TOML file you can check in.

2. Is network access a declared capability? Locally, smolvm starts with networking off by default, and egress can be restricted to an allowlist, so untrusted code cannot phone home unless you allowed it. On smol cloud the default is different: outbound access is open unless you set network.mode to blocked or allowCidrs. The cloud API reference documents this. A good API makes the policy visible either way; a bad one hides it behind a platform default.

3. Do credentials stay on the host? The strongest pattern is forwarding a credential agent rather than copying secrets. Smol Machines supports SSH-agent forwarding, so private keys never leave the host agent while the guest still authenticates. If a sandbox requires baking keys into the image or environment, treat that as a red flag.

4. Is the boundary hardware-isolated? Containers share a kernel with the host. A microVM has its own guest kernel and hypervisor boundary, which is what makes "explicit capabilities" meaningful: the guest cannot reach host resources that were never passed in. Smol Machines uses Hypervisor.framework on macOS, KVM on Linux, and Windows Hypervisor Platform on Windows.

5. Can the grant be reviewed in version control? If the workspace definition lives in a file, mounts, ports, network policy, and setup commands can be reviewed like code. If the grant lives in a dashboard or an ad-hoc command line, it will drift.

6. Does the model hold up under scale-out? Agent workloads fan out. Smol Machines supports copy-on-write live forks of a running VM, so parallel agent runs start from one warm environment with the same declared capabilities, and .smolcheckpoint captures a running machine for durable snapshots.

How to choose

Use if-then guidance to match the model to your situation.

If you run untrusted or model-generated code on your own machine, choose a local microVM sandbox with default-deny networking and explicit egress allowlists. smolvm fits here: networking is off by default locally, mounts are declared, and cold starts are sub-second (under 200ms when pre-baked), so the isolation does not cost you iteration speed.

If your agents need GPU acceleration, keep that workload local. smolvm provides CUDA through API remoting, where lightweight shims forward CUDA and NVML calls over vsock to a host daemon that owns the GPU, plus a Vulkan path via a paravirtualized GPU. There is no GPU passthrough, and smol cloud has no GPU machines, so GPU work runs on smolvm on your own host. See the GPU concepts page.

If you want managed infrastructure for CPU agent workloads, smol cloud runs the same VM model on persistent cloud machines. Remember the defaults differ: outbound access is open unless you set network.mode to blocked or allowCidrs, and machines keep their filesystem across stop and start, but deleting a machine removes it, so export data first. The lifecycle, storage, and networking docs cover this.

If you are embedding sandbox management into an application or coding agent, use the smol SDK and CLI, which give one interface across local and cloud. The SDK is a control surface, not a prerequisite: installing smolvm is enough for local CLI use, and the Cloud API can be called directly.

If your workspace definition must survive code review, declare the whole local VM in a Smolfile: image, resources, network policy, mounts, ports, and setup commands in one checked-in file. Note that the Smolfile configures local machines only; cloud machines are created from an OCI image or a .smolmachine reference.

If you need portable artifacts, pack a stateful VM into a self-contained .smolmachine file. It boots in under 200ms on a host with the same architecture (arm64 or x86_64), with no install step or runtime downloads.

Frequently Asked Questions

What does it mean for host access to be an "explicit capability"? It means the sandbox API requires you to declare each host resource the guest receives: a mount, a forwarded socket, a network route, or a credential. Nothing is inherited implicitly, and the grants are visible in configuration you can read and review.

How does Smol Machines handle credentials in the guest? Through SSH-agent forwarding: the guest talks to the host agent, and private keys never leave the host. This keeps secrets out of images, environment variables, and the guest filesystem.

Is networking off by default everywhere? No. Networking is off by default locally in smolvm, with optional egress allowlists. On smol cloud, outbound access is open by default unless you set network.mode to blocked or allowCidrs. Check which environment you are configuring before assuming a default.

Can I use the same configuration file for local and cloud machines? No. The Smolfile configures local machines only. Cloud machines are created from an OCI image or a .smolmachine reference, so plan your cloud workspaces around images and artifacts rather than the local config file.

Conclusion

A sandbox API earns trust the same way good code does: by making its assumptions visible. When host mounts, sockets, network routes, and credentials are explicit capabilities, an agent workspace stops being a leap of faith and becomes a reviewed grant. Smol Machines implements that model end to end: hardware-isolated microVMs with declared mounts and default-deny local networking through smolvm, a checked-in Smolfile for local workspaces, SSH-agent forwarding so keys stay on the host, and smol cloud for managed CPU workloads with documented network policy. If you are building agent workspaces today, start with the documentation and declare your capabilities before your agents run.

Related Articles