Skip to content
getkernPublic
kern

CI License: Apache-2.0 Release PyPI npm Runs on

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.

Two windows. Container: kern box dev --image alpine -it -- sh; kern compose up -d, for your compose.yaml; kern ps. Sandbox: import kern_sandbox as kern; r = kern.run_code("print(6 * 7)"); print(r.stdout) prints 42. kern top, recorded live on one machine: the Boxes tab with a GPU box, a dev box, a worker and a compose stack (app and postgres, healthy); the Sandboxes tab with SDK calls running and finishing, ok, exit codes and runs on the GPU; the Logs tab with every box's output in one stream.

0 RAM at rest · no daemon, no socket, nothing to start · one static binary

Install and quickstart

Linux, x86_64 or aarch64 macOS, in a Linux VM

curl -fsSL https://raw.githubusercontent.com/getkern/kern/main/install.sh | sh

Windows, through WSL2

irm https://raw.githubusercontent.com/getkern/kern/main/install.ps1 | iex

Then kern doctor. Each system in detail: docs/INSTALL.md.

A container

A shell in a real image:

kern run -it alpine sh

A web server, then open http://localhost:8088:

kern run -d --name hello -p 8088:80 nginx:alpine

Code you don't trust, locked down:

kern run --rm --security-profile untrusted --network none alpine echo hi

What 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.

A sandbox

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-sandbox
import kern_sandbox as kern

print(kern.run_code("print(6 * 7)").stdout)   # 42

Node, a session that keeps state, GPUs and MCP: below.

What kern is

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 the docker CLI, Testcontainers and VS Code through kern compat docker, beside Docker or without it.
  • Every service by name: compose up prints http://<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's deploy.resources.reservations.devices, on Linux and WSL2.
  • Full macOS support: containers, compose, sandboxes, the Python and Node SDKs and kern-mcp run on a Mac, in a small Linux VM the installer sets up. A box reaches the Mac at host.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.

Kern Sandbox: run an agent's code from Python or Node

In a terminal:

python3 -m venv .venv && . .venv/bin/activate
pip install -U kern-sandbox

Then in a Python file:

import kern_sandbox as kern

r = kern.run_code("print(sum(range(100)))")
print(r.stdout, r.fault)   # 4950  None

Your 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 cards

The same from a terminal:

kern box --rm --gpus all --image nvidia/cuda:12.9.0-base-ubuntu24.04 -- nvidia-smi -L

Three windows. files.py: a Sandbox writes in.csv, runs a job, reads out.txt back. state.py: a kernel keeps x = 40 between calls and prints x + 2. package.py: a Sandbox with setup pip install numpy imports numpy.

These 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.

Run a whole stack: your docker-compose.yml, unchanged

# compose.yaml
services:
  web:
    image: nginx:alpine
    ports: ["8080:80"]
  cache:
    image: redis:7-alpine
kern compose up -d      # in the folder of the file
kern compose ps         # what runs, and what each service publishes
kern compose down

Each service gets its own network namespace and they reach each other by name. docs/DOCKER-COMPAT.md

Speed and footprint

Terminal: 'kern box app --image alpine -- echo hello from a real container' prints the greeting, then reports that kern is 80x faster than docker run. A real OCI image, rootless, a static binary, no daemon, measured on x86 on 2026-09-20 with the image already pulled, and you should measure your own.

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.

Security

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.

Roadmap

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.

Documentation

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

Contributing

Issues and pull requests are welcome. CONTRIBUTING.md has the workflow and the gates; contributions are covered by the CLA.

Maintainer

Alessandro Polito, @realexhub.

License

Apache-2.0. See LICENSE and TRADEMARK.md.