kern: fast, rootless container runtime and sandbox with MCP, no daemon and full NVIDIA GPU support. Runs untrusted code and AI agent tool calls under kernel-enforced isolation.
A real, kernel-enforced container in a few milliseconds, out of one static binary with no daemon.
MCP support for Claude Code, Cursor, Claude Desktop and LM Studio, through Kern Sandbox.
0 RAM at rest · no daemon, no socket, nothing to start · one static binary
curl -fsSL https://raw.githubusercontent.com/getkern/kern/main/install.sh | shirm https://raw.githubusercontent.com/getkern/kern/main/install.ps1 | iexThen kern doctor. Each system in detail: docs/INSTALL.md.
A shell in a real image:
kern run -it alpine shA web server, then open http://localhost:8088:
kern run -d --name hello -p 8088:80 nginx:alpineCode you don't trust, locked down:
kern run --rm --security-profile untrusted --network none alpine echo hiWhat is running:
kern ps--security-profile untrusted is the seccomp allowlist, --cap-drop ALL and --read-only in one
flag; --network none leaves the box loopback only. Your compose file: below.
examples/ holds 10 examples, one per thing kern does.
kern sandbox run 'print(6 * 7)'No network, a read-only root, every capability dropped: the posture the SDKs give an agent's code. From Python:
pip install -U kern-sandboximport kern_sandbox as kern
print(kern.run_code("print(6 * 7)").stdout) # 42Node, a session that keeps state, GPUs and MCP: below.
A rootless container runtime in one static binary, with no daemon. The same binary is the sandbox an agent's code runs in, called from Python, Node or any MCP client. kern calls a container a box.
- Containers: its own container runtime, for any OCI image:
kern run --rm alpine echo hi. - A sandbox for code your AI agent or LLM wrote. It runs where it can't reach your files unless you hand them over, with no network unless you ask.
- Your
docker-compose.yml, unchanged, and thedockerCLI, Testcontainers and VS Code throughkern compat docker, beside Docker or without it. - Every service by name:
compose upprintshttp://<service>.<project>.localhost. - No daemon, and root is never required. Six namespaces, a read-only or overlay root, a seccomp allowlist by default, cgroup v2 limits.
- Full NVIDIA GPU support:
--gpus all,--gpus 2,--gpus device=0,1, and compose'sdeploy.resources.reservations.devices, on Linux and WSL2. - Full macOS support: containers, compose, sandboxes, the Python and Node SDKs and
kern-mcprun on a Mac, in a small Linux VM the installer sets up. A box reaches the Mac athost.kern.internal, and through it the Mac's own GPU: a model server on macOS (MLX, Ollama) that a sandbox calls. - The tools you expect:
ps,logs,exec,stats,inspect,top,doctor.
In a terminal:
python3 -m venv .venv && . .venv/bin/activatepip install -U kern-sandboxThen in a Python file:
import kern_sandbox as kern
r = kern.run_code("print(sum(range(100)))")
print(r.stdout, r.fault) # 4950 NoneYour code runs in a container of its own, for one call or for a whole session, and a timeout or an
out-of-memory comes back as a typed fault. On Linux, pip brings kern with it, and so does
npm install kern-sandbox for Node.
On a GPU. gpus="all" (or "2", or "device=0,1") hands the sandbox NVIDIA cards, with the
host's driver:
r = kern.run_code(
"import ctypes; cuda = ctypes.CDLL('libcuda.so.1'); n = ctypes.c_int()\n"
"cuda.cuInit(0); cuda.cuDeviceGetCount(ctypes.byref(n)); print(n.value)",
gpus="all",
)
print(r.stdout) # 2, on a host with two NVIDIA cardsThe same from a terminal:
kern box --rm --gpus all --image nvidia/cuda:12.9.0-base-ubuntu24.04 -- nvidia-smi -LThese three and three more, ready to copy: the Python SDK, the same for Node.
MCP server for Claude Code, Cursor, Claude Desktop and LM Studio. The same block goes in
claude_desktop_config.json, in Cursor's or LM Studio's mcp.json, or in .mcp.json at your
project root for Claude Code:
{
"mcpServers": {
"kern": { "command": "uvx", "args": ["--from", "kern-sandbox", "kern-mcp"] }
}
}Every option: docs/MCP.md.
# compose.yaml
services:
web:
image: nginx:alpine
ports: ["8080:80"]
cache:
image: redis:7-alpinekern compose up -d # in the folder of the file
kern compose ps # what runs, and what each service publishes
kern compose downEach service gets its own network namespace and they reach each other by name. docs/DOCKER-COMPAT.md
one isolated /bin/true |
kern is |
|---|---|
one container, against docker run --rm |
80x faster |
200 at once, against docker run --rm |
130x faster |
one container, against rootless runc |
3.6x faster |
| kern | Docker | Podman | |
|---|---|---|---|
| Daemon | no | yes (dockerd + containerd) |
no |
| Resident memory, nothing running | 0 | 154 to 160 MB | 0 |
| Root required | never | opt-in to avoid it | never |
Same machine, same workload, same day, rounded down, with the image already local. A first run
includes the registry pull, which dominates: about 11 s for alpine:3.19 on this link against 3.6 ms
to start the box. The method and every runtime: BENCHMARKS.md; on your machine:
kern bench --image alpine:3.19.
Namespaces, a pivot_root, dangerous capabilities dropped before exec, an always-on seccomp
allowlist that keeps kern's 37 escape syscalls denied, cgroup v2 limits and a deny-by-default
/dev. Where a boundary is cooperative rather than kernel-enforced, SECURITY.md says
so and names the bypass.
docs/CVE-POSTURE.md runs 25 published container-runtime escapes against this
tree, one at a time, and pentest/ asserts the boundaries against the kernel.
Report a vulnerability privately via GitHub Security Advisories or hello@getkern.dev.
In development: a VM tier and kern desktop, a desktop app for kern. Under consideration: a desktop for computer use, kern in a Kubernetes pod, snapshots. Details: ROADMAP.md.
| Document | What is in it |
|---|---|
| docs/INSTALL.md · docs/FAQ.md | installing, and the questions people ask |
| docs/THREAT_MODEL.md · docs/CVE-POSTURE.md | the threat model, and every published container-runtime escape reproduced against this tree |
| docs/CONFIG.md · docs/EGRESS.md | the kern.toml schema, and egress |
| CHANGELOG.md | what changed in each release |
Issues and pull requests are welcome. CONTRIBUTING.md has the workflow and the gates; contributions are covered by the CLA.
Alessandro Polito, @realexhub.
Apache-2.0. See LICENSE and TRADEMARK.md.
