Skip to content

Local Operations

Before enabling a backend, verify that the workspace path is explicit, the host Docker socket is absent, resource limits are set, network mode is known, and credentials are not mounted.

Canonical source lives outside disposable sandboxes. Restore from the latest trusted snapshot or Git commit. Resume approval from serialized run state; do not replay the side effect as a new request.

Destroy expired or failed sandboxes after retaining required audit events and published artifacts. Closing a client stream is not cancellation.

Recovery and evidence checklist

Before cleanup or resume, retain:

  • the workflow and selected policy/profile;
  • sandbox/session identifiers and lifecycle state;
  • capability decisions and approval records;
  • command results, verification output, checkpoints, and published artifacts;
  • the exact failure, cancellation, or expiration reason.

Resume from serialized run state when supported. Do not replay a request merely because the client disconnected, and do not repeat an external side effect whose completion is unknown without an explicit reconciliation decision.

Inspect a run without mutating its project or evidence directory:

bin/sandbox-loom run-status /path/to/project RUN_ID --json
bin/sandbox-loom evidence /path/to/project RUN_ID --json

The status command reports the latest checkpoint stage and count. The evidence command returns the correlated checkpoint records, including planned, in-progress, repaired, failed, and completed stages.

run-status --json also reports the latest progress timestamp, monotonic sequence, terminal state, resumability, and runtime identity when the run has persisted it. A cancelled, timed_out, or incomplete run is only resumable when its evidence proves that no protected side effect is pending; inspect the full evidence before retrying.

Install Youki for the Linux backend

Youki is the preferred first Linux isolation backend. The backend selector automatically falls back to runc when youki is not installed; install and validate Youki from a normal host terminal, not from inside a restricted Codex sandbox, when Youki is the preferred runtime.

Host prerequisites

On Ubuntu or Linux Mint, install the build and runtime dependencies:

sudo apt-get update
sudo apt-get install -y \
  git \
  build-essential \
  pkg-config \
  libsystemd-dev \
  libelf-dev \
  libseccomp-dev \
  libclang-dev \
  libssl-dev \
  systemd \
  dbus-user-session \
  libpam-systemd

Install Rust and just if they are not already available, then build Youki:

curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
source "$HOME/.cargo/env"
cargo install just --locked

cd /tmp
git clone https://github.com/youki-dev/youki.git
cd youki
just youki-release
sudo install -m 0755 ./youki /usr/local/bin/youki

Verify the installation and host capabilities:

which youki
youki --version
youki info

The host must provide Linux namespaces, cgroups, and a working systemd user manager with a DBus session. Log out and back in after installing the system packages, then verify:

systemctl --user is-system-running
systemctl --user status

If the user manager must remain available without an interactive login, enable lingering for the user:

loginctl enable-linger "$USER"

dbus-run-session alone is not a substitute for a systemd user manager. A Codex sandbox may have systemctl and /run/user/$UID/bus visible while still blocking access to the bus; run the live Youki smoke test from the host terminal in that case.

OCI bundle requirements

The backend requires a prepared bundle containing:

bundle/
├── config.json
└── rootfs/

The project-generated configuration uses a read-only root filesystem, a writable /workspace bind mount, isolated namespaces, dropped capabilities, noNewPrivileges, and bounded resources. The rootfs must contain the command specified by process.args; a minimal static BusyBox rootfs is sufficient for a smoke test.

Use bin/sandbox-loom rootfs prepare to prepare a rootfs without copying host credentials or home directories. Its default BusyBox mode is for runtime smoke tests. Use --mode host with explicit --agent and repeated --tool options for a coding-agent rootfs; verify the agent’s interpreter and project-specific quality-gate dependencies separately.

Smoke-test lifecycle

Run the lifecycle from the host terminal with an explicit state directory:

youki --root "$BUNDLE_ROOT/state" create --bundle "$BUNDLE_ROOT/bundle" smoke-test
youki --root "$BUNDLE_ROOT/state" start smoke-test
youki --root "$BUNDLE_ROOT/state" state smoke-test
youki --root "$BUNDLE_ROOT/state" delete --force smoke-test

Do not configure Youki as Docker’s global default until the direct OCI lifecycle test passes. See the Youki user documentation for runtime requirements and the basic usage guide for rootless OCI bundles.

The selector tries youki first and then runc. To require one runtime, configure preferred: :youki or preferred: :runc; an unavailable required runtime is an error rather than a silent fallback.

Current runtime-conformance status

