Usage reference

cell run [flags] -- command [args...]
cell help-json        machine-readable command catalog
cell guide            embedded operator manual (--human for prose)
cell audit            tail the evidence log
cell feedback         report bugs/ideas upstream
cell version --json   version information

Network modes

mode meaning
none (default) isolated network namespace, loopback only. No external route exists at all.
proxy still loopback-only — but the parent accepts connections inside the netns and proxies them with policy + evidence.
host share the host network. Opt-in, unaudited, for when you mean it.

In --net host mode the payload shares the host network wholesale, so name resolution behaves like the host’s: /etc/hosts and /etc/resolv.conf are bound read-only and nsswitch enables dns. In the isolated modes neither file exists — there is no route to any nameserver anyway, so resolution fails fast instead of hanging. A synthetic /etc/hosts with the standard localhost entries exists in every mode.

Flags

Isolation and filesystem

flag default meaning
--bind HOST:INNER[:ro\|rw] — bind a host path into the jail; ro unless specified. Repeatable.
--workdir PATH / working directory inside the jail
--strict-writes off landlock layer: writes only in scratch areas and rw binds
--tmpfs-size SIZE 64m size of the fresh tmpfs the jail root is assembled on

Environment

flag meaning
--env KEY pass one host environment variable through. Repeatable. Everything else is scrubbed.
--env-set KEY=VAL set a variable explicitly

Resources

flag default meaning
--pids N 512 cgroup v2 pids cap (best effort — depends on host delegation)
--mem SIZE none memory cap; sets swap to zero too, because memory.max alone reclaims into swap instead of killing
--no-cgroup — skip resource limits entirely

Egress policy (--net proxy)

flag meaning
--egress-allow HOST exception for a private/loopback address that policy would otherwise deny. Repeatable.
--egress-only HOST restrict egress to the named hosts, everything else denied. Repeatable.
--proxy-port N loopback port the in-jail proxy listener uses (default 8118)

The proxy resolves each destination once, checks policy against the packed IPv4, then dials the literal address — there is no DNS-rebinding window. Private, loopback, link-local and carrier-grade-NAT ranges are denied by default, which makes the proxy useless as an SSRF bridge into host or LAN services.

Credential brokerage (--credential)

The problem: a payload that needs a GitHub token or LLM API key would normally carry it inside the jail — where scoped egress cannot contain it, because the credential is omnipotent on the one host the workflow must allow. Brokerage moves the secret out: the payload speaks plain HTTP through the proxy, and cell injects the credential host-side before upgrading to verified TLS upstream. The secret never exists inside the jail — not in its environment, not on its loopback, nowhere.

cell run --net proxy --egress-only api.anthropic.com \
         --credential "api.anthropic.com:x-api-key=env:ANTHROPIC_KEY" \
         -- python3 agent.py

The grammar is HOST:HEADER=[PREFIX]env:VAR (repeatable). The env var is read once in the parent at spawn; the value never appears in argv, in the jail, or in any audit record — evidence records the host and header name only, and the harness pins the redaction. A static prefix attaches schemes: Bearer env:TOK, Basic env:B64. If the variable is unset the run fails closed with a usage error — it never silently proceeds credential-less.

Properties, all harness- or spike-verified:

  • the payload cannot override the credential — a payload-supplied header of the same name is stripped before injection
  • injection is bound to the policy-checked host; CONNECT to a credentialed host is denied outright (opaque tunneling would bypass injection)
  • keep-alive is force-disabled on injected connections: each request gets a fresh, fully-injected connection. This costs a TLS handshake per request — correctness before performance
  • upstream responses are plaintext inside the jail by design (they are the payload’s own data) — but response-path credential-equivalents (session cookies) are a documented residual channel

git recipe — git smart-HTTP accepts only HTTP Basic, so encode once on the host and inject with the Basic prefix:

export GH_B64=$(printf 'x-access-token:%s' "$(gh auth token)" | base64 -w0)
cell run --net proxy --egress-only github.com \
         --credential "github.com:Authorization=Basic env:GH_B64" \
         --bind ~/proj:/work:rw --workdir /work -- sh -c '
  git config --global url."http://github.com/".insteadOf "https://github.com/"
  git clone https://github.com/you/repo; cd repo; git push'

The insteadOf rewrite makes git speak plain HTTP through the proxy; every request is authenticated host-side. Verified end-to-end: clone of a private repo, commit, push — with zero credential material inside the jail.

