# Sandbox tiers

This page is the detail behind [isolation tiers](https://docs.hermitbox.dev/v0.3.2/concepts/isolation.md): what each tier runs,
what it needs from the host, what it guarantees and how fast it is. Read it to choose a tier, to
explain one, or to check a number before you quote it. Every measurement states its own runner,
path and conditions. Tables from different runners or paths sit side by side, but their numbers
are not directly comparable.

Hermitbox runs sandboxes on five isolation tiers, from rootless processes to KVM virtual machines.
A request that names a tier gets it, or a refusal that says what the host is missing.

| Tier | Runs | Needs |
| --- | --- | --- |
| `process` | Native commands as your user | Linux with Landlock ABI 3 (6.2 or later) |
| `wasm` | agentOS registry packages | `x86_64` |
| `container` | Images | Docker or Podman |
| `gvisor` | Images, under gVisor | Docker with gVisor's `runsc` |
| `vm` | amd64 images with their own kernel | x86_64 with KVM |

## How a tier is chosen

A node with `runtime = "auto"` serves every backend its measured host capabilities permit.
Container, VM, process and Wasm workloads can coexist under one capacity and reservation ledger.
Each workload keeps its chosen tier for its lifetime and reports that tier's guarantees.
A named tier that is unavailable is refused, never substituted.

When a request names no tier, control picks among healthy nodes that meet `require` and accept the
supplied source. It tries container, then VM, then gVisor, then process, then Wasm. Images
need containers or VMs, image-free requests use process or Wasm, and package requests need Wasm.
Snapshots and templates keep the tier they were saved with.

The [VM tier](https://docs.hermitbox.dev/v0.3.2/guides/virtual-machines.md) needs working KVM, ordinary-user monitor confinement
and the signed installation's immutable bundle descriptor. A `hermitboxd` running as root serves
it through its separate VM worker. Its measurements are [below](#vm-tier-measurements).

`HERMITBOX_DEFAULT_ISOLATION=process` fixes one tier; a comma-separated list changes the priority.
Local installations keep this preference across user-manager restarts and upgrades.

The image and local installations use auto mode by default. Without an engine, the usual first
choice is **process**, with Wasm available alongside it. Set `HERMITBOX_RUNTIME` to `container`,
`process` or `wasm` to serve only that backend. Local installations save the selected runtime for
restarts and upgrades. Both doctors list the enabled tiers, and the reason each other tier is off.

Each workload records its chosen tier at creation and keeps it across restarts. A missing
record can be rebuilt from its runtime label. An unreadable record stays on disk, and
the node reports it for repair.

## Capabilities

What each tier runs, how it separates a sandbox and what survives a sleep. "Process, namespaced"
is the process tier's stronger mode, where the host allows it
([process isolation](https://docs.hermitbox.dev/v0.3.2/reference/process-tier.md#two-modes)).

| Capability | Container | gVisor | Process | Process, namespaced | wasm | vm |
| --- | --- | --- | --- | --- | --- | --- |
| Arbitrary image | Yes | Yes | No | No | No; explicit 422 image problem | `linux/amd64` images, pulled without a daemon |
| Native Linux binaries | Image architecture | Image architecture, on gVisor's kernel | Host architecture and policy | Host architecture and policy | No; compatible WASM software | The image's, on the guest kernel (x86_64) |
| Python | Install in image | Install in image | Bundled CPython | Bundled CPython | Embedded Pyodide | Install in image |
| Node | Install in image | Install in image | Bundled Node | Bundled Node | Embedded V8 compatibility runtime | Install in image |
| Shell | Static agent fallback | Static agent fallback | Static agent shell | Static agent shell | Verified agentOS coreutils shell | The image's shell |
| Isolation | Shared host kernel, namespaces and cgroups | gVisor's user-space kernel inside the container's namespaces and cgroups | Landlock, seccomp, process groups; dedicated UIDs when root; shared host network, policed in the kernel where `kernel-network-policy` is on, otherwise mutually trusted Internet workloads | The same Landlock, seccomp and limits inside its own user, mount, PID and IPC namespaces, a private /tmp, and its own empty network for network none; otherwise the host's network, policed as the plain mode's | Virtual kernel, WebAssembly and V8; shared unprivileged sidecar | Its own kernel on KVM; Firecracker monitor under Landlock and seccomp as an ordinary user; own network stack or none |
| Kernel per sandbox | No | gVisor's own kernel per sandbox; not a guest kernel | No | No | No native kernel; a virtual kernel per VM | Yes, Linux 6.18.56 in each guest |
| CPU enforcement | Per-sandbox cgroup quota and weight | The container's cgroup quota and weight | Where `hermitboxd`'s cgroup is delegated, the sandbox's own cgroup quota (`cpu-limit`, [process-tier.md](https://docs.hermitbox.dev/v0.3.2/reference/process-tier.md#limits)); elsewhere admission reservation and best-effort nice, a ceiling refused; weights refused | As the plain process mode | Admission reservation; hard CPU limits/weights refused | Whole vCPUs, the guest's size; fractions and weights refused |
| Sleep retains files | Yes | Yes | Yes | Yes | SQLite root and explicit persistent data mount | Yes, its ext4 disk |
| Egress policy | Bridge firewall (`host-firewall` with root's firewall loaded); hostname egress through host gateways | The container's bridge firewall; hostname egress refused | Where `kernel-network-policy` is on (root, the server preset's unit included, or CAP_BPF and CAP_NET_ADMIN with a delegated cgroup): per-sandbox cgroup programs give `host-firewall`, hostname egress, address rules and, from other machines, only the published ports ([bpf.md](https://docs.hermitbox.dev/v0.3.2/reference/bpf.md)); elsewhere only `network: none` | As the plain process mode, the same programs on its cgroup | `network: none`; hostname egress refused | Guest firewall and host-owned gateways ([vm.md](https://docs.hermitbox.dev/v0.3.2/guides/virtual-machines.md)) |
| Application ingress | TCP/UDP according to host policy | TCP/UDP according to host policy; no hostname egress policy | Host TCP according to policy | Host TCP according to policy; none with network none, whose agent answers on listeners the node passes in | HTTP over TCP; no UDP, raw TCP, TLS passthrough or app WebSockets | Declared TCP through host-owned relays; UDP refused |
| Sleep retains processes and terminals | Suspended container on a rootful engine with memory limits; otherwise it stops | Suspended sandbox on a rootful engine with memory limits; otherwise it stops | Its cgroup suspended where it has one, else a suspended process group | As the plain process mode | No; VM is disposed and recreated | As an ordinary user, yes: the guest's memory is written beside its disk and restored on a host of the same class; otherwise the guest stops and boots again |

agentOS 0.4.7 has no per-VM suspend operation in its published client. Suspending its shared
sidecar would also suspend unrelated sandboxes, so the Wasm tier cannot keep processes through a
sleep. The additive `memory-sleep` guarantee is false on this tier; data sleep still works. The
collector records that unsupported alternative with n=0, and measures disposal plus recreation,
with filesystem validation, instead.

## Policy and convenience tools

- **Hostname egress.** Allow and deny lists work on container nodes that announce
  `egress-hostnames` after root firewall installation. Each such sandbox has a dedicated bridge
  and HTTP/TLS gateways, and no proxy setting inside the sandbox can bypass the firewall.
- **Egress on other tiers.** An ordinary-user node whose only tier is `vm` announces
  `egress-hostnames` too, with guest rules and host-owned gateways ([vm.md](https://docs.hermitbox.dev/v0.3.2/guides/virtual-machines.md#as-an-ordinary-user)).
  A process node announces it, with `egress-addresses`, where its kernel network policy is on
  ([bpf.md](https://docs.hermitbox.dev/v0.3.2/reference/bpf.md)). Elsewhere, process and Wasm return an explicit refusal.
- **No network.** `network:none` is still the network boundary on every tier. The default
  Internet network stays compatible with old nodes.
- **Workdir and user.** Workdir uses the `workload-options` feature; user selection is restricted
  to the operator container user.
- **Metrics.** Metrics use cached tier counters and keep null where a value is unavailable.
- **Git and shells.** Git needs an image or userland installation on native tiers. The verified
  optional Wasm Git package is staged with the distribution and loaded only on request. Stateful
  shells use pipes on every tier.

These policy fields are refused when the destination no longer announces the feature, including on
a wake whose specification is unchanged. They are never silently dropped.

## Rootless engine measurements

Measured on an x86_64 Ubuntu 24.04 hosted runner. Podman is the pinned Ubuntu
`4.9.3+ds1-1ubuntu0.2` package, with vfs storage and no delegated controllers. Each fresh
workload reserves 256 MiB for admission and explicitly accepts missing memory enforcement. CPU,
PID and memory-sleep limits are off.

The same run checks nonzero identity, a read-only root, zero kernel capabilities, PID and network
separation, and HTTP ingress. It also checks snapshot and fork retention, stop and wake, and
bounded cancellation of an exec tree. A separate private-network case checks published ingress,
no default route and denied external egress, after an internet-mode canary first shows the target
is reachable.

These are **direct node-manager measurements**. They include neither the public API nor the
edge, and do not replace the public-edge cohorts and budgets below. All 30 serial samples
use a locally available image and a new workload identity. Create includes ensure and start.
Exec runs `true`, after the service's data file is written outside the exec timer. Network is one
HTTP request through the engine's published loopback port, returning that file. Image pulling,
strict deletion and installer startup are outside these timers. Percentiles use nearest rank.
A failed collection keeps its partial sample count and cannot report completion.

| Engine and host context | Completed samples | Create ms p50 / p90 | Exec ms p50 / p90 | HTTP round trip ms p50 / p90 |
| --- | ---: | ---: | ---: | ---: |
| Rootless Podman, ordinary runner user | 30 | 2247.29 / 2472.42 | 75.68 / 265.73 | 3.07 / 3.20 |
| Standard rootless Docker 29.9.2 mapping | 0 | Unavailable | Unavailable | Unavailable |

Standard rootless Docker can't let the sandbox's nonzero user write daemon-owned data. Default and
host namespaces deny the write, keep-id is unsupported, the engine has no bind ID-map option, and
a kernel ID-mapped bind does not attach. The node refuses `data-owner-mapping` before any data or
compute, while other tiers stay available. An engine whose map gives the workload the data owner's
identity turns it on: Podman keep-id, or a rootless daemon mapped that way.

On rootless Docker, `network: "none"` uses no bridge. The container gets Docker's `none` network
(loopback only). The node reaches its declared ports through the engine's exec attachment, by
the protected static agent injected at create. `network-policy` is announced only where that
agent is installed; elsewhere `network: "none"` is refused by name before data or compute.

The transport is tested on hosted standard rootless Docker, without sandbox data. The test covers:

- TCP with half-close, and UDP;
- an undeclared port refused;
- no address or default route;
- host loopback and a neighbour unreachable;
- helper retirement, and owner adoption after a restart.

On standard rootless Docker, every sandbox is still refused at `data-owner-mapping` first, so no
sandbox there reaches this path yet. Podman uses native published ingress for internal bridges.

Rootless memory and CPU guarantees need both engine support and an enforced limit observed on
that sandbox copy. Nodes announcing `observed-resource-limits` include the copy's guarantees
in heartbeats, and the public API uses the report matching its node and placement epoch. Without
an observation, these guarantees stay off. So a controller turned on later leaves an older,
unlimited copy's limits off until a configured replacement is observed. Placement still uses
the node's available capabilities, and legacy and rootful reporting keep their existing contract.

## gVisor and namespaced process

The `gvisor` tier is the container backend with the engine's gVisor `runsc` runtime (release
20261109.0, Apache-2.0, deploy/gvisor.json). It uses the same images, limits, ports, bridge and
firewall, and is served beside containers wherever the engine lists `runsc`. A request naming
`container` is never run by runsc, and one naming `gvisor` never by runc. Each sandbox runs on
gVisor's own kernel, not the host's: `uname -r` differs, and `own-kernel` stays a VM's.

The server preset installs the pinned static release agent automatically. An independently
configured gVisor agent must also be a static ELF; a GNU debug build with an image-controlled
loader is refused. The node keeps a digest-named, execute-only copy outside sandbox data, so
Linux and gVisor protect its memory and descriptors before the process becomes visible.

An exec's successful cleanup is authenticated. An exec runs to its own end even when its caller
goes away. One that ends without that authenticated cleanup, or still runs 30 seconds past its
deadline, retires that same sandbox run. A lost engine answer or output stream is reported
without a kill, since the agent inside keeps the deadline. An earlier exec can never retire a
later stop/start generation. Node exec removes the agent's bootstrap variables and keeps ordinary
workload variables. Async work belongs to the agent's process API; a completed node exec keeps no
detached descendants.

Where gVisor can't do what a container does, Hermitbox handles it or refuses it by name:

- The injected agent (`hermitbox-agent exec-deadline`) keeps a node exec's deadline inside the
  sandbox. Only an agent-less workload's exec past its deadline is refused (`exec-timeout`).
- Hostname egress policies are refused: Docker's embedded resolver is unreachable from gVisor's
  network stack.
- Host FUSE devices are never mapped into it.

The syscall-heavy figure below is the systrap platform's cost per system call. runsc already runs
with directfs, the rootfs overlay and systrap's fast path, its documented defaults. Every tool and
interpreter template runs on it: the Python and Node kernels, the browser, the desktop and SSH.
The browser runs with its own sandbox off, and reports it off, as in a default Docker container.

The namespaced process mode is a guarantee within the `process` tier
([process isolation](https://docs.hermitbox.dev/v0.3.2/reference/process-tier.md)). A `process` request gets whichever mode the host gives,
and reports it.

The table below has thirty samples each, nearest-rank p50 / p90 in milliseconds, on one x86_64
Ubuntu 24.04 hosted runner. The host kernel is 7.0.0-1014-aws; gVisor's sandboxes report
4.19.0-gvisor. These are **direct node-manager measurements**, without the public API or the
edge, so they compare with each other, not with the public-API cohorts on this page.

- **Container and gVisor** run alpine 3.22 on the runner's Docker 28.0.4, gVisor through runsc
  release-20261109.0 on its systrap platform. Their exec is a node exec (Docker's).
- **Process** rows run the real agent, and their exec is the agent's own. The namespaced row ran
  on the runner, with the AppArmor profile `hermitbox doctor` printed for its helper. The plain
  row ran inside a default `docker run` of Ubuntu 24.04 as root.
- **Columns.** Create is ensure and start until running. Syscall-heavy is
  `dd if=/dev/zero of=/dev/null bs=1 count=200000`. The stream is 256 KiB of command output back
  through the exec path. The transfer is 16 MiB read from the workload's published port; process
  sandboxes have none with network none.

| Tier or mode | Create | Exec `true` | Syscall-heavy | 256 KiB exec stream | 16 MiB transfer |
| --- | ---: | ---: | ---: | ---: | ---: |
| Container | 124.66 / 129.52 | 28.10 / 51.33 | 217.90 / 279.85 | 27.70 / 68.43 | 8.89 / 9.84 |
| gVisor | 128.38 / 135.60 | 42.39 / 114.04 | 5,762.68 / 5,893.10 | 21.23 / 83.14 | 71.38 / 76.64 |
| Process, plain (default `docker run`) | 21.10 / 21.63 | 4.71 / 4.82 | 65.99 / 66.70 | 18.42 / 19.07 | — |
| Process, namespaced | 15.97 / 16.46 | 5.69 / 5.89 | 70.61 / 71.39 | 19.16 / 19.72 | — |

gVisor's systrap platform makes each system call a trap into its own kernel. The 400,000
one-byte reads and writes cost about 26 times what they cost a container, and the published-port
transfer about 8 times. Start and an exec cost about the same. The namespaced process mode
costs nothing measurable over the plain one at start, and about 1 ms an exec; its system calls are
the host kernel's own.

## Comparison method

`control/bench/tiers.ts one-box|image output-prefix` runs all three tiers from the same release
source and build profile on the same runner. Container and process are the reference cohorts;
Wasm is the added candidate.

Each requested latency and incremental memory cohort has 30 samples. Nearest-rank p50 and
p90 are computed from every successful sample, and partial counts are kept on failure.
Concurrent admission records all 30 attempted waves, capacity refusals included. Only waves that
admit all 50 enter the full-50 latency and memory percentiles.

Cold creation uses a new sandbox identity, no template and a locally available runtime image.
It includes API admission and the running acknowledgement. `true` and `echo hi` use the real agent
through the edge. Cold and 50-way cohorts use an explicit common 256 MiB / 100 CPU-millis unit;
hot and package cohorts use two units, 512 MiB / 200 CPU-millis. These measurement
configurations are not a capacity claim, and they do not replace the product's normal unit
defaults.

A declared 2× CPU admission overcommit lets fifty idle 100-CPU-millis sandboxes fit
the four-core runner; the reports record it. Node memory capacity uses the actual host with its
normal reservation. Fifty idle sandboxes request 12,800 MiB on the observed 16 GiB-class runner.

Enforcement differs between tiers. Container uses cgroups. Process uses a cgroup of its own where
the host delegates one, and native limits and priority otherwise. Wasm uses virtual heap and
process bounds in a shared worker, with no per-VM CPU-rate quota. Equal requests do not mean
identical host enforcement.

Each shell emits a validated readiness marker before its memory sample. The node baseline is
refreshed after each deletion, and its initial fixed overhead is recorded separately.

Memory is proportional resident memory (PSS) from Linux `smaps_rollup`, in bytes, including the
node's process tree and container workload trees. Reports separate fixed node memory from
incremental idle, shell and 50-sandbox memory. The ordinary-image tree includes embedded
services, so its fixed overhead is not a per-VM claim. Shared executable pages count once,
proportionally. Retained allocator pages and host noise stay in the samples, including negative
incremental readings.

Absolute idle and running-shell context PSS are kept too. Wasm disposal can release a prior
shell's heap during the next sample, which makes its paired increment negative; such a delta is
not a negative per-VM footprint. Absolute context PSS includes the fixed node and services and
retained allocator memory, instead of attributing every resident page to the one active VM. The
50-way latency ends when every creation reports running; its memory read and deletion are outside
that latency timer.

Every wave issues all 50 requests, without retry or downsizing. After all responses settle,
`concurrentCapacity` records the requested, confirmed running and refused counts, the elapsed
time, baseline and current context PSS, and the paired PSS delta. It also records each refusal's
code, HTTP status, message and count. All of it is recorded **before deleting any successful
creation**.

A structured SDK `no_room` response produces `capacity_refused`. If any wave is refused, the
tier's final status is `capacity_limited`. That is a successful measurement, and later waves and
tiers still run. Partial waves do not count as full-50 latency successes.

All other creation errors, invalid running results, missing memory readings and failed cleanup
stay fatal. The public API also uses `no_room` for unavailable admission. So a refusal is an
observed admission result. It does not prove that physical RAM alone set the limit, or that the
fitted count is a universal maximum.

After the checkpoint, cleanup deletes every admitted sandbox once, in sequence, outside the
creation timer and memory reading. All fifty creation requests stay concurrent, and cleanup adds
no second fifty-way mutation load. Every delete is attempted and any failure is fatal, without
retry. Raw failures keep the nested SDK phase, status, code and public message as evidence, and
leave out request details, private error text and stacks.

The one-box collector reuses its node across all thirty 50-way batches. Its temporary listener
pool is derived below the host kernel's ephemeral range, so outgoing connections cannot race
listener allocation. The pool has 2,048 ports and keeps the normal ten-minute quarantine. That
allows all 1,500 concurrent-cohort creations plus the scalar cohorts without immediate port reuse.

The ordinary-image collector prepares a fresh context outside each 50-way timer, on all three
tiers. The product's unchanged ten-minute port quarantine and thousand-port pool cannot
immediately reuse ports for 1,500 creations. Image startup and baseline memory sampling are
outside this creation timer, and each sample still creates fifty sandboxes at once. New image
state likewise chooses a thousand-port pool below the kernel's outgoing range. Stored explicit
pools and legacy implicit pools stay stable across restarts.

The ordinary-image comparison supplies an explicit, bounded edge profile: 64 simultaneous
greetings per address, a burst of 128 connections and 64 new connections per second. This
admits the fifty-client experiment without turning off any guard. The default and forced-Wasm
goal cohorts keep the normal edge limits. Raw reports identify the comparison profile.

A container start whose answer times out is inspected once. It counts as started only if Docker
reports the container `Running`; start is never repeated. Other states and errors stay failures.

Snapshots and forks use exactly 100,000,000 bytes of repeated byte 42, validated before capture
and after fork. This compressible fixture measures the same workload on each tier; it is not a
throughput claim for incompressible data. Snapshot timing ends at the API's acknowledgement of
local capture. The background upload to the object store is outside it, so it is not a timing of
remote durability.

Each package installation uses a fresh sandbox prepared outside its timer. Native pip installs
`peppercorn==0.6` into a new target and verifies its import path, version and behavior. The
Wasm micropip shim lacks `--target`, so it installs into a fresh VM after asserting the package
is absent. Creation, that assertion, import verification and deletion are outside the install
timer. The sidecar resolves npm's CLI from the operator's host PATH; the image includes that
userland. Npm installs `is-number` at version 7.0.0 with scripts disabled and verifies its
behavior. The collector source records the commands and exact package versions. An unavailable
tool has an explicit n=0 reason, never an invented timing or a passing test.

The no-engine process and Wasm image cohorts use an ordinary `docker run`, without privileged
mode, added capabilities, security options, a Docker socket or host mounts. A container sandbox
needs an engine, so its reference runs on the same runner's host node and is marked as that
different topology. A container tier inside an engine-free image is unavailable.

`control/bench/tiers-default.ts` measures the actual image without a tier override, and a
separate invocation measures the forced Wasm candidate. Both use the product's normal resource
defaults. Each records 30 SDK create-to-hello samples and, separately, 30 compiled
`hermitbox run -- echo hello` samples. It also records the create acknowledgement and first-byte
components. Whole-command timings include waiting for exit, and CLI totals include cleanup.
The 100 ms create-to-output target is assessed separately below; both candidates miss it. These
are fresh sandboxes, without a pre-created VM or warmed command.

### Capacity refusal

One Wasm wave on a single local host shows the refusal path end to end:

| Context / tier | Waves | Requested | Confirmed running | Refused | Baseline PSS MiB | PSS before cleanup MiB | Delta MiB | Refusal |
| --- | ---: | ---: | ---: | ---: | ---: | ---: | ---: | --- |
| Local host / Wasm | 1 | 50 | 31 | 19 | 80.84 | 150.37 | 69.53 | 19 × HTTP 503 `no_room`: "No node can complete this request" |

All 50 responses settled in **128,992.20 ms**. The outcome is `capacity_refused`, the final
report status is `capacity_limited`, cleanup completed and the collector exited **0**. The
31 running sandboxes were still present when memory and refusals were checkpointed. This partial
wave contributes **zero full-50 latency samples**. Its admitted count describes this one
observation; it does not establish a physical memory ceiling or a runner-independent maximum.
This node had no prior workload or retained allocator history, so its PSS is not comparable with
the reused-node CI memory below. Neither set of totals measures memory per VM.

## Container, process and Wasm compared

Every tier completes every requested cohort, including thirty verified pip installs, thirty
verified npm installs and thirty batches of fifty creations.

| Runner | CPU model | Visible cores | RAM bytes | Kernel | Bun |
| --- | --- | ---: | ---: | --- | --- |
| one-box | AMD EPYC 9V74 80-Core Processor | 4 | 16,760,348,672 | 7.0.0-1017-azure | 1.4.4 |
| image | AMD EPYC 7763 64-Core Processor | 4 | 16,760,344,576 | 7.0.0-1017-azure | 1.4.4 |

Each context compares all three tiers one after another on its own single runner. The two
contexts use separate runners, so differences between them are not attributed to the deployment
alone. All six use the same release daemon build. The one-box release image and the ordinary
image contain the same checksum-pinned agentOS 0.4.7 distribution described in
[agentos.md](https://docs.hermitbox.dev/v0.3.2/integrations/agentos.md). Resource requests, enforcement differences, context
resets, port quarantine and the bounded comparison gateway profile are set out above and in each
summary.

### One-box services

All cells are p50 / p90; every requested cohort has n=30.

| Latency (ms) | Container | Process | Wasm |
| --- | ---: | ---: | ---: |
| Cold create to running | 700.59 / 982.53 | 803.10 / 833.25 | 1,922.30 / 1,986.85 |
| Agent true | 1.44 / 1.59 | 1.78 / 1.85 | 434.69 / 446.06 |
| Echo first byte | 1.43 / 1.68 | 1.63 / 1.81 | 421.10 / 429.65 |
| Sleep then wake | 417.39 / 1,000.66 | 887.07 / 992.57 | 994.51 / 1,034.36 |
| Snapshot 100 MB | 665.22 / 1,232.55 | 568.88 / 988.59 | 686.02 / 923.79 |
| Fork 100 MB | 772.08 / 1,730.24 | 941.49 / 955.35 | 1,087.66 / 1,136.90 |
| pip install | 1,494.94 / 1,520.58 | 573.22 / 584.50 | 3,659.82 / 4,041.77 |
| npm install | 2,464.77 / 2,515.95 | 416.03 / 439.78 | 4,971.42 / 5,194.99 |
| 50 concurrent to running | 5,085.35 / 6,110.38 | 2,646.52 / 3,082.58 | 68,308.21 / 85,753.49 |

| Memory (MiB) | Container | Process | Wasm |
| --- | ---: | ---: | ---: |
| Idle context PSS | 18.30 / 18.38 | 18.80 / 18.80 | 334.44 / 368.13 |
| Idle paired PSS delta | 5.21 / 5.25 | 6.19 / 6.20 | -39.60 / -39.28 |
| Running-shell context PSS | 21.14 / 21.24 | 19.29 / 19.29 | 426.45 / 464.48 |
| Running-shell paired PSS delta | 8.07 / 8.11 | 6.68 / 6.69 | 49.90 / 64.04 |
| 50-sandbox context PSS | 52.79 / 52.87 | 54.18 / 54.28 | 679.56 / 683.75 |
| 50-sandbox paired PSS delta | 37.29 / 37.42 | 39.84 / 39.91 | 2.44 / 5.57 |

Fixed context PSS (n=1, MiB): container 11.56, process 10.77, wasm 64.84.

### Ordinary image

All cells are p50 / p90; every requested cohort has n=30.

| Latency (ms) | Container | Process | Wasm |
| --- | ---: | ---: | ---: |
| Cold create to running | 629.19 / 653.16 | 777.98 / 786.75 | 1,791.04 / 1,817.37 |
| Agent true | 1.96 / 2.06 | 2.70 / 2.84 | 466.69 / 472.86 |
| Echo first byte | 1.90 / 2.38 | 2.55 / 2.95 | 452.86 / 462.80 |
| Sleep then wake | 600.61 / 1,026.34 | 819.61 / 1,025.14 | 980.40 / 1,029.71 |
| Snapshot 100 MB | 388.85 / 440.72 | 241.74 / 248.19 | 461.73 / 471.22 |
| Fork 100 MB | 738.72 / 771.98 | 961.51 / 985.50 | 1,000.84 / 1,044.90 |
| pip install | 2,055.52 / 2,172.08 | 564.06 / 694.86 | 4,969.76 / 5,127.07 |
| npm install | 3,261.74 / 3,316.12 | 569.64 / 584.98 | 6,565.43 / 6,825.03 |
| 50 concurrent to running | 7,116.82 / 7,146.71 | 1,915.59 / 2,905.34 | 68,769.87 / 70,949.82 |

| Memory (MiB) | Container | Process | Wasm |
| --- | ---: | ---: | ---: |
| Idle context PSS | 20.14 / 20.16 | 333.51 / 339.76 | 654.07 / 694.60 |
| Idle paired PSS delta | 5.20 / 5.21 | 6.80 / 9.36 | -40.11 / -37.91 |
| Running-shell context PSS | 22.99 / 23.07 | 334.08 / 339.83 | 742.80 / 798.99 |
| Running-shell paired PSS delta | 8.03 / 8.13 | 7.35 / 8.95 | 50.93 / 68.91 |
| 50-sandbox context PSS | 53.34 / 53.40 | 429.88 / 433.31 | 548.85 / 555.47 |
| 50-sandbox paired PSS delta | 39.92 / 39.98 | 118.86 / 123.59 | 182.72 / 195.10 |

Fixed context PSS (n=1, MiB): container 13.43, process 307.57, wasm 365.40.

## VM tier measurements

`deploy/vm-installed-measurements.ts` collects these on a hosted `ubuntu-24.04` runner with KVM,
as the signed ordinary-user installation's own user, after that installation's VM acceptance
passes. Each cohort uses the public API and the real agent, one unit, the default network and
n=30. The image is the first pinned one (Alpine 3.24.4), already cached with the VM bundle. The
100 MB snapshot and fork use the same fixture as the other tiers. Memory is the PSS of the
installation's whole supervisor tree, VM and packet helpers included, with the increment over a
baseline sampled before each create. No start failed.

| Measurement, installed ordinary-user VM | p50 / p90 |
| --- | --- |
| Cold create to running (ms) | 1,353.56 / 2,128.79 |
| Create to first output (ms) | 1,616.82 / 2,395.14 |
| Agent `true` (ms) | 44.28 / 47.89 |
| Wake from sleep (ms) | 1,507.54 / 1,594.81 |
| Snapshot 100 MB (ms) | 1,656.97 / 1,690.15 |
| Fork 100 MB (ms) | 2,458.16 / 2,529.85 |
| Idle context PSS (MiB) | 554.45 / 555.79 |
| Idle paired PSS delta (MiB) | 131.61 / 131.91 |

The context PSS is the installation's whole supervisor tree: control, edge, node, every VM and
packet helper. Before each create it was 423.41 / 424.75 MiB. These figures come from another
runner, installation and release build than the tables above, so they sit beside them rather
than in them. On another runner, cold create to running measured 2,363.52 / 2,388.05 ms and
create to first output 2,618.67 / 2,653.04 ms. Every other cohort was within 2 % of the rows
above. Cold create varies between runners by about a second at p50.

### Memory sleep and wake

Measured on a hosted `ubuntu-24.04` runner with KVM, as the runner's ordinary user, by
`memory_acceptance` through the runtime a sandbox uses. The guest is Alpine with 256 MiB and one
vCPU, and its entrypoint keeps a counter going. It was slept and woken thirty times in a row.

- **A sleep** is the guest's signed suspension of its workload, a flush and hold of its disk, the
  monitor stopping its vCPUs, the full snapshot into the runtime's private state and the monitor's
  retirement.
- **A wake** is the restore, the guest's signed resume (clock, host entropy and gateway ports) and
  its agent's answer through a new forwarder.

| Measurement, ordinary-user VM, n=30 | p50 / p90 |
| --- | --- |
| Sleep with memory (ms) | 395.04 / 464.10 |
| Wake with memory (ms) | 220.05 / 235.62 |

In every sample the same process ran on after the wake, with its counter past where it was and
its `/tmp` file kept. After the last, the guest's wall clock was within two seconds of the host's.

Two wakes booted the disk instead: one whose state file had been corrupted, and one whose image
recorded another host class. Each kept what was written before the sleep, and the memory was
gone. A stop while asleep ended the memory and reported a SIGKILL's exit. Measured through the
node API, a wake splits into three parts. The restore takes 15 to 17 ms, the guest's resume 34 to
110 ms and the agent's first answer 126 to 132 ms.

Three forks with memory of one sleeping source were made in 1.63 to 2.18 ms (a copy of the disk
and links to the memory). Two woke in 193.07 and 201.89 ms. The two forks and the source then
each ran the source's process under its own hostname. The first 32 bytes each read from
`/dev/urandom` after its wake differed between all three, and each fork refused the source's
agent token.

The source's workload appended 16 random bytes a line to its disk every 10 ms. Another host class
refused the third fork's restore, so it booted the flushed disk, with all 84 lines the memory
held. The first line each restored copy drew after its restore differed between all three. The
guest kernel has no VM generation ID driver (`0` in each guest, as its configuration says). So
the different bytes come from the resume hook's host entropy and forced reseed.

A guest with a network, public and under a hostname policy, passed the production network probe:
DNS, the allowed request and every refusal. It passed after a wake with memory, in its fork with
memory, and in the source woken after the fork.

A minimal guest fixture, which is not a sandbox, boots from launch to a validated filesystem and
vsock report in p50 717.035 ms and p90 725.265 ms. That is over thirty boots with one vCPU and
256 MiB. It is not a create, agent or memory figure for this table.

## The process default and the 100 ms goal

When no Docker socket is usable, the image defaults to **process**. The ordinary-image comparison
shows why, at p50, process against Wasm:

- cold create: **777.98 ms** against **1,791.04 ms**;
- hot echo first byte: **2.55 ms** against **452.86 ms**;
- fifty creations: **1,915.59 ms** against **68,769.87 ms**;
- idle context PSS: **333.51 MiB** against **654.07 MiB**;
- running-shell context PSS: **334.08 MiB** against **742.80 MiB**.

Wasm wins none of those selection measures. These memory totals include services; the paired
deltas and fixed overhead are reported above. Process also runs native host binaries. Wasm offers
its virtual-kernel boundary and compatible Python/JavaScript software as an explicit option, and
its shared worker remains a shared fault domain. The result does not establish a universal winner
for arbitrary applications or host policies. A Docker host still defaults to container, which
keeps arbitrary-image support.

The separate cohorts below use the ordinary image, the normal **512 MiB / 250 CPU-millis**
resource defaults and normal gateway limits. Process runs with no tier override; Wasm is forced
explicitly, to measure the same hello path. Every command prints exactly `hello` plus a newline,
with zero exit status and no stderr, and cleanup is checked. All cells are p50 / p90
milliseconds, n=30 for every cell.

| Path | Implicit process default | Forced Wasm |
| --- | ---: | ---: |
| SDK create acknowledgement | 983.06 / 987.05 | 2,048.53 / 2,078.72 |
| SDK first echo after create | 7.67 / 8.14 | 907.84 / 921.21 |
| SDK create to first byte | 990.38 / 994.28 | 2,960.64 / 2,983.88 |
| SDK create to completed echo | 990.50 / 994.42 | 2,976.27 / 3,002.76 |
| Compiled CLI to first byte | 968.53 / 984.71 | 2,947.15 / 2,976.99 |
| Compiled CLI total including cleanup | 998.71 / 1,016.82 | 3,000.34 / 3,033.40 |

**The 100 ms goal is missed.** Forced-Wasm SDK create-to-first-byte p50 is **2,960.64 ms**;
compiled `hermitbox run -- echo hello` first-byte p50 is **2,947.15 ms**. The normal process default
is **990.38 ms** through the SDK and **968.53 ms** through the compiled CLI. These measurements
include fresh creation and the API's running acknowledgement.

The observed Wasm components are **2,048.53 ms** to create acknowledgement and **907.84 ms** from
acknowledgement to first echo. For process they are **983.06 ms** and **7.67 ms**. Percentiles of
components do not add exactly to the percentile of their sum.

The pinned sidecar's VM and root initialization, and its first command through its process and
output bridge, are on this measured path. A millisecond VM boot does not describe end-to-end
Hermitbox creation. These component timings locate the cost, without claiming an isolated
profiler attribution. No pre-created sandbox or relaxed product limit is used.

## Paired budget checks

The ordinary-image runner also runs the budget collectors. Every numeric cell below has n=30.
Values are milliseconds at the stated percentile.

| Budget | Percentile | Measured | Required |
| --- | --- | ---: | ---: |
| Public exec | p50 | 46.80 | < 50 |
| Template create | p50 | 181.93 | < 1,000 |
| Suspended wake | p50 | 27.56 | < 1,000 |
| Agent run | p90 | 2.24 | < 20 |
| Agent first byte | p90 | 2.11 | < 10 |
| Agent expose to first 200 | p90 | 5.71 | < 200 |
| Process image run | p90 | 2.82 | < 20 |
| Process image first byte | p90 | 2.93 | < 10 |
| Process image expose to first 200 | p90 | 60.60 | < 200 |
| Process image startup | p90 | 6,475.04 | < 10,000 |

Every budget passes. At p90, the same source's container deployment measures 2.20 ms to run,
2.12 ms to first byte and 7.57 ms to expose and answer 200. The 100 ms create-to-output goal above
is still missed.

## How this is tested

The one-box and ordinary-image CI jobs upload their measurement summaries and raw records, on
failure too. They append every wave's running and refused counts, memory and refusal to their
GitHub job summaries.