On the current development host, the minimal tada-list-app OCI acceptance fixture completes successfully with runc under a delegated systemd user scope:

systemd-run --user --scope \
  --property=Delegate=yes \
  --collect -- \
  bin/sandbox-loom run examples/tada-list-app \
    --runtime oci \
    --backend runc \
    --rootfs "$PWD/examples/tada-list-app/.sandbox-loom/rootfs" \
    --run-id tada-list-app-phase-14-runc-$(date +%Y%m%d-%H%M%S) \
    --json-summary

The current host also completed a direct network-denial OCI probe with Youki 0.7.0 and runc 1.4.3. Both runtimes started a rootless bundle with resource limits intact. Connection attempts to host and private addresses, a neighboring bridge container, public IPv4/IPv6, and DNS failed. The probe used a temporary static BusyBox rootfs and did not test inbound reachability or the maintained execution image. The detailed evidence remains in the repository at specifications/architecture/phase-30.5-runtime-network-evidence.md.

For the maintained signed Ruby image, rootless runc 1.4.3 required the temporary state root to be on a tmpfs mounted inside a parent user namespace; the OCI mappings were translated into that namespace so the effective host UID/GID mappings stayed the same. A delegated systemd user scope was needed to apply the configured cgroup limits. The direct runtime probe passed the image-backed network matrix and remote-peer listener check, and the signed-image CLI workflow, broker operations, crash recovery, cancellation, and output redaction also passed under runc with that setup. Those CLI runs supplied the previously verified cache rootfs with --rootfs; digest-pinned execution.image admission and startup under runc remain unverified. The Ubuntu 24.04 VM cannot mount tmpfs in its rootless user namespace, so it could not use this workaround.

Repeat the network-denial acceptance

Run the probe separately for each runtime and host configuration you plan to support. Use a disposable workspace and an already acquired rootfs. Do not pull an image or install packages from inside the guest.

  1. Record the host kernel, runtime name and version, OCI image manifest digest, rootfs fingerprint, resolved policy digest, and the SHA-256 of the generated config.json. Record the process UID/GID and the subordinate UID/GID ranges.
  2. Prepare positive controls before starting the guest. Confirm from the host that a listener is reachable on the host bridge address and a separate neighboring workload. Confirm that the selected public IPv4/IPv6 test endpoints accept connections and that the host can resolve the DNS test name. A failed host control makes that target inconclusive.
  3. Build the probe bundle through Backends::OciBundle with network: :disabled, the same process UID/GID as the image, the normal resource limits, and the test workspace mounted at /workspace. Start and inspect it with the runtime under test. Confirm the bundle has one private network namespace, no interface or route configuration, no network device grants, and empty process capability sets.
  4. From the guest, record /proc/net/dev, /proc/net/route, and /proc/net/ipv6_route. Attempt TCP connections to loopback, the host bridge, the positive-control neighbor, a private-network target, and the positive-control public IPv4 and IPv6 endpoints. Attempt DNS resolution for the positive-control name. A successful guest connection or lookup fails the probe. ECONNREFUSED alone is inconclusive because it can mean the destination had no listener; require a reachable positive control for each destination whose isolation result you report.
  5. For inbound evidence, start a guest listener and wait for its readiness marker. From the host and, where available, an independent peer, first verify a control connection to a host service, then attempt the guest listener address and port. Record the guest network namespace and its interface and route tables. A listener that cannot be reached from a peer without a guest-routable address does not prove behavior for an attached interface or a forwarded port.
  6. Repeat the checks through bin/sandbox-loom run using the acquired signed image and a resolved policy whose network.access is disabled. Exercise one declared broker operation to verify the control-plane path still works. Confirm the runtime reports successful cleanup. If runtime startup fails before the guest probe starts, report a startup failure, not a network conformance result.
  7. Run once with credential-free fixture inputs and once with the project workspace you intend to use. Record the preflight result and its byte/file limits. A pass establishes only the scanned workspace and recognized credential formats; it does not prove complete secret detection for every arbitrary workspace.

Keep raw credentials and secret values out of logs. Store the redacted probe matrix and the identities from step 1 with the run evidence. The detailed current results and their limits are in specifications/architecture/phase-30.5-runtime-network-evidence.md.

Earlier tada-list-app acceptance recorded a Youki PID-namespace EPERM failure, while the workflow completed with runc. Keep that workflow result separate from the later direct network-denial probe: neither result alone establishes full image-backed Youki acceptance. The offline execution class remains disabled until image, credential, inbound-network, broker, recovery, and end-to-end acceptance checks pass.