Katakate/k7
Your own self-hosted infra for lightweight VM sandboxes to safely execute untrusted code. CLI, API, Python SDK. ⭐ Star it if you like it! ⭐
k7 – Self‑hosted Secure VM Sandboxes for AI Compute
What ?
- k7 is an open‑source platform that lets you run untrusted code inside lightweight virtual‑machine sandboxes that are managed by Kubernetes. It is aimed at AI agents and other workloads that need to execute arbitrary code safely and at scale.
How ?
- Orchestration – Uses K3s (a production‑ready Kubernetes distribution) to schedule sandbox pods.
- Isolation back‑ends – Four options:
- kfd – Kata + Firecracker with a devmapper thin‑pool (fast boot, minimal attack surface).
- kql – Kata + QEMU backed by Longhorn PVCs (persistent, snapshot‑able disks).
- k7d – Katakate’s own microVM daemon built on KVM, offering warm copy‑on‑write forks of both disk and memory in ~5 ms.
- k7d‑fc – k7d combined with the Firecracker jailer.
- Features – Docker inside the VM, warm‑fork, pause/resume, snapshot/restore, multi‑node clusters, optional Cilium + Hubble networking policies, and a REST API.
- Clients – A Debian/Ubuntu
aptpackage provides a CLI (k7), an automatically deployed API service, and a Python SDK (k7-sdk).
Why ?
- Security – Each sandbox runs in its own VM, eliminating Docker‑in‑Docker risks and providing strong isolation for untrusted code.
- Scalability – Designed for high‑throughput AI‑agent workloads; warm forks let you clone a running sandbox in milliseconds, enabling massive parallelism.
- Flexibility – Choose the backend that matches your hardware and persistence needs (ephemeral Firecracker, persistent Longhorn, or the custom k7d runtime).
- Open source – Apache‑2.0 licence, with community support via GitHub, docs, and a mailing address.
Who ?
- AI‑agent developers who need to run user‑generated code safely.
- Serverless platform builders wanting a self‑hosted alternative to AWS Fargate.
- CI/CD teams seeking hardened runners without Docker‑in‑Docker.
- Blockchain / AI dApp teams needing an execution layer for on‑chain code.
Quick start snapshot
- Install the CLI on a Ubuntu node:
sudo add-apt-repository ppa:katakate.org/k7 && sudo apt update && sudo apt install k7. - Provision the cluster (choose back‑ends):
k7 install --backend kfd,kql,k7d --api-mode development. - Create a sandbox with a simple
k7.yamland run:k7 create. - Interact via CLI (
k7 exec,k7 fork,k7 snapshot) or the Python SDK.
Maturity & limits
- Currently beta and under security review – not recommended for highly sensitive production data.
k7dbackend works only on amd64/x86_64; other back‑ends support arm64.- Requires hardware virtualization (KVM) and, for the
kfdbackend, a spare raw disk.
All details are taken directly from the repository’s README.
Related
- Project
- Project
- Dispatch
- Project
- Project