Firecracker + KVM Self-hosted MIT License

Give your agent root.Burn the VM.

Moat runs every command your AI agent executes inside a throwaway Firecracker microVM: its own Linux kernel, no host files, no host network, no host secrets. The VM is destroyed the moment the task ends. Open source. Runs on your Linux box.

Field report · sandbox sb-2f9c41 · contained
One-command install · Linux host with KVM
$ curl -fsSL https://raw.githubusercontent.com/M30W-M1X/moat/main/install.sh | sh

No account. Nothing phones home. Full procedure & verification →

Three places an agent can run code. Two of them can hurt you.

Coding agents now install packages, run generated scripts, and call tools on their own. Where that runs decides what a bad command, or a prompt injection, can reach.

On the host

Full blast radius

The command runs as you. It can read ~/.aws, your SSH keys, your browser cookies, and everything you can rm. One bad tool call is a bad day.

In a container

One shared kernel

Namespaces are a packaging boundary, not a security one for hostile code. Container escapes are a recurring class of CVE, and a leaked host mount or socket undoes the rest.

In someone's cloud

Your code leaves the building

Third-party sandboxes send your source, your data, and your prompts to infrastructure you do not control. Plus latency, a bill, and a new place to be breached.

One shared kernel is one too many.

Moat runs each task in a real virtual machine on KVM, the same isolation model AWS uses to keep Lambda and Fargate tenants apart. It is started by a seccomp-jailed Firecracker process. The guest gets its own kernel and a disposable disk. Nothing of yours is inside it.

Castle Cross-Section · Hardware Isolation Stack
HOST KERNEL · YOUR MACHINE KVM · HARDWARE VIRTUALIZATION FIRECRACKER VMM · JAILER + SECCOMP GUEST KERNEL · NETNS · OVERLAY DISK THE AGENT COMMAND contained here, then burned

Each stone course is a boundary a hostile command has to cross before it reaches anything of yours, and each one is enforced by hardware and the host kernel, not by policy.

For contrast, a container is a shallow fence: the agent's command sits one namespace away from the same host kernel you are logged into. Same kernel, same attack surface. An escape or a leaked mount lands the attacker on your box.

Seven guarantees that ship in the core.

Every control below ships in the MIT-licensed, self-hosted core. This is the whole boundary.

AHardware isolationFirecracker + KVM, a separate guest kernel per task. Not namespaces. Container-escape-class kernel bugs do not apply.
BEphemeral by defaultOne microVM per task, never reused. Destroyed on exit, TTL, or idle. An orphan reaper cleans up anything a crash leaves running.
CNothing leaks inThe host environment is deny-by-default. Every file, env var, and stdin crossing in is scanned for secrets and blocked at the gate.
DNothing leaks outA per-VM network namespace with no route to the host, to 169.254.169.254, or to your LAN.
EFiltered egressOutbound traffic goes only through a domain-allowlisted proxy (global + per-token), transparently redirected with strict policy drop nftables.
FContained blastcgroup v2 CPU, memory, and PID caps on the VMM, plus Firecracker token-bucket rate limiters on the disk and NIC.
GRuns on your metalYour workstation or your server. Nothing is ever sent anywhere. One command to install.

Create, use, destroy. Then start again from scratch.

The agent never accumulates state. Every task starts in a clean box and ends with the box gone. From a warm pool, a fresh sandbox is ready in under a millisecond.

1

Ask for a sandbox

moat_create { "template": "python", "ttl_seconds": 600, "network": "deny" }
→ { "id": "sb-7f3a19c4", "expires_at": "2026-08-30T18:40Z" }
2

Put files in — they get scanned at the gate

moat_write_file { "id": "sb-7f3a19c4", "path": "/work/task.py", "content": "..." }
→ { "bytes_written": 412, "sha256": "9f2c..." }
→ 409 secret_detected: "aws-secret-key" at line 4 — blocked
3

Run commands, capture the output

moat_exec { "id": "sb-7f3a19c4", "argv": ["python3","/work/task.py"], "timeout_sec": 60 }
→ stdout/stderr returned … { "exit": 0, "timed_out": false }
4

Pull results out

moat_read_file { "id": "sb-7f3a19c4", "path": "/work/out.json" }
→ raw bytes + sha256
5