LLM recipe — point the SDK’s base URL at plain HTTP on the real host; the injected *_proxy env routes it through the proxy:

ANTHROPIC_BASE_URL=http://api.anthropic.com \
cell run --net proxy --egress-only api.anthropic.com \
         --credential "api.anthropic.com:x-api-key=env:ANTHROPIC_KEY" \
         --env-set ANTHROPIC_BASE_URL=http://api.anthropic.com -- python3 agent.py

Plain-HTTP forward is denied by default

Forward-mode plain HTTP to a public port-80 host with no credential entry is denied with typed evidence (deny-plaintext-forward). Modern hosts answer port 80 with redirects or CDN-edge 404s indistinguishable from a wrong URL — exactly what an operator who misspelled a --credential host debugs for hours. Exemptions: credentialed hosts (injection upgrades), private ranges (intranet http is legitimate), non-80 ports (explicit = deliberate). The deliberate escape for genuinely plain-http public hosts: curl --proxytunnel forces CONNECT, which tunnels port 80 fine.

Reverse-injection: agents that demand https

Some clients validate base URLs — https required for remote hosts, plain http allowed only for loopback (fx does this explicitly; the Ollama-shaped exception). Forward-mode injection cannot serve them: they refuse to speak plain http to a remote host. The reverse-injection listener is the answer — the client points at loopback, which its own rules permit:

cell run --net proxy --egress-only openrouter.ai \
         --reverse-inject "9000=openrouter.ai:Authorization=Bearer env:ORKEY" \
         -- fx ask "..."

with the client configured for base_url: http://127.0.0.1:9000/api/v1 and no auth of its own. The listener accepts origin-form requests, rewrites the Host header to the upstream, injects the credential host-side, and upgrades to verified TLS. Repeatable (one port per upstream). Evidence carries "via":"reverse" so operators can tell which path a credential traveled. Injection never widens egress: the upstream must still satisfy –egress-only when that policy is in use. Verified end-to-end with fx completing real agentic tasks.

Supply-chain installs

cell run --net proxy --egress-only registry.npmjs.org \
         --bind "$PWD:/work:rw" -- sh -c 'cd /work && npm install'

npm serves everything from registry.npmjs.org — one host suffices. Two gotchas, both measured in spikes/supply-chain:

  • npm runs postinstall scripts as nobody when you are root (and inside cell you are root-in-userns). Scripts that write to their own package dir — native builds — fail silently. Pass --unsafe-perm to npm inside the jail.
  • pip is a two-host client: metadata on pypi.org, tarballs on files.pythonhosted.org. With only the first, pip retries five times and fails with a proxy error that never names the real problem:
cell run --net proxy --egress-only pypi.org --egress-only files.pythonhosted.org \
         --bind "$PWD:/work:rw" -- sh -c 'cd /work && pip install -r requirements.txt'

Running cell inside docker

cell can execute inside a docker container — for orchestrators like CI runners or multi-tenant agent services that are themselves containerized — with two container flags:

docker run --security-opt seccomp=unconfined \
           --security-opt apparmor=unconfined ...

Both strip the container’s own syscall/mount filtering, so this is sound only when docker is the packaging layer and cell is the security boundary — the semi-trusted workload must never run unjailed in such a container. One honest degradation: docker masks /proc with locked over-mounts, so the jail cannot mount a fresh proc tied to its own pid namespace; cell falls back to binding the outer (still masked) /proc and warns. The payload then sees container-wide process argv — not environ — which matters when concurrent jails share the container. Rootless docker, gVisor and kubernetes restricted profiles are unverified territory. Full analysis: spikes/nest/VERDICT.md.

Evidence

flag default meaning
--audit PATH ~/.local/state/cell/audit.jsonl evidence log location
--no-audit off disable evidence for this run

Exit codes

code meaning
0-125 passthrough the payload’s own exit status, propagated unchanged
91 namespace/userns setup failed
92 rootfs assembly failed
93 bind mount failed (does the source exist?)
94 security-layer setup failed
95 exec of the payload failed

Errors are typed JSON on stderr with suggestions, per the cli-output-spec:

{"ok":false,"error":{"code":91,"type":"precondition_failed",
 "message":"jail setup failed: namespaces/uid-map — unprivileged user namespaces may be unavailable on this host",
 "recoverable":false,"suggestions":["check /proc/sys/kernel/unprivileged_userns_clone or run cell feedback"]}}