capsule

A Linux runtime, without the daemon

Runs nothing unless it is sealed, trusted and allowed.

A capsule is a plain directory: a manifest, a root filesystem and a signature over both. The host checks all three before anything starts, then confines the program in a kernel sandbox.

Version 0.16.0 · source available (FSL) · one static binary

$ capsule run vault

capsule: refusing to run: has 0 of 2 required approvals

# alice and bob each sign their approval

$ capsule run vault

opened

$ echo x >> vault/rootfs/etc/motd

$ capsule run vault

capsule: refusing to run: rootfs was changed after sealing

The messages are capsule's own. Pick a situation above.

A capsule moves through three checks, sealed, trusted and allowed, and then runs in a kernel sandbox. A second capsule, with one byte changed, is stopped at the first check: refusing to run, rootfs was changed after sealing.

What it leaves out

If nothing is running, nothing of capsule is running. Everything it keeps is a file you can read.

daemoncapsule run is the parent process of the program it starts. Kill it and the capsule is gone.
imagesNo layers and no image format. A capsule is a directory you can open, diff and copy.
registryReleases live wherever you already keep files: a folder, a bucket, Vault or Artifactory.

What it does

From one program on one host to a fleet that places and heals itself, with the same three checks in front of every start.

Conditions sealed in

Approvals from named signers, time windows, time locks, host lists and run counts are part of what is signed. Nobody can relax them afterwards.

A record that cannot be quietly edited

Every run and every refusal goes into the host's own signed, chained log. Other hosts can witness it.

Private networking by name

Capsules reach each other over WireGuard tunnels, only on ports both manifests declare. Key exchange is hybrid post-quantum, with ML-KEM-1024.

Orders in place of SSH

Operators sign a fixed set of instructions. Hosts fetch, check and obey them on a timer, and answer with sealed receipts.

Orchestration without a scheduler

One signed document says what should run. Every host works out the same placement from a public random beacon and takes over by lease.

Without root

Capsules run in a user namespace. A small helper adds what only root can do, to members of one group, as far as the operator allows.

Three hosts run the capsules web, api and db, joined by tunnels, and read the same public random beacon. Host b stops answering and its lease lapses; host c takes the lease and runs api. No scheduler, no control plane, no leader.
A host that stops renewing its lease loses its capsules to the next host of the same draw. With a hot standby and detection set to 100 ms, the change was measured at 99 to 118 ms on the arm64 test machine.
The key of an encrypted capsule sits behind four walls: X25519, ML-KEM-1024, a shared secret and Classic McEliece. A quantum computer breaks the first; if lattices fell too, the last two would still hold and the key would stay wrapped.
An encrypted capsule's key is wrapped for each host that may open it. Levels 7 and 9 add walls that do not rest on the same mathematics as the standard ones. capsule's own cipher is new and has been attacked by nobody but its author, which is why it is only ever a second layer.

Try to get one past it

A capsule and a host, here in the page. Seal the capsule, then change a file, loosen its limits, sign it with another key, or run it short of an approval. The checks run in capsule's order and the messages are capsule's own.

The capsule

A directory: a manifest, a root filesystem, and a seal over both.

The host

    The hashing is real (SHA-256, in your browser). Signatures are stood in for by the name of the key, and an approval by a button; in capsule each is an Ed25519 and an ML-DSA-87 signature over the seal.

    Try it before you install it

    Three parts of capsule run in your browser as they are, not as pictures of themselves.

    The sandbox costs nothing you can measure

    With the latency profile a program gets dedicated cores, locked memory, huge pages and its own network card. Worst-case delay over 120 seconds, on a bare-metal Xeon E3-1245 v5 with every other core kept busy:

    Where the program ranBusy pollingWake-up
    Directly on the host, isolated core23 µs20 µs
    In a capsule, latency profile20 µs14 µs
    On the host, shared core11,686 µs1,930 µs
    In a capsule, shared cores8,001 µs2,376 µs

    Measured with oslat and cyclictest; test/bench-latency.sh repeats it on your hardware. DPDK also runs in a capsule, with the kernel out of the network path. One machine and one network card so far, and nothing yet measured across a wire: the release notes list every limit.

    Where it runs

    Every test suite passes on each of these before a release, as root and without root. Alpine, which has no systemd, runs capsules as root with fewer features.

    sudo apt-get install -y uidmap wireguard-tools cryptsetup-bin e2fsprogs nftables curl

    Every suite passes, as root and without root, on x86-64; 25.04 also on arm64.

    x86-64, and arm64 on Ubuntu. Kernel 5.11 or newer with cgroup v2. What each distribution needs.

    Five minutes to a running capsule

    Download the archive for your machine from the latest release, then:

    # install
    tar xzf capsule-0.16.0-linux-amd64.tar.gz && cd capsule-0.16.0-linux-amd64
    sudo sh dist/install.sh capsule
    
    # a signing key: hosts run only what a key they trust has sealed
    capsule keygen dev
    sudo cp dev.pub /etc/capsule/trust.d/
    
    # a capsule, from any root filesystem
    curl -LO https://dl-cdn.alpinelinux.org/alpine/v3.20/releases/x86_64/alpine-minirootfs-3.20.3-x86_64.tar.gz
    capsule init -rootfs alpine-minirootfs-3.20.3-x86_64.tar.gz hello
    
    # seal it, and run it
    capsule seal -key dev.key hello
    sudo capsule run hello

    Go further

    The wiki is the short way in. The guide walks from the first run to a fleet.