Burn the VM

moat_destroy { "id": "sb-7f3a19c4" }
→ VM stopped, scratch disk discarded, 0 bytes persisted   (also automatic on TTL / idle)

Point your agent at Moat with one config block.

Moat ships an MCP server and a SKILL.md that teaches an agent the whole ephemeral workflow: when to sandbox, how to read results, and never to hand over the user's real credentials.

~/.config/agent/mcp.json
{
  "mcpServers": {
    "moat": {
      "command": "moat-mcp",
      "args": ["--socket", "/run/moat/moatd.sock"],
      "env": { "MOAT_TOKEN": "dev:<secret>" }
    }
  }
}
MCP tools

Six verbs

moat_create, moat_exec, moat_write_file, moat_read_file, moat_list, moat_destroy. Captured exec output, exit codes, timeouts, and secret-block errors are all first-class results.

SKILL.md

The playbook, in the repo

Describes the create→write→exec→read→destroy loop, when a command belongs in a sandbox, how to surface a blocked secret to the user instead of overriding it, and defaulting to network: deny.

Works with any MCP client (Claude Code, Claude Desktop, Cursor, Continue), plus a plain HTTP/JSON API and the moat CLI. See the Operator Guide to pick or import your default VM template.

Every way a command tries to reach you — and the wall that stops it.

Threat by threat, enforced by hardware virtualization, the host kernel, and the daemon boundary.

Defensive schedule · threat → control
If the command tries to…Moat's control
Read or write host filesNo host filesystem is mounted. The guest sees only a shared read-only rootfs and its own ephemeral copy-on-write scratch disk.
Steal host credentialsThe host environment is deny-by-default. Every variable, file, and stdin crossing into a sandbox is scanned for keys, tokens, and private material, and blocked unless explicitly allowed and audited.
Pivot to your LAN or cloud metadataEach VM gets its own network namespace. nftables drops traffic to the host, to 169.254.169.254, and to RFC‑1918 ranges.
Exfiltrate data over the networkEgress is allowed only through a domain-filtered proxy with global and per-token allowlists. Transparent DNAT and strict policy drop nftables rules stop guests from bypassing HTTP_PROXY or reaching arbitrary ports.
Fork-bomb, exhaust memory, or thrash diskcgroup v2 cpu.max / memory.max / pids.max on the VMM, plus Firecracker token-bucket rate limiters on the disk and NIC.
Exploit a container-escape-class kernel bugThere is no shared kernel. The guest runs its own kernel under KVM, launched by a Firecracker process under a seccomp filter with dropped privileges.
Leave state behind for the next taskOne microVM per task, never reused. Stopped and discarded on exit, TTL, or idle timeout. An orphan reaper cleans up anything a crash leaves running.

The cost of a sandbox should be a rounding error.

Fast enough to give every command its own VM.

20ms
Firecracker VMM cold start (median of 5 runs)
35ms
Snapshot restore to ready agent + clock resync
<1ms
Warm-pool acquire p50 (444–755 µs over 25 cycles)
4.4MiB
Diff-snapshot memory on disk (256 MiB guest, 3 ms write)

Indicative measurements on one developer machine (AMD Ryzen 7 5700G, Linux 7.2, KVM, x86_64, Firecracker v1.16.1, 256 MiB Alpine guest). Not guarantees. Numbers move with hardware and template size.

One command. No account. Nothing phones home.

$ curl -fsSL https://raw.githubusercontent.com/M30W-M1X/moat/main/install.sh | sh
Prerequisites

A Linux host with KVM

x86_64, /dev/kvm present, and systemd (or run install.sh --user to install under $HOME with a delegated cgroup slice). Bare metal, or a VM with nested virtualization.

What the installer does

Checks, fetches, verifies

Confirms virtualization support, installs moatd, moat, moat-mcp, and moat-uffd, downloads a Cosign-verified kernel, base rootfs, and CycloneDX SBOM, writes moatd.json, and installs a systemd unit.

verify
moat doctor                       # KVM, cgroup delegation, image signatures
moat run -- echo hello from a microVM
moat uninstall                    # binaries, images, unit, config, all of it

Single-node production is built. Multi-node fleet is next.

The isolation engine, self-serve MCP product, and single-node production hardening all ship today under the MIT License. Multi-node fleet orchestration and platform reach come next.

