A sandbox platform that runs agent and user code in isolated Firecracker microVMs, controlled through an HTTP API.
deeplethe/forkd
Fork-style microVM sandboxes for AI agents: children fork copy-on-write from a warmed Firecracker parent, KVM-isolated, with live BRANCH of running VMs.
Open-source alternative to:E2B
- Stars
- 2,901
- Forks
- 224
- Open issues
- 8
- Last commit
- 6 hours ago
What is it?
forkd is a microVM sandbox runtime built on Firecracker for workloads where many short-lived AI agent sandboxes need the same warmed environment. A parent VM boots once, imports its runtime and dependencies, and is paused to a snapshot. Each child is a separate Firecracker process that maps the parent's memory image with MAP_PRIVATE, so children share resident memory copy-on-write and spawn in roughly 100 ms rather than cold-booting a kernel.
Each child keeps hardware isolation through KVM and gets its own network namespace and cgroup v2 memory limit. forkd also provides BRANCH, which pauses a running sandbox, snapshots its in-flight state, and resumes it, with a live mode that shortens the source pause window. Snapshots can be stacked into diff chains, packed into portable archives, and pulled from a hub.
The project exposes a daemon with a REST API, a CLI, Python and TypeScript SDKs, and an MCP server for clients such as Claude Desktop and Cursor. It requires an x86_64 Linux host with KVM.
Key features
- 01Creates child microVMs from a warmed parent snapshot via copy-on-write memory sharing.
- 02Runs each child in its own KVM-backed Firecracker process with a separate network namespace.
- 03Supports BRANCH to snapshot and resume a live sandbox, including a live mode with a shorter pause.
- 04Chains diff snapshots and packs or unpacks them as portable archives.
- 05Offers REST API, CLI, Python and TypeScript SDKs, and an MCP server.
- 06Exposes Prometheus metrics and an append-only JSON audit log.
Use cases
- Running code interpreter sessions where each request gets a fresh sandbox with preloaded libraries.
- Running hundreds of parallel repository checkouts or test rollouts for agent evaluation.
- Providing per-user code execution on a self-hosted Linux host with KVM isolation.
- Forking a running agent's sandbox state to try several alternative next steps.
Quick start
- 1
Install forkd following the README install section
- 2
Fork 3 sandboxes from a snapshot tag
forkd fork --tag py-pandas -n 1
Things to know
- Requires Linux with KVM; it is not a macOS or Windows runtime.
- Live BRANCH needs Linux 5.7+, a vendored Firecracker fork, and userfaultfd enabled.
- The project is at v0.x, so interfaces may change between releases.
In collections
Topics
FAQ
- What is forkd?
- Fork-style microVM sandboxes for AI agents: children fork copy-on-write from a warmed Firecracker parent, KVM-isolated, with live BRANCH of running VMs. forkd is a microVM sandbox runtime built on Firecracker for workloads where many short-lived AI agent sandboxes need the same warmed environment. A parent VM boots once, imports its runtime and dependencies, and is paused to a snapshot. Each child is a separate Firecracker process that maps the parent's memory image with MAP_PRIVATE, so children share resident memory copy-on-write and spawn in roughly 100 ms rather than cold-booting a kernel.
- Is forkd free to use? What license does it have?
- forkd is open source under the Apache-2.0 license. Check the license terms before using it in commercial products.
- Is forkd still maintained?
- Actively maintained. The last commit to forkd was on Oct 24, 2026.
- What can I use forkd for?
- Running code interpreter sessions where each request gets a fresh sandbox with preloaded libraries. Running hundreds of parallel repository checkouts or test rollouts for agent evaluation. Providing per-user code execution on a self-hosted Linux host with KVM isolation. Forking a running agent's sandbox state to try several alternative next steps.
- How do I install forkd?
- Install forkd following the README install section Fork 3 sandboxes from a snapshot tag: forkd fork --tag py-pandas -n 1
- Where can I get forkd?
- The source code and installation instructions are on GitHub: https://github.com/deeplethe/forkd
Summary generated by AI from the project's README. GitHub stats refresh daily.
Related projects
Open-source sandbox service for AI agents that runs each workload in a hardware-isolated MicroVM, with E2B SDK compatibility and sub-60ms startup.
A Linux-based CLI that runs AI agents in ephemeral microVMs with network allowlisting and host-side secret injection.
A Linux CLI that embeds a Firecracker microVM (binary, kernel, initrd, rootfs) into a single standalone executable that boots a container in the VM.
A minimalist KVM-based virtual machine monitor that runs lightweight microVMs for secure, multi-tenant serverless and container workloads.
An ultra-light micro-VM sandbox for running untrusted workloads with hardware-enforced isolation, built on OpenVMM with Linux as the guest.