k8e.sh β Open Source Agentic AI Sandbox Matrix. A single binary under 100MB that turns any Linux host into a secure, isolated execution platform for AI agents β gVisor, Kata, or Firecracker isolation, warm-pool fast starts, and an E2B-compatible API. Up and running in 60 seconds.
curl -sfL https://k8e.sh/install.sh | sh -That's it. Your agentic sandbox matrix is ready. π€
K8E is the Open Source Agentic AI Sandbox Matrix β a self-hosted sandbox platform for running secure, isolated AI agent workloads at scale, packaged as a single binary under 100MB.
As autonomous AI agents increasingly generate and execute untrusted code, robust sandboxing infrastructure is no longer optional. K8E ships everything needed to spin up a production-grade cluster in under 60 seconds, with first-class primitives for agent isolation, resource governance, and persistent execution environments β purpose-built for the AI era.
π One cluster. Many agents. Zero trust between them.
| Capability | Description |
|---|---|
| π Hardware Isolation | Pluggable runtimes: gVisor (default), Kata Containers, Firecracker microVM |
| π Network Policies | Bundled Cilium enforces the standard networking.k8s.io/v1 NetworkPolicy API by default β plus eBPF toFQDNs egress control per session; allowed_hosts enforced via --cilium-dns-proxy (KIP-16 M10) |
| βοΈ Resource Quotas | CPU/memory caps per agent session to prevent runaway costs |
| πΎ Persistent Workspaces | Every session carries a PVC workspace (1Gi local-path by default); warm pods boot with their claim pre-provisioned β fast start and durable files |
| π§ Warm Pool | Pre-booted sandbox pods for sub-500ms session claim latency; application-layer readiness handshake, adaptive sizing, per-session background-run caps |
| πΈ Content-Addressed Snapshots | SHA-256 CAS layerstore with zstd compression, chunked multi-layer manifests, incremental --base restore, server-side registry, autosquash (KIP-16 M2) |
| π Exec Transcripts | File-backed, windowed, offset-resumable command transcripts β k8e-sandbox-cli log (KIP-16 M4) |
| π Observability | Prometheus metrics, disk-only NDJSON event stream, process topology β events / ps CLI (KIP-16 M5) |
| π Sub-agent Reuse | Sub-agents share the parent pod + workspace; isolated reset (KIP-16 M1) |
| π§Ύ CLI Catalog | Machine-readable command/flag surface for SDK generation β catalog (KIP-16 M9) |
| π€ agent-sandbox compatible | Works with kubernetes-sigs/agent-sandbox |
| π SKILL + CLI + MCP | AI agents (Claude Code, Codex, Pi) connect via k8e-sandbox-cli or the /k8e-sandbox skill |
π Full documentation: k8e.sh/guide β guides, CLI reference, and examples live on the official site.
AI Agents (Claude Code / Codex / Pi / dsh)
β k8e-sandbox-cli / plugin tools (gRPC over mTLS)
βΌ
ββββββββββββββββββββββββββββββββββββββββββββββββ
β SANDBOX GATEWAY β
β sessions Β· exec Β· files Β· PTY terminals β
β expose Β· allow-hosts Β· snapshots β
β warm pool Β· metrics Β· event stream β
ββββββββββββββββ¬ββββββββββββββββββββββββββββββββ
β claims ready pods from the warm pool
βββββββββββββΌββββββββββββ ββββββββββββββββββ
β SANDBOX POD β β SANDBOX POD β
β gVisor / Kata / FC β β¦ β (isolated) β
β agent's code + PVC β β β
βββββββββββββββββββββββββ ββββββββββββββββββ
eBPF per-session network policy between all of them
One gateway fronts every operation β session lifecycle, streaming exec,
filesystem, PTY terminals, service exposure (expose), live egress policy
(allow-hosts) and content-addressed snapshots β so agents get one audited
door instead of raw infrastructure access.
gVisor is recommended β no KVM required:
ARCH=$(uname -m) # x86_64 on most servers, aarch64 on ARM URL=https://storage.googleapis.com/gvisor/releases/release/latest/${ARCH} wget ${URL}/gvisor.tar.zstd ${URL}/gvisor.tar.zstd.sha512 sha512sum -c gvisor.tar.zstd.sha512 # must print OK sudo tar --zstd -xf gvisor.tar.zstd -C /usr/local/bin
K8E detects
runscat startup and automatically injects the gVisor stanza into its containerd config. Do not runrunsc installβ K8E manages its own containerd configuration.
Need stronger isolation? Kata Containers and Firecracker are covered in the Sandbox Runtime Setup guide.
curl -sfL https://k8e.sh/install.sh | sh -k8e-sandbox-cli status # -> {"available": true, ...} k8e-sandbox-cli run 'echo hello from the sandbox'
Download the standalone sandbox CLI, authenticate, and install the /k8e-sandbox skill into your agent:
# 1. Download (~44MB) β pick your platform suffix # k8e-sandbox-cli-linux-amd64 / linux-arm64 / darwin-arm64 / windows-amd64.exe curl -sLO https://github.com/xiaods/k8e/releases/latest/download/k8e-sandbox-cli-linux-amd64 chmod +x k8e-sandbox-cli-linux-amd64 # 2. Create an API key on the server (default TTL 30 days; --ttl never for non-expiring) k8e sandbox-apikey create my-agent # β {"name":"my-agent","key":"k8e-abc123...","ttl_days":30,"expires_at":"..."} # 3. Connect: mTLS auth + install the skill into Claude Code / Codex / Pi ./k8e-sandbox-cli-linux-amd64 --endpoint <server-ip>:50051 --apikey k8e-abc123... connect
Then ask your agent naturally:
"Run this Python snippet in a sandbox"
The agent executes k8e-sandbox-cli run automatically β no session management needed.
π Tutorial walkthroughs, the full command reference, and configuration details live in the Sandbox CLI guide and Sandbox Examples on the official docs site.
| K8E π | E2B | Daytona | agent-sandbox | DIY gVisor/Firecracker | |
|---|---|---|---|---|---|
| Self-hosted, single binary | β <100MB | β | β needs a K8s cluster | β you build it | |
| Isolation runtimes | β gVisor / Kata / Firecracker β pluggable | Firecracker microVMs | β microVM/containers | K8s RuntimeClass | one runtime |
| E2B SDK compatibility | β native (official SDKs unmodified) | β native | β own API | β | β |
| Warm pool (sub-500ms claims) | β built-in, adaptive sizing | β managed | β | ||
| Per-session network policy (eBPF) | β Cilium, live-configurable | managed (fixed) | hand-written | ||
| License | Apache 2.0 | Apache 2.0 (hosted core paid) | Apache 2.0 | Apache 2.0 | β |
When to choose K8E: you want E2B-style sandboxes but self-hosted, with a rich tool surface beyond "run code" β PTY terminals, snapshots, service exposure, and live egress policy, all through one audited gateway.
git clone https://github.com/<your-username>/k8e.git && cd k8e git checkout -b feat/my-feature make && make test git push origin feat/my-feature
- π Bug Reports
- π‘ Feature Requests
- π Open PRs
Report vulnerabilities via GitHub Security Advisories. Do not open public issues for security bugs.
Apache License 2.0 β see LICENSE.
| Project | Contribution |
|---|---|
| π K3s | Lightweight Kubernetes foundation that inspired K8E |
| βΈοΈ Kubernetes | The orchestration engine everything is built on |
| π· Cilium | eBPF-powered networking and per-session egress control |
| π€ agent-sandbox | Kubernetes-native agent sandboxing primitives |
| π CNCF | Fostering the open-source cloud native ecosystem |