v0

The isolation engine

Built

The Firecracker control plane, proven on real microVMs.

  • microVM lifecycle: jailer, per-VM netns, snapshot / restore with clock resync, diff snapshots, per-template warm pools, orphan reaper
  • Read-only rootfs with sparse ext4 overlayfs scratch disks, plus moat template import for any OCI image
  • Guest agent as PID 1: zombie reaper, streamed exec with PTY and timeouts, byte-exact file transfer over vsock
  • Isolation: strict policy drop nftables rules, cgroup v2 limits, Firecracker rate limiters
  • Northbound HTTP/JSON API with native TLS/mTLS, Unix sockets, bearer-token auth, and per-token template, quota, and egress policy
M1

Self-serve v1.0: anyone can install it

Built

Everything a solo developer or a small team needs to curl | sh and point an agent at Moat safely.

  • Ingress secret firewall. Every file, env var, and stdin crossing in is scanned with the vendored Gitleaks rule set. Block by default, audited override, optional redaction.
  • Agent integration. The moat-mcp server (stdio over Unix socket or HTTP), SKILL.md playbook, and moat doctor preflight.
  • Install & uninstall. One-command curl | sh installer with KVM checks, SHA-256 + Cosign verification, systemd unit, and moat uninstall.
M2

Audit, trust, and single-node hardening

Built

Tamper-evident accountability and supply-chain verification on every host.

  • Hash-chained audit trail. Metadata-only JSONL log of every boundary crossing, moat audit {tail,query,report,verify}, per-sandbox activity rollups, and async webhook SIEM forwarding.
  • Reproducible images & SBOM. Deterministic ext4 builds (make images-verify in CI), CycloneDX SBOM, and images.lock digest + Cosign signature enforcement at daemon startup.
  • Snapshot-templated warm pools. Per-template pools backed by cold starts or snapshots (with optional UFFD demand-paging) and automatic guest clock resync.
M3

Fleet and reach

Next~1 quarter

Multi-node scheduling and broader platform reach for teams running agent infrastructure at scale.

  • Fleet (open-core paid). A multi-node control plane: scheduling across hosts, per-team policy, SSO / RBAC, a web console, and managed hosting. The security boundary is never in the paid tier.
  • Reach. gRPC northbound surface, GPU passthrough via an alternative VMM backend, macOS through a Linux helper VM, a WSL2 guide, and Python / TypeScript / Go SDKs.

MIT License. The boundary is never paywalled.

Free forever

Everything that isolates

The daemon, CLI, guest agent, MCP server, SKILL.md, single-node operation, and every security control. MIT licensed, self-hosted, no telemetry.

Open-core, later

Operating a fleet

Multi-node scheduling, the web console, SSO / RBAC, and managed hosting. Convenience for teams running Moat at scale, never the security guarantee.

The questions everyone asks first.

Isn't this just Docker?

Containers share the host kernel, so a container escape, a real and recurring class of CVE, puts the attacker on your box. Moat gives each task its own kernel under KVM: the same isolation model AWS uses to keep Lambda tenants apart.

Do I need root?

The daemon needs access to /dev/kvm and can run inside a delegated systemd cgroup slice without full root. The installer sets this up. Networked sandboxes and the Firecracker jailer require root or CAP_NET_ADMIN / CAP_SYS_ADMIN.

Does my code or data leave my machine?

No. Moat runs entirely on your host. Nothing is sent anywhere. The filtered egress proxy is the only outbound path, and you set its allowlist.

Which agents work with it?

Anything that speaks MCP (Claude Code, Claude Desktop, Cursor, Continue, and others), plus a plain HTTP/JSON API and the moat CLI for everything else.

What's the overhead?

A microVM adds a few MiB of memory and sub-millisecond start latency from a warm pool. Cold VMM start is ~20 ms and snapshot restore with clock resync is ~35 ms.

GPU workloads?

Not yet. Firecracker has no device passthrough. GPU support is on the roadmap via an alternative VMM backend.

macOS or Windows?

The host must be Linux with KVM. On macOS, run Moat inside a Linux VM. On Windows, WSL2 with nested virtualization works.

Let the agent run wild.

In a box that is disposable, disconnected, and empty — then burned.