Skip to content
Projects

About

k8e.sh - Open-source agentic AI sandbox matrix.

AI & Machine Learning

How these counts are measured

What you can do

  • ๐Ÿ”’ 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

Measured star growth

in 24h
0
in 7 days
+2
in 15 days
+2
in 1 month
Collecting history

Net star changes over overlapping periods, not daily totals. Missing measurements are left blank. Stars measure attention, not software quality.

README.md

Original
K8E sandbox

Go Version License Stars Release Arch


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. ๐Ÿค–


๐Ÿค– What is K8E?

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.

Sandbox Capabilities

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.


๐Ÿ—๏ธ Architecture

 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.


๐Ÿš€ Quick Start

Step 1 โ€” Install a Sandbox Runtime (recommended: before K8E)

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 runsc at startup and automatically injects the gVisor stanza into its containerd config. Do not run runsc install โ€” K8E manages its own containerd configuration.

Need stronger isolation? Kata Containers and Firecracker are covered in the Sandbox Runtime Setup guide.

Step 2 โ€” Install K8E

curl -sfL https://k8e.sh/install.sh | sh -

Step 3 โ€” Verify the Sandbox

k8e-sandbox-cli status        # -> {"available": true, ...}
k8e-sandbox-cli run 'echo hello from the sandbox'

Step 4 โ€” Connect Your AI Agent

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 vs Other Sandbox Platforms

K8E ๐Ÿš€ E2B Daytona agent-sandbox DIY gVisor/Firecracker
Self-hosted, single binary โœ… <100MB โš ๏ธ Heavy (per-env VM images) โœ… โŒ 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 โš ๏ธ โš ๏ธ manual scaling โŒ
Per-session network policy (eBPF) โœ… Cilium, live-configurable managed (fixed) โš ๏ธ โš ๏ธ NetworkPolicy 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.


๐Ÿค Contributing

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

๐Ÿ›ก๏ธ Security

Report vulnerabilities via GitHub Security Advisories. Do not open public issues for security bugs.


๐Ÿ“„ License

Apache License 2.0 โ€” see LICENSE.


๐Ÿ™ Acknowledgments

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

k8e.sh โ€” Open Source Agentic AI Sandbox Matrix

GitHub Website Docs

If K8E powers your agents, give us a โญ โ€” it means the world to us!

Explore related projects

Loadingโ€ฆ