Trust model
Host support: This fork supports macOS 27+ on Apple Silicon only. Linux guests remain supported. Source references below are to the Swift host (
Sources/), the runtime (iso-sandbox/) and the proxy (iso-proxy/).
This is the engineering-facing trust model for iso — the authoritative list
of trust boundaries, taint sources, and the invariants that hold the isolation
together. The shared review workflow
reads this file, and the root AGENTS.md “Trust model” section
points here. Apply these checks whenever you build or review a change.
This complements — it does not replace — SECURITY.md, which
is the vulnerability-disclosure policy. SECURITY.md tells outsiders how to
report a problem; this document tells contributors where the boundaries are so
they don’t introduce one.
The core boundary: the VM
isolate’s isolation boundary is the Linux guest VM itself — an Apple Containerization VM on a macOS 27+ Apple Silicon host. The point of the tool is to run AI coding agents (Claude Code, Codex) with broad autonomy inside that boundary, so the guest is deliberately permissive:
- The guest user has passwordless
sudo(NOPASSWD:ALL). - Claude runs with a managed
~/.claude/settings.jsoncarryingdefaultMode: bypassPermissions; thecodex/claudelaunchers pass--dangerously-bypass-approvals-and-sandbox/--dangerously-skip-permissionsunless the user passes--ask.
This is intentional and correct: there is no privilege boundary inside the guest to protect — the whole VM is the blast radius. The security model is “anything the agent does stays in the VM.” Every rule below exists to keep that true: to stop guest-authored (therefore untrusted) data from escalating across the VM boundary into host code execution, host filesystem escape, or credential exposure.
Treat the guest as untrusted from the host’s point of view, even though the user launched it.
Trust zones
| Zone | Trust | Notes |
|---|---|---|
Host user + config.jsonc |
Trusted | cmd: values run arbitrary /bin/sh -c on the host (CredentialResolver in Sources/IsoHost/Credentials/CredentialResolver.swift), only when an operation needs the value — never merely by loading the configuration. The config file is a host code-execution surface; only the owner should write it. |
| isolate process (host) | Trusted | Holds/relays secrets, constructs guest commands, drives iso-sandbox, container build, ssh, and iso-proxy. Every subprocess goes through ProcessRunner with an argv, never a shell string. |
| The guest VM | Untrusted | Agent-controlled. Anything it emits — file contents, paths, archive members, command output — is a taint source once it crosses back to the host. |
| GitHub API / model endpoints / DNS | External | api.github.com (PAT probe, release metadata), the model endpoint. Reached over the network; authenticated where applicable. |
| iso-ci companion → GitHub Actions service | External | Scale-set pools only (iso-ci/, separately installed): the host-side controller exchanges a runner registration token for an Actions service admin token and holds a message-session token. Both stay in controller memory and go only to https hosts under .actions.githubusercontent.com (no redirects); guests receive only the JIT runner configuration. Each job is gated on GitHub’s run record before acquisition (elastic scale sets) or on assignment (non-elastic, where a refused or unvetted assigned job stops all new runners). Only an elastic scale set with min_runners: 0 may opt into public repositories (fork pull requests refused, write-gated events or named actors only). |
iso VM leases (~/.iso/run/leases) |
Host-local | Written and flock-held by iso-sandbox VM owner processes; read by iso-ci to count CPU, memory and macOS VMs it does not own. Host-authored, never guest-authored; parsed strictly and bounded. |
Secure defaults (DEF-01)
With no configuration, a new Linux instance is created brokered (no network
device), with egress none, proxy.mode required, staged returns, no host
agent-home import, GitHub off, the sandboxed editor, and an 8h boot
lifetime. Each relaxation is an explicit setting, listed by iso policy effective: network.transport vmnet (needed for macOS guests and open
egress; a brokered setting never falls back to it, and vmnet none/filtered
does not isolate host or LAN services as brokered does), the networked
preset, proxy.mode auto/off, direct pulls, a named config_dir, a
GitHub mode, editor grants, and session_ttl longer than 8h or
"unlimited" (ordinary local instances only; enrolled hosts and iso-ci stay
finite). A preset label alone is not evidence of effective isolation: the
recorded transport and egress of an existing instance stay as created.
Host configuration is read only from a regular file owned by this user or
root that no other principal can write (mode bits or ACLs). Symlinks in the
path are followed; the resolved file and every ancestor directory of its real
path must satisfy the same owner, mode and ACL rule, except that a sticky
world-writable directory such as /tmp is allowed. Repository-local
configuration is never discovered.
Saved start-time grants (guest environment entries, port forwards) carry IDs
and provenance in <instance>/grants.json; security.revoked_grant_ids
withdraws one before the next handoff and the tombstone persists. A restart
that fails after boot is stopped with its disk kept; if the stop cannot be
confirmed the instance is fenced (handoff-fence.json) and gets no workload
until iso stop succeeds. A discovered devcontainer is parsed once and its
translated effects are shown before you accept it; accepting grants no host
capability.
Taint sources (treat as untrusted)
- Guest filesystem content pulled to the host. Every return
(
Workspace.swift,WorkspaceStage*.swift,WorkspaceReturn.swift) brings guest-authored file contents, filenames and symlinks toward the host: the widest guest→host channel. Every mode,directincluded, receives into a fresh owner-only<instance>/returns/incoming/<id>/treewith the qualified system bsdtar/openrsync (absolute paths, fixed environment, root-owned path chain) under an inherited writer lease; only a quiescent, validated receive becomes the selected stage. The walk never follows links; rejects special files, hard links, colliding names, escaping or chained symlinks (every target component, against the planned final tree) and file↔directory transitions; enforces budgets; and never installs.gitof any form. Host Git never runs during a return. The installer writes only through a destination bound by directory identity, disjoint from iso control state, after complete preflight and a durable single-use attempt record, rechecking each entry before its replace. Known execution-sensitive paths (.husky,.envrc,.vscode/tasks.json) apply only with an exact--approve-sensitivegrant; that list is incomplete and returned source stays untrusted. The tar receiver (bsdtar) runs undersandbox-execwith a deny-default profile (SeatbeltProfile.tarReceiver): it can write only beneath the attempt’s tree, read system paths, execute nothing but itself and open no network connection; the writer-lease descriptor is inherited already open. The rsync receiver is not sandboxed: it must startssh, and on the brokered transport the runtime connector through/bin/sh. The transfer monitor is a sampled budget, not a disk quota. - Committed disks.
iso committurns a guest-mutated disk into an image, so the guest authors every file on it. Host-key and machine-id removal runs in a maintenance VM, never on the host (see Apple sandbox backend). - Guest command output read by the host. e.g. the workspace dirty check in
Workspace.swiftreadsgit status --porcelainfrom the guest. Today this only gates control flow / is printed to the user — it is never fed intosh -con the host. Keep it that way. - A fetched
devcontainer.json.DevcontainerGitRepo.swift/DevcontainerJSON.swift/DevcontainerModel.swiftparse devcontainer JSON that may originate from a remote repo. Its values configure the guest; they must never reach a hostcmd:evaluation or host shell. Recursive parsers of untrusted input iniso(devcontainer JSON, guest JSON, Codex TOML) run on a fixed 8 MiB stack (withParserStack) below their depth caps. The runtime’s owner, which parses guest request lines and live-view messages on 512 KiB connection threads, instead refuses input nested deeper than its closed request types can be (JSONNesting: four levels for a guest request, one for a viewer message) before any parser reads it. - Downloaded update artifacts.
Update.swifttarball +SHA256SUMSfrom the release host — gated by a maintainer signature overSHA256SUMS, the checksum and (best-effort) Sigstore attestation. - Installed agent definitions.
iso agent addcopies a reviewed JSON document into<data_dir>/agents/. The file is untrusted input: it can select an existing image or profile and a compiled adapter, and it can suggest hostnames, but it cannot grant network destinations, read a host secret, mount a host path, or run a host command.iso runbuilds guest argv withRemoteCommandescaping and does not re-read the file after the launch plan is frozen. A disposable instance is marked soiso upwill not adopt it. - OCI feature blobs.
DevcontainerOCI.swiftpulls devcontainer Features from GHCR; the install snippet runs in the guest, not the host. isolate verifies the manifest against its own bytes (and any@sha256:pin and registry-claimed digest) and each layer against its descriptor digest, and readsinstall.shonly as a bounded regular file (never through a symlink).
Secrets and how they cross into the guest
isolate relays several secrets from the host into the guest: ANTHROPIC_API_KEY,
OPENAI_API_KEY, GITHUB_TOKEN/PAT, CLAUDE_CODE_OAUTH_TOKEN, arbitrary
user env_forward entries, and the VM SSH key. The invariants:
- Never on argv. Secrets ride SSH
SendEnv(env channel) or process env (EnvForwardinGuestSession.swift), or are piped via stdin (ProcessRunnerstdin, the git-clone credential helper,curl -H @-inGitHubAPI.swift/Update.swift/DevcontainerGitRepo.swift). Never build a command line with the secret as an argument — it is visible inps//proc. The one known exception is the macOS Keychain store step (security add-generic-password -w, inSecretStore.swiftandProxyProvisioning.swift): the secret is onsecurity’s argv while it runs, where a local process listing can see it.security -iwould read the same command on stdin, but iso does not use it yet. The exception is documented at both call sites and the secret never appears in isolate’s messages. MCP server definitions (with resolved header secrets) reachclaude mcp add-jsonon stdin, not the ssh command line. - Nothing else rides the SSH environment. Guest-bound
ssh/scp/rsyncinherit onlyPATH,HOME,USER,LOGNAME,TMPDIR,SHELL,TERM,LANGandLC_*from the host, plus the variables isolate forwards on purpose. A user’s ownSendEnv(the guest accepts any) therefore cannot carry a raw provider key into the guest in proxy mode.guest_env.json(start-time--envvalues) is owner-only, in an owner-only instance directory. - Guest names never configure the host. A requested guest variable
travels only under a generated alias (
ISO_SSH_ENV_<n>,SendEnvnames only those) in the host ssh child’s environment; the host’s ownPATH,HOME,SHELLand the rest stay as the host snapshot had them even when the guest asks for the same name. A wrapper in the guest captures every alias first, restores the original names, and runs the command with the login shell. A missing alias or failed assignment aborts before the workload starts (exit 125) with no raw-name fallback. Limits: 64 entries, 8 KiB per value, 64 KiB of names and values, 64 KiB of wrapper; values with NUL fail before ssh starts. A PTY attach replaces a requestedTERMwith iso’s normalized terminal type before encoding; non-PTY sessions and the remote agent launcher keep the requestedTERM. - No ambient SSH authority for guest transports. Guest
ssh,scpand rsync’s-erun with-F none(no~/.ssh/config: noProxyJump,LocalCommand,SendEnvor forwards),PermitLocalCommand=no,ForwardX11=noandIdentityAgent=none, on top of the pinned host key. Shipped (optimized) builds takessh,scp,rsyncandtarfrom/usr/binonly, neverPATH; debug builds keepPATHlookup for test doubles.scpruns its nested ssh through-Swith that same pinned path. rsync’s-eis serialized for rsync’s own tokenizer, and a word it cannot carry intact (', backslash or a control character) is refused. Every managed ssh runs a ProxyCommand withSHELL=/bin/sh, not the caller’s shell. Control-master teardown (-O exit) runs with-F noneandControlMaster=no, so a missing or replaced socket fails instead of opening a new guest connection. Enrolled-host management SSH keeps its trusted enrollment configuration and agent by design, with agent and X11 forwarding, every forward andLocalCommanddisabled. - Proxy processes are identified, not assumed. A proxy starts only on a
free port and must be the sole listener afterwards (
lsof), or startup fails closed before the credential is sent. Each companion PID file has a<name>.identity.jsonbeside it recording the process’s kernel start time and executable once it runs; a recorded proxy, egress companion or egress lease PID is trusted or signalled only while it is still that exact process (a reused PID has another start time). The executable must match whenever the kernel still reports the image’s path; once that path no longer exists (uninstalled, or removed after an update replaced it) the start time alone identifies the process. A record from an older iso without that identity is signalled only while the PID runs the executable iso would start now (the path is compared, the companion’s signature is not checked), and is never trusted as alive. Tunnel PIDs are bound by their own identity (see below). Release builds startiso-proxyandiso-egressonly after Security.framework validates them: carrying a Developer ID signature of iso’s own team, or, when iso itself is signed ad hoc, any valid signature. In both cases the companion must be an executable regular file owned by root or the user with no group or other write bit, and every directory above it must be owned by root or the user and not other-writable unless sticky (group-writable directories such as aroot:admin0775 one are accepted). Debug builds skip these checks. - Source retrieval uses only selected credentials. A guest clone and
host devcontainer discovery share one decision (
GitHubSourceAuth): an assigned or matching PAT entry, elsegh auth token/GITHUB_TOKENonly whengithubexplicitly selectsauto(both) orenv(the variable). Withoff, an unset mode,--no-github, or PAT mode without a matching entry, the request is anonymous; a missing scope never widens to an ambient credential. A clone token is guest-visible while the clone runs; discovery uses its token on the host only. GITHUB_TOKENdefaults to Off. A saved VM PAT assignment is also explicit opt-in; it stores only a validated existing entry key. Invocation-level--no-githubsuppresses the assignment before loading it. Active assignments reject both managedGITHUB_TOKENandGH_TOKENoverrides and fail closed on missing references or failed retrieval. It is only forwarded with an explicitgithubauto|env|patopt-in (GitHubTokens.guestToken). When forwarded, agent bootstrap runsgh auth setup-git, which makes the token persistent guest state (a git credential helper any guest process can read). A change that forwards it by default, or makes it persistent where it wasn’t, is a finding.up --no-github/start --no-githuboverride the strategy to Off and disable the PAT wizard for that invocation. This does not scrub existing guest credentials or block explicit environment entries or one-shot clone authentication; see GitHub auth.- Secret files stay
0600, dirs0700. isolate stores secrets only in the macOS Keychain; there is no plaintext-file or other fallback store. All managed writes go throughAtomicFile/StateStore, which never relax permissions. - Secrets stay out of logs.
Secret<T>(Sources/IsoCore/Units.swift) andEnvForwardrender as<redacted>in descriptions, debug output, and reflection; subprocess descriptions redact secret arguments. Configuration and decoding errors name field paths, never values. Do not log a resolved secret. - The stored token is indirected, never inlined. The configuration holds a
cmd:...retrieval command (KeychainReferenceinSecretStore.swiftfor iso-created items) or avault:NAMEreference to the local secret store, not the plaintext token; isolate resolves it when it needs the value. Provider proxy credentials must becmd:orvault:references; literal values are rejected. - The local secret store. Its passphrase is read from
/dev/ttyor from the descriptor named byISO_SECRETS_PASSPHRASE_FD(once per process), never argv or a plaintext variable, andiso secrets settakes values from a prompt or stdin. A{vault:}guest-environment reference is persisted inguest_env.jsonas a reference only; its value is resolved per session and is guest-visible by design, like any--envvalue. A reference on a provider credential variable is persisted as aprovider_secret, resolved only into that VM’siso-proxystartup document, and never set in the guest environment; underproxy.mode = "off"it is an error. A generic reference may not name a secret a proxy credential also reads.vault:is refused for values placed in the guest (claude.api_key,codex.api_key, MCP headers). - Proxy mode keeps the model API keys out of the guest entirely (issue #411,
proxy;proxy.modeis"required"by default). When enabled in remote model mode,ANTHROPIC_API_KEY(Claude) and/orOPENAI_API_KEY(Codex) are not forwarded (suppressAnthropicKey/suppressOpenAIKeyinBootstrap.swift, one per provider); the host-sideiso-proxyholds the real credential and the guest gets only a per-instance capability token (Claude viasettings.json, Codex via theiso_localprovider’s bearerenv_key). In proxy mode Codex’s~/.codex/auth.jsonis also not staged onto the guest disk (it holds a refreshable subscription token). Each credential is resolved on the host and handed toiso-proxyover stdin, never argv or disk; a resolution failure fails the boot closed. A per-VM override (ProxyState.swift,<inst.dir>/proxy.json) selects a different host-side credential for one VM — resolution is override → default → off — without changing the proxy binary or the capability token. Seecredential-proxy.md. - Codex ChatGPT account auth is persistent guest state. With
codex.auth"chatgpt", isolate suppressesOPENAI_API_KEYacross config, process env,env_forward, and persisted--envoverlays, writescli_auth_credentials_store = "keyring"to guest~/.codex/config.toml, and excludes hostauth.jsonfrom the guest copy. Codex stores its cached account credentials in the guest Linux Secret Service instead. This avoids API-key billing and hostauth.jsoncopying, but it does not keep the ChatGPT refresh token out of the guest. A compromised guest can use or extract any credential its keyring session can unlock. The keyring setting is written during agent bootstrap, so--no-agentsskips it. On a guest where no earlier boot wrote it, the wrapper then falls through to plain Codex andcodex loginwrites a plaintext~/.codex/auth.jsoninstead. isolate warns in exactly that case; the setting lives on the guest disk, so once written it survives a later--no-agentsstart. Two guardrails close the gaps that leaves: each bootstrap in this mode deletes any guest~/.codex/auth.jsonleft by an earlierapi_keyboot or--no-agentslogin (dropping the file from the staged set only stops isolate copying one, it removes nothing), andiso codexrefuses to launch when the guest config does not actually select the keyring store — otherwise the wrapper would pass through to plain Codex and write the token in the clear. The wrapper also fails closed when a session-levelCODEX_HOMEis set while isolate’s managed~/.codex/config.tomlselects keyring mode; isolate does not otherwise stage or maintain an alternate Codex home.
SSH boundary
- Every guest SSH connection pins the guest’s host key. The options come from
one place,
SSHTarget(Sources/IsoHost/Guest/SSH.swift:hostKeyOptionsandtransportOptions— the one listssh,scp, and rsync’s-eall derive from — and the~/.ssh/configblock inSSHConfig.swift):StrictHostKeyChecking=yesagainst a per-instanceknown_hosts,GlobalKnownHostsFile=/dev/null,HostKeyAlias=<machine>.iso,UpdateHostKeys=no,ForwardAgent=no,IdentityAgent=none, andIdentitiesOnly=yes, so isolate’s guest-facing SSH authenticates with its own key file and never consults the host agent. The SSH processes’ environment keepsSSH_AUTH_SOCK(an absolute path only, never inSendEnv) for one purpose: SSH to an enrolled execution host, whose key may be usable only through the operator’s agent, including a guest session’s ProxyCommand that opens that connection. That management connection pins the host key and setsForwardAgent=no; guest SSH still refuses the agent. isolate’s own transports addBatchMode=yes, so a rejected key fails instead of falling back to a password prompt; the block written for the user’s ownssh iso-<name>deliberately does not. - The Ed25519 host key is read once over the runtime’s native control channel
(
iso-sandbox execover vsock to the owned sandbox, neverssh-keyscan) and written byHostKeyPin(HostKeys.swift). A missing or changed key is a hard error. Flag any path that re-enrolls automatically or builds a target without the pinned options. - The guest SSH key (
<data_dir>/backends/apple-container-v1/vm_key, ed25519, passphrase-less by design) is a VM-access credential. Do not “harden” it with a passphrase (it must be used non-interactively), but do flag any change that exposes it or copies it off the host.
Execution hosts (host control)
Design and status: design/local-and-remote-hosts-spec.md.
- Service boundary. The per-user host-control service listens only on two
Unix sockets in a private (
0700, owner-checked) per-user temporary directory; every connection’s peer uid must equal the service’s. There is no TCP listener. A non-blockingservice.lockgives one service per data root. - Remote frontend. A client reaches a remote Mac only as
ssh -T -o BatchMode=yes -o StrictHostKeyChecking=yes -o ForwardAgent=no -o ClearAllForwardings=yes -- ALIAS 'AGENT_PATH' host-agent serve|relay --stdio.AGENT_PATHis the user’s enrollment choice (AgentPath: absolute,[A-Za-z0-9/._-]), never a project value. Request frames, relay preambles and bearers travel on stdin only. A changed management host key isHOST_IDENTITY_CHANGEDwithlayer: management; a changed installation or owner reported by hello is the same code withlayer: application. Neither re-enrolls automatically. - Client bridge.
iso host-agent client --host ALIAS --stdio [--relay]lets a separately installed companion speakiso.host/v1without reading iso’s state:localgoes through the service’s remote socket, so every remote-v1 restriction applies (no local-only maintenance), and an enrolled host through the same pinned management SSH. Frames and relay preambles are read from stdin only; a disabled host is refused outright. - Capability evidence.
host.capabilitiesadvertisesnet-handoff-1only while the transport is brokered, the runtime is brokered-capable and a private, unexpired evidence manifest names the running tuple with N-T01–N-T16 passed. The manifest is operator input, not a guest or client value; it never widens a boot policy. - Run retention.
run.retainkeeps a disposable run only under host deadlines: live retention lasts at most 4 h from the first live request and never passes the VM’s own deadline, and stops the VM at its end even with a session open; stopped retention never shortens and is capped at 7 days from the first stop. Live retention revokes the run’s access grants (SSH sessions and their relayed streams); it does not change the boot. The VM keeps its immutable network policy — filtered egress and any provider or local-service grants it booted with — and everything already delivered into the guest (files, environment, memory, credentials) until it stops. Network revocation is not secret erasure; to end those, stop or discard the run. - Untrusted frames. Every frame is bounded (64 KiB request, 1 MiB response, depth 32), UTF-8 checked, duplicate-key checked and decoded into closed typed structures; unknown fields and versions are refused before dispatch. Error messages are sanitized, bounded and never quote frame bytes.
- Durable operations. Mutations are deduplicated by
HostOperationIDand a canonical typed digest before any dynamic check, so a retry can never allocate twice; a reused id with a different payload is refused with no effect. Admission writes fixed-size reservation files for each instance’s stop and destroy, so cleanup succeeds when the ordinary ledger is full. A lost reply isOPERATION_UNCERTAIN, never stopped or failed. - Access grants are volatile. The client generates a 256-bit bearer; the worker keeps only its SHA-256 in memory, bound to host, owner, instance, boot, policy, generation, client key fingerprint, purpose and the daemon epoch. A restart creates a new epoch and invalidates every grant. Issued session ids are never evicted within an epoch (cap 65,536). Leases last 30 seconds and never outlive the VM’s deadline; one client key controls a boot.
- Relay, not jump host. Guest streams go through a worker-owned byte relay
to the endpoint taken from current native proof; the client cannot name a
destination. Revocation, expiry, stop and destroy shut down the relay’s
sockets. Removing the session key from the guest is hygiene only. The guest
host key is pinned end to end by the client’s ssh (per-session
known_hosts,GlobalKnownHostsFile /dev/null,UpdateHostKeys no). - Realms. Client paths,
cmd:/vault:references and provider credentials never enter a host-control request; eachiso hostcommand names its host explicitly (executiononly supplies enrollment defaults), andlocalcannot be redefined. Remote boots always have a finite deadline (default 8 h, at most 24 h) enforced by the worker’s runtime owner and its own sweep. - Client broker. Remote agents resolve provider credentials on the
client into the confined
iso-proxy, exposed to the guest only by a reverse tunnel inside the relayed route; no credential is sent to the host. Remote agents always run asproxy.mode = "required", so no recognized provider variable and no Codexauth.jsonis staged into the remote guest, andproxy.mode = "off"refuses them. MCP servers iso configures with headers (values resolved on the client) are not configured on a remote guest, and neither are servers in the client’s own~/.codex/config.tomlthat set literalhttp_headers; the rest of that file is copied as it is for a local VM. Every remote agent run rewrites the guest’s Codex config. Remote Codex reaches the client proxy with its capability token inISO_LOCAL_API_KEY, which opens only that proxy, through the relay. For filtered-egress VMs the grant carries the worker’s natively proven boot policy and the client binds its signed guest-path readiness check to it; renewal re-checks the worker’s proof and closes the session (and its relays) when it fails. There is no unproven fallback. - One writer per instance. After
iso host migrate local, adopted instances carry a marker and only the service’s backend may mutate them; the owner record moves to schema 2, so builds that predate the host service refuse the data root rather than writing beside the service. - Artifacts. Upload handles are random, owner-bound and expire after one hour unless an accepted operation retains them. Archives are refused for absolute or traversing members, links that escape or are written through, duplicates, special files and truncation, before publication.
Local editors
A remote-development editor (VS Code Remote-SSH, Zed) talks to a server the
guest controls. Assume a guest with root can replace that server, emit any
editor-protocol message, and so run code in the local editor process. SSH
authentication and host-key pinning identify the peer; they do not limit what
an authenticated peer asks the editor to do. Design record:
design/editor-hardening.md.
editor.security (and --editor-security) selects the local editor’s class:
sandboxed(default).EditorLauncherruns the editor as a new, iso-owned process tree (Sources/IsoHost/Editor/):- The application is found only at
/Applications/<App>.appor~/Applications/<App>.app, never fromPATH. Its executable and bundle must be owned by root or the user and writable by no one else, and its signature must pass strict validation against the compiled-in bundle identifier and Developer ID team (TrustedEditorApp, Security.framework). A bundle that fails a check stops the launch; nothing falls back to another editor, the editor CLI or a URL scheme. - A per-session enclave under
/private/tmp/iso-editor-<uid>/(a directory that must be the user’s own with mode0700) holds HOME,TMPDIR, the editor’s--user-data-dir, its extensions and its SSH files. The editor’s environment is HOME, TMPDIR, a fixed systemPATH, USER/LOGNAME and the locale; nothing else from the caller. - A fresh Ed25519 key is generated in the enclave and appended to the guest
user’s
authorized_keysasrestrict,from="127.0.0.1,::1"(VS Code re-enables port forwarding to guest loopback only). The editor reaches the guest only through a loopbackssh -Ltunnel thatisoruns outside the sandbox with the pinned transport, sovm_keynever enters the enclave and the enclave’s key authenticates to no other instance. The editor reads only the enclave’s SSH config (ssh -F), which pins the host key with the instance’sHostKeyAlias. - The editor runs under
sandbox-execwith a deny-by-default profile (EditorSandboxProfile.swift): reads limited to the signed bundle, system frameworks and fonts, and the enclave; writes to the enclave only; execution of the bundle and/usr/bin/sshonly (VS Code’s Remote-SSH also gets/bin/shand the ptys it allocates itself, because it runs ssh in a hidden terminal); network to the tunnel port and, for VS Code, one fixed loopback forward port only, with no DNS. The Mach allowlist omits the pasteboard, LaunchServices’ database (so the editor cannot open apps, URLs or documents), Apple Events, the keychain and Security services, and TCC. Chromium’s own sandbox cannot nest inside Seatbelt, so VS Code runs with--disable-chromium-sandbox; the outer profile confines every helper. isostays in the foreground: every ten seconds it re-proves the instance (running, same isolation-gate result, pinned target and filtered handoff identity), and two consecutive failures, a closed tunnel, Ctrl-C or the editor quitting end the session. Ending kills the editor’s process tree, closes the tunnel, removes the key fromauthorized_keys(best effort: the guest may keep the line, but the private key is gone) and deletes the enclave.editor.allow/--editor-allowwiden the profile explicitly:clipboardadds the pasteboard service;internetadds outbound TCP 443 to any host, name resolution and TLS trust evaluation. Machine output reports the grants.
- The application is found only at
unsafe. The editor’s own CLI (code,zed) and URL fallbacks, which can reach an editor already running with the user’s full authority. The CLI inherits onlyPATH,HOME,USER,LOGNAME,TMPDIR,SHELLand the locale. This mode crosses the VM boundary and prints a warning.
Residual risks in sandboxed mode, recorded rather than fixed:
- File metadata (
stat) is readable everywhere; contents are not. - The editor can check in with LaunchServices (
launchservicesd), which AppKit requires to show a window; opening apps and URLs still fails without the LaunchServices database. - The global and accessibility preference domains are readable.
internetallows any HTTPS destination, including LAN and loopback services on port 443; Seatbelt cannot filter by host.- The Mach allowlist and filesystem paths were derived on macOS 27 with VS Code 1.140 and Zed 1.22; a new OS or editor release can need more and then fails closed (the editor does not start or cannot connect).
Machine output (--output json)
The iso.machine/v1 document (machine-interface.md)
is read by other programs, so it is a disclosure boundary like stderr:
- It never carries resolved secrets,
cmd:/vault:values, proxy credentials or key material;ssh-configreturns the managed alias and the config path only (Sources/IsoCLI/Support/MachineResponses.swift). - Error messages and details are control-neutralized and bounded
(
MachineFailureinMachineErrors.swift); they carry the same text the stderr error already shows. - Machine mode is non-interactive (stdin is
/dev/null, the passphrase prompt is refused) and fails withINTERACTION_REQUIREDrather than answering a decision itself. It runs the same isolation gate, running proof and host-key pinning as text mode; flag any machine-only path that skips them.
Network
-
Port-forwards bind to
127.0.0.1only (PortForwards.swift): both the collision probe and thessh -L 127.0.0.1:<host>:127.0.0.1:<guest>spec. There are no0.0.0.0binds anywhere in the tree. A new listener must bind loopback explicitly. The macOS live view is the one host listener a browser reaches directly; see macOS guests (live view). -
Guest VMs cannot reach each other by IP. Each sandbox has its own vmnet network; see Apple sandbox backend for how that is demonstrated. Accepted by design: vmnet guests can reach the host’s addresses. iso’s local-model and credential-proxy tunnels are
ssh -Rforwards over the host-initiated SSH connection and do not depend on that path. A brokered guest has no network device and reaches the host only through iso’s tunnels. A change that widens guest egress or adds inbound reachability is a finding. -
A loopback local-model endpoint reaches the guest over a per-instance
ssh -Rreverse tunnel onto the guest’s own loopback (LocalEndpointsinModelState.swift); non-loopback URLs pass through unchanged. -
The credential proxy (issue #411) binds host loopback (
127.0.0.1, it refuses an unspecified address at bind) and is exposed into the guest with a per-instancessh -Rreverse tunnel (ProxyLifecycle.swift), so — like the port-forwards above — it never binds a non-loopback interface and is reachable by exactly one guest. It is guarded by a per-instance capability token and forwards only its documented provider-specific operations to a fixed per-provider upstream (api.anthropic.com/api.openai.com), never a guest-supplied host — one proxy process and one tunnel per (VM, provider). Its own TLS-verifying outbound HTTPS is the intended egress; a change that lets the guest influence the upstream host, widens the operation policy without security review, or binds anything wider than loopback, is a finding. The proxy streams allowed request bodies opaquely, so this does not isolate provider objects referenced by ID within an allowed request. -
Filtered-egress readiness is authenticated separately from guest access. The existing
iso-egressloopback listener accepts only an exact version-2GET /__iso/egress-readychallenge with the CONNECT capability and a fresh nonce. Its Ed25519 signature binds the nonce, immutable boot ID and computed allowlist hash; this operation never selects a target or performs DNS/upstream I/O. A separate per-boot private signing key goes transiently to the confined companion on stdin and remains only in process memory, never in a file, guest, or command line. Only its public verification key is persisted in owner-private host state (egress-readiness-public-key, removed on stop). Copying that public file into a workspace does not give the guest signing authority. The host authenticates bounded replies both directly and through pinned SSH plus guest loopback. A guest that knows the CONNECT capability still cannot forge a reply. This proves reachability of the keyed companion through that path, not every late session handoff. -
Filtered credential-broker composition uses separate signatures. Each effective remote provider broker must answer fresh direct and pinned-SSH guest-loopback challenges. Version-2 startup supplies a transient Ed25519 seed; only
proxy-<provider>-readiness-public-keypersists. The localGET /__iso/broker-readychallenge signs nonce, provider, boot ID and policy hash. It requires the guest capability (Authorization: Bearer), so no other local process can use the broker as a signing oracle; the host keeps each provider’s capability in owner-private instance state for these probes. It exposes no credential and cannot select an upstream. Exact method, URI and four-header framing, no body/trailers, a two-second completion deadline and a one-second signed-reply write deadline keep this separate from provider forwarding. The existing capability gate, provider operation allowlist, confinement and credential persistence are unchanged. Local-model and proxy-off modes need no broker. Each reverse tunnel’s recorded identity binds its PID to the unique control path and guest destination it was started with, so a reused PID or anothersshnever stands in for it. Which sshd session holds the guest-side listener is reported only by the untrusted guest and is not relied on; a signed guest-loopback reply still requires a host-created forward to the signer. -
Filtered workload sessions cannot reuse a cached readiness decision. Shell, exec and agent launches take an opaque, process-local
WorkloadSession. Its factory retains the boot/policy, owner/target and public keys actually authenticated during resolution, rechecks after environment preparation, and rechecks again immediately before workload SSH is spawned. A stopped/unhealthy instance fails; a healthy replacement identity also fails rather than adopting new authority for an old prepared environment. No private key or serialized proof is added. Nonfiltered behavior and intentional bootstrap preparation stay unchanged. Live administrative and workspace-transfer targets also retain the original proof in memory and check before SSH/SCP, tar/rsync, hook, editor and managed-alias operations. Bootstrap first establishes pinned transport and egress, then retains transport-only identity during broker preparation, with composite proof required before releasing hooks and initial transfers. A readiness refusal is distinct from an ordinary guest-command failure: hooks and agent updates propagate it rather than warn-and-continue. Best-effort capture/probe APIs return no result/false without launching the operation; subsequent transfer fallbacks must recheck. Local control-master cleanup is still permitted after refusal. While a filtered workload’ssshruns,isorepeats the same proof every ten seconds and kills the session (thesshand its descendants) after two consecutive failures. The per-boot egress lease also supervises the companion and egress tunnel it has seen: three consecutive checks without either end the lease, so the grant expires, and close the instance’sssh -Lforward master. Direct external SSH through the managed alias andunsafeeditor sessions do not pass throughiso; they are not supervised, andiso statusreports the instanceunhealthyinstead. Asandboxededitor session is supervised (see Local editors). -
The credential proxy is jailed. The macOS 27+ Swift executable holds the real credential and accepts untrusted guest HTTP. The host wraps it in
sandbox-exec -pwith the Seatbelt profile embedded inSources/IsoHost/Guest/SeatbeltProfile.swift. File writes and program execution are denied. Reads are limited to system paths (/System,/usr/lib,/usr/share,/Library/Preferences, the dyld and timezone databases,/private/etc, a few devices) and the binary itself; home directories and iso state are unreadable. Outbound connections are restricted to non-loopback port 443, non-loopback DNS on port 53 and the/private/var/run/mDNSRespondersocket; a deny after the port allows keeps every loopback IP service, on any port, out of reach. Startup probes, before reading stdin, that writes, exec, a random port, loopback ports 443 and 53 and a read of the user’s home are denied and that port 443 to a TEST-NET address is not. Theiso-egresscompanion runs under the same file, loopback and resolver rules (SeatbeltProfile.egress) and makes the same probes before it reads its readiness key and CONNECT capability. If confinement or HTTP readiness fails, VM startup aborts. The guest cannot select another implementation or supply a binary path.Accepted limitations:
- Egress is port-scoped, not host-scoped. A compromised proxy could connect elsewhere on port 443. Application policy pins the provider hostname and verifies its identity through macOS system trust, including host-admin/MDM roots; the guest cannot alter either setting.
- System files stay readable for runtime and resolver requirements. Existing stderr descriptors remain writable; no request/credential content is logged.
sandbox-execis deprecated but remains the confinement primitive.
Brokered transport
network.transport: "brokered" (configuration,
design) removes the vmnet exception
above for the instances that select it. Promised: untrusted guest code
cannot create a direct IP path to services on the Mac, sibling VMs, the LAN,
the tailnet or the Internet, because the VM has no network device; host
interaction and egress happen only through iso’s fixed, host-enforced
channels. Not promised: that the hypervisor, runtime or brokers have no
vulnerabilities, that guest output is trustworthy, or that an approved remote
service (an allowlisted host, a provider API, a configured local model)
cannot receive data. A configured loopback local model is an explicit,
visible exception, not general host access.
- No device, proven host-side. The runtime owner builds the VM with no
interface and reads the live
VZVirtualMachineaftercreate(before the guest’s own init runs): any network device, other than one socket device, or any device outside the inventory in Apple sandbox backend stops it unbooted. The host gate independently requires the owner’s reading of0/1, no interface or address,transport: brokered, and refuses any unknown effective field. A requested mode string or guest report never stands in for this observation. - Fixed stream endpoints. The owner opens host-to-guest vsock streams to
one fixed purpose (
ssh→ guest port 2222) and nothing else. A stream request names a purpose, never a port; it must present the live boot id, the runtime’s channel-policy digest (which the host recomputes from its own copy and compares) and the boot’s network-policy digest. Refused requests never dial the guest. The stream socket is a0600Unix socket in the per-user0700runtime directory, checked withgetpeereid; the guest has no path to it. Host-side vsock listeners exist only transiently for framework process stdio and file copies (exec, host-key read), plus, for adesktopinstance created with guest computer use, the owner’s persistent listener on port 7802 (Linux guests with a display); no listener routes to a host command, file, socket or another VM, and the integration suite probes host CID ports and sibling CIDs from guest root. - The adapter is convenience, not enforcement. The guest’s
iso-ssh-vsock.socketrunssshd -iper stream with stderr to the journal. Guest root can stop or replace it; the result is an unavailable session, never another network path, and the host still pins the SSH host key and treats every returned byte as untrusted. - Connector inputs are host-chosen. ssh’s
ProxyCommandis the resolved, ownership-checked runtime executable with the runtime root, machine name, boot id and digests — validated identifiers, never a bearer or secret, and refused when a path would need shell quoting. Diagnostics go to stderr only. Repository or guest data cannot select the executable or any argument. For a remote host, the worker’s relay spawns the same connector as argv from a fresh gate pass in place of/usr/bin/ncto a guest address; client-side fencing (session, bearer, epoch, lease) is unchanged. - Bounded, revocable streams. The owner enforces at most 64 open streams,
128 connections being handled (including ones still sending their request),
64 admissions per 10 s (a request past the rate waits within its setup
deadline), a 4 KiB request line read within 10 s, a 10 s guest
dial, and one 64 KiB buffer per direction, outside the guest. An admitted
stream has no byte cap or idle timeout of its own: it ends with the session
(EOF), a halt, the session deadline or
streams close. Stop and cleanup use the separate control socket, so a full stream table never blocks them. A halt closes every stream and refuses new ones;iso-sandbox streams closerevokes open streams; a restart is a new boot id, so old connector lines are refused. - Policy is fixed per boot. The boot’s network policy is resolved on the
host from configuration, the instance’s records and the environment the
boot records, bound to the boot by digest at the runtime, saved in
network-policy.json(schema 4) before create and, on a restart, only after the new boot passes the gate, and compared again at every iso handoff. Any change requires a stop and start; the managed SSH alias, which presents the boot’s original digest, keeps working until then. No failure — adapter, broker, controller or relay — attaches a network device or relaxes the policy; unsupported runtimes, images and guest OSes are refused before a VM is created. - Guest egress clients are convenience. On a filtered boot iso writes the
companion’s proxy URL into the guest’s Docker daemon drop-in and a
guest-internal
systemd-socket-proxydbridge on Docker’s default gateway, so pulls, containers and builds can use the approved path. The URL travels on stdin, never argv. Guest root can remove or rewrite these; the companion’s allowlist is the only enforcement. - Brokers keep their meaning. The credential proxy, filtered-egress
companion and local-model tunnels are the same processes and reverse
tunnels as on vmnet, reached by the guest only on its own loopback through
the SSH connection. Provider credentials stay in the provider broker;
egress: openis invalid. A blind CONNECT to an approved host can still relay data to that host’s operator; this is destination enforcement, not information-flow control. - A wildcard approves an operator’s domain, not a name. An allowlist
entry
*.<suffix>(rule) admits every name below that suffix, so it trusts whoever controls that domain to place only their own services under it. It is meant for services that assign per-job hosts (GitHub Actions underactions.githubusercontent.com); shared hosting domains where tenants pick names (*.github.io,*.githubusercontent.com, cloud storage roots) must stay exact. The address checks, port 443 and the absence of DNS in the guest are unchanged.
Apple sandbox backend
The same VM boundary applies. The backend drives iso-sandbox
(iso-sandbox), a runtime isolate builds on apple/containerization. The
isolation contract lives in two layers: the runtime cannot express host
exposure, and isolate verifies the effective configuration anyway
(AppleBackend, SandboxRuntime, IsolationGate in Sources/IsoHost/).
-
Runtime shape. Each instance is its own VM on its own vmnet network (
10.231.N.0/24), or with no network device at all fornetwork: brokered(no subnet; see Brokered transport). For every network mode the owner reads the liveVZVirtualMachineaftercreate, before the guest’s own init runs, and stops it unbooted unless it has exactly one socket device, one vmnet network device (none for brokered), no console, memory-balloon, USB or graphics device (adesktopinstance is the exception, with exactly the display, keyboard and pointer listed under Linux guests with a display), and at most the one virtio-fs deviceapple/containerizationalways attaches, sharing no host directory (VMDevices.requireExpected). The runtime’sSandboxRecordhas no field for a host mount, socket relay, published port, or agent forwarding, and its VM configuration is built in one function (Owner.machineConfiguration) with kernel pseudo-filesystems only. Its one network field,network, can only narrow reach: absent means vmnet shared (NAT) mode,host_only(fromegress: "none") means vmnet host mode with NAT44/NAT66, the DNS proxy, router advertisements and DHCP disabled, andbrokeredmeans no network device. The gate checks the record against the configuredegressand the interface label (vmnet-shared:/vmnet-host:) against the record. Adding any other such field, a widening network mode (bridged, shared-network, a published port), or acreateflag for one is a finding. -
Boundary audit.
iso auditreads<instance>/audit.jsonl, written by the host from host-side state only (configuration modes, proxied providers, variable names, counts); nothing guest-authored or secret is recorded, and the file is owner-only and bounded. -
Run history. The
iso.audit/v1store (<stateRoot>/audit/v1/, audit.md) holds typed host records: invocation requests, the effective environment from host records, the handoff’s forwarded variable names, the observed transport status and cleanup, and the boundary events above. No argv, prompt, value, terminal output, request body or hash of one enters it, and no guest report is recorded in this release. Files are owner-only, opened without following symlinks and parsed with size bounds; text rendering replaces control characters, and JSON escapes them. A recording failure only warns, and a refused capture is shown as a gap. Reads take no lock and never repair state;--exportcreates a new 0600 file and never overwrites. The local host user can edit this history; it is evidence, not a tamper-proof log. -
Session TTL.
limits.session_ttlis enforced outside the guest: the runtime records the deadline (record.expiresAt, host wall clock) atstart, the owner halts the VM when it passes and exits cleanly (so launchd does not restart it), a relaunched owner refuses to boot past it, and the isolation gate refuses to hand out an expired sandbox. Nothing the guest controls, including its clock, moves the deadline. Every halt (the TTL, a stop request or a signal) reaches the guest through guest-agent calls a root guest can wedge, so if the guest is still running ten seconds after the forced kill the owner exits, which ends the in-process VM. -
Runtime qualification.
SandboxRuntimequalification acceptsiso-sandboxprotocol 5 withcontainerization0.54.0. Filtered egress requires protocol 5 and a livebootId. The runtime itself accepts only a kernel whose sha256 is inKernelPin.allowed. On firstiso setup,iso-sandbox initpullsghcr.io/apple/containerization/vminit:0.54.0(the runtime’s only outbound fetch) and refuses it unless it resolves to the pinned digest. No config key or flag relaxes these checks; adding one is a finding. -
Isolation gate. Before first boot, on every restart, and before every SSH target is handed out,
IsolationGate.verifyEffectivechecks the configuration the running VM’s owner reports. The effective config is parsed with unknown-field rejection, so a new host-facing knob fails closed. It requires:/sbin/init, without nested virtualization;- a root disk at exactly
<runtime root>/sandboxes/<id>/rootfs.ext4; - only the seven kernel pseudo-filesystem mounts, each from its fixed source and destination;
- zero socket relays and published ports, and no agent forwarding;
- exactly one interface on a per-sandbox vmnet subnet, carrying the reported address (for a brokered sandbox: no interface or address, and the checks in Brokered transport);
- CPUs, memory, owner, and image digest matching the record.
The address must lie inside the reported subnet. The published-port count, agent-forwarding flag, and network mode are constants of the owner’s code rather than values read back from the VM. Checking them catches a runtime that changes them, not a VM that differs from its configuration. The mount, root-disk, relay, and interface checks read the configuration the VM was created from. The proof (
IsolationGate.Ready) is process-local and never persisted. The runtime root is canonicalized (realpath) on both sides, so the path comparison is exact. -
Separate networks are not proof of isolation. Guest-to-guest unreachability has to be demonstrated on real hardware for each qualified runtime.
tests/integration-apple-sandbox.sh(docs/testing.md) does so for TCP, UDP, and ICMP over IPv4 and IPv6, plus forged routes, static neighbours, spoofed sources, and broadcast/multicast, from both sides and after restarts, with the host as the positive control. Guest firewall rules do not count, because the guest has root. Rerun it before changing thecontainerizationpin or the VM configuration. -
Guests can reach host services. As noted under Network, a guest reaches the host through its NAT gateway and the host’s LAN address. On a Mac that includes anything listening on all interfaces, such as sshd when Remote Login is on, AirPlay Receiver, and rapportd. Accepted by design: those services authenticate their clients, and isolate’s own host listeners bind loopback and reach a guest only through its SSH tunnel. vmnet has no per-network filter, so closing this would need a root-owned
pfanchor on every Mac. The Apple default network (other workloads’ containers) and host vsock are not reachable from a sandbox. A change that exposes a host credential service to guests is a finding. -
Native control channel. Host keys are read, and image checks run, through
iso-sandbox exec: an argv delivered over vsock to the guest agent, never a shell string. Only fixed commands and iso-chosen paths go through it; guest-controlled text never does. The owner’s control socket is0600in a0700per-user directory and checks the peer UID. It handles at most 64 connections at once (each in-flightexecholds one), a request line must arrive within 30 s, and everyexecis bounded: 600 s when no timeout is given, at most 24 h. Guest-authored maintenance output (e2fsckon a guest-written disk) is truncated and has control characters replaced before it reaches a log or error. -
Host-key pinning and re-enrollment. A changed key fails with
APPLE_HOST_KEY_CHANGED. The only path that replaces a pin is a start afteriso restore: isolate replaced the disk itself, and the restore removed the host keys. That path is journaled with an operation id. After a crash, the runtime’s record must show both a higher disk generation and that operation as its last committed one before the flag is set. Flag any other path that re-enrolls. -
Runtime subprocesses get a cleared environment. Only
HOME,USER,LOGNAME,TMPDIR, locale, and a fixedPATHare passed (SandboxRuntime.swift), soSSH_AUTH_SOCK, provider and GitHub tokens,DYLD_*, andCONTAINER_*never reach the runtime or the builder. The launchd job that runs each owner gets a fixedPATH/HOMEof its own.EnvForwardis for SSH sessions only. Output is size-bounded and deadline-bound. A timeout means the outcome is uncertain, not that the operation failed. Only builds, creates, and boots honour Ctrl-C; stop/delete/cleanup never do. -
Runtime binaries are resolved only from the user’s config or fixed install paths, never from
PATHor project files. After symlinks are resolved, the binary must be a regular executable file owned by the user or root and not group- or world-writable. Every ancestor directory must also be owned by the user or root, and must not be world-writable unless it is sticky, nor group-writable unless it is sticky or its group iswheeloradmin(whose members can already use sudo; Homebrew’s prefix isadmin-writable). The check reads mode bits only; an ACL that grants others write access is not detected.scripts/build-iso-sandbox.shsigns the runtime with the hardened runtime and refuses an installbin/that is owned by neither you nor root, world-writable, or group-writable by a group other thanwheeloradmin. The runtime runs with umask077and keeps its state directories0700and disk files0600. -
Guest-controlled text that isolate displays (host-key comments, runtime/guest error text, console-log excerpts, and
iso logsin both snapshot and--followmode) has its control characters replaced first. -
Local-model tunnels (
ProxyLifecycle.swift) are reconciled on every bootstrap, and every boot first closes those recorded for the previous boot. A tunnel the current model config no longer needs is closed, so switching local mode off really removes the guest’s path to the host server. Tunnel PIDs are only trusted or signalled whilepsstill reports them as ansshprocess. -
Ownership. Sandboxes and committed disks are named
iso-<owner8>-<random16>. Nothing is deleted unless the local owner record and the instance record both match, and the runtime refuses to delete a sandbox recorded for another owner tag. Theiso-prefix alone is never enough. -
Image build context is a private temporary directory holding rendered files and the VM-access public key only. There are no build args or secrets. The OCI build runs in stock
container’s builder. The result is imported into the runtime’s private store as an OCI archive, and the builder’s copy is deleted. -
Committed disks (
iso commit) have their SSH host keys and machine-id removed before they are saved, so instances created from them normally generate their own identity. This is not a uniqueness guarantee: the disk still boots guest-authored code, which can restore an identity it stashed. Pinning does not depend on it, since each instance’s key is read from that sandbox over its own control channel. The removal runs in a maintenance VM booted from a disposable clone of the maintenance image (never the guest’s own disk), with the committed disk mountednosuid,nodev,noexecas data. It refuses a symlinked/etcor/etc/ssh, and removes a symlinked key or machine-id rather than following it. Disk growth runs the same way. Maintenance VMs have no network, and whatever they run stays inside that VM. -
The maintenance image is built by
iso setuplike the instance image (stock builder, the same digest-pinned Ubuntu base and apt, so no new outbound URL), from a fixed recipe with no build context beyond its Dockerfile: Ubuntu plus e2fsprogs. The runtime unpacks it into its ownmaintenance/directory, records its version and digest, checks that it holds the programs the maintenance scripts run, and keeps it apart from the image store; the store copy is deleted. No application image is ever used for maintenance. -
Mutation integrity. Disk and resource changes follow the invariants in
design/apple-sandbox-transactions.md(INV-01…INV-10). The security-relevant ones:- no disk is replaced under a VM that can use it (the runtime’s per-sandbox guard covers owner startup, including launchd respawns);
- a rollback never overwrites a newer change;
- a host key is re-pinned only after a restore correlated with isolate’s own operation id.
Weakening any of these (skipping the guard, re-pinning on generation alone or guessing at unreadable staged state) is a finding.
macOS guests
iso-sandbox macos … runs macOS guests with computer use
(design), and iso drives them for
images built with iso setup --guest macos. The same rule holds: the guest
is untrusted, and the whole VM is the boundary.
- VM shape. The configuration is built in one place (
MacConfig.make): one display, one absolute pointer, one keyboard, one entropy device, one vsock device, the clone’s own disk, and one network device on a vmnet network of the runtime’s own. For a clone that is the sandbox’s10.231.N.0/24; for a template build it is a network used by that build alone. It refuses to boot with directory shares, audio, serial or console ports, a memory balloon, USB controllers, or any other network attachment.inspectreports the effective configuration. - Helper channel (guest → host). The guest helper’s messages are tainted.
They are line-bounded (64 KiB), limited to a closed message set, checked by
HelperMessage.parse, and authenticated by an HMAC over a host nonce and the guest boot ID, using a per-clone key that only root can read in the guest.- At most 4 unauthenticated connections are held at once. A hello must arrive within 10 s of wall-clock time, and rejections are logged at most 20 a minute.
- The key is readable only by root in the guest. The guest user has passwordless sudo, so the HMAC keeps out non-root processes, not the agent. An agent acting as the helper can affect only its own sandbox.
- Guest-authored strings are logged with control characters replaced.
- An unauthenticated claim never changes host state.
- Only an authenticated SSH host key that differs from the pin marks a
sandbox
identity_mismatch. - Guest-reported boot IDs only ever invalidate sessions.
- The host sends the guest exactly five message types:
challenge,enroll(helper key, authorized key, nothing secret from the host),network,statusandshutdown. The helper runs fixed tools with an argv and no shell.
- SSH pin. Each clone generates its own host keys at first-boot
enrollment. The runtime pins the key that arrives over the vsock channel,
re-checks it over the authenticated channel on
inspectand on every computer-use session, and exposes it asinspect.sshHostKey. Consumers must connect withStrictHostKeyChecking=yesagainst that pin, as the qualification driver does. There is nossh-keyscanand no TOFU. - Template build (accepted trade-off). Building a template uses one SSH
session that trusts the guest’s host key on first use, authenticated by a
random password held in memory only. The password reaches ssh through an
askpass child’s environment and sudo through stdin, never argv or logs. The
session runs on a vmnet network created for that build alone, so no other
VM can answer for the guest. It uses no user ssh configuration
(
-F /dev/null), no agent and no forwarding. The guest was installed from the operator’s IPSW moments earlier by the same process. The template ships no host keys and has password authentication off. - Frames (guest → host). A frame is guest-rendered pixels. The owner re-encodes it from the view’s bitmap at a fixed geometry and never parses guest-provided image formats. Uniform frames are refused.
- Input (host → guest). Actions are a closed, validated set (bounded coordinates, paths, key codes, ASCII text). They are synthesized into the view in-process and never posted to the host event system. The owner needs no Screen Recording or Accessibility permission.
- Guest computer use (vsock 7802). Off by default; the owner registers
the listener only for sandboxes created with
--guest-computer-use(iso:computer_use.guest_access), and the isolation gate accepts 7802 only when the record says so. Requests are tainted: lines of at most 64 KiB, a closed five-operation set (session,frame,act,status,wait) that refuses unknown fields,basedOnFramerequired on every action,waitbounded (one at a time per sandbox, at most 30 s, a region inside the display, cancelled by a host hold), the same action validation and frame binding as host callers, at most 2 connections, and per-sandbox rate limits (the configured 1–10 frames and 20 actions a second, awaitcosting one action, and 100 requests a second of any kind, refused ones included). Responses carry only the guest’s own framebuffer and fixed-shape metadata (including its display’s damage sequence);statusreveals only whether the host holds control, for how long, and that sequence. Input is synthesized into that VM’s view only. The host always wins: any host action, orcu hold, ends the guest’s session and refuses new ones until it is released or expires. Any guest process may connect; the guest is one principal and could drive its own desktop anyway. A guest that enables this can click its own consent dialogs, which changes no host policy. - Permission dialogs (
cu respond). Dialog text is guest-rendered pixels, recognized with Vision in theiso-sandboxCLI process, never in the owner. Recognized text only selects a candidate: the caller’s expectation (prompt family, exact requester name, folder, response) is the sole authority, and an unknown field or an unqualified family is refused. The responder sends one click at most, based on a re-observed frame, and never replays it; its output is fixed enums, with no recognized text. It answers only guest dialogs, and a guest can spoof one: this is an automation reliability contract inside the VM boundary, not a new boundary. - Live view (
cu stream). A host network listener, approved under the stop-and-confirm rule (design); this entry is the authoritative statement of its rules and limits. Off by default: the owner binds127.0.0.1on an ephemeral port only wheniso-sandbox macos cu streamasks over the control socket, and closes it on--stop, after 60 s with no viewer, and when the VM begins to stop, however that was asked (controlstop, a signal, session expiry, guest poweroff), after which none starts;inspectreportsliveViewListeningand the isolation gate accepts that field explicitly. Unlike the control socket, a loopback port is reachable by every process and local user on the Mac, so a per-start 256-bit token is the only gate: it travels in the URL fragment (sent to no server, in noReferer), arrives as the first WebSocket message within 5 s, is compared in constant time, and never appears in argv, logs or the audit. Before any token is read,Hostmust be exactly127.0.0.1:<port>(DNS rebinding) and the socket’sOriginexactlyhttp://127.0.0.1:<port>(cross-site WebSocket hijacking). The page is iso’s own, embedded, loads nothing from elsewhere, and is served withContent-Security-Policy: default-src 'self',X-Frame-Options: DENY,Cache-Control: no-storeandReferrer-Policy: no-referrer. The stream is H.264 encoded by the owner from the same bitmap as frames, so no guest-authored bytes reach the browser. At most 16 connections are served at once, counted before any byte is read, so unauthenticated connections cannot use up the owner’s threads or descriptors; past that a connection is closed unread. An HTTP request head is at most 8 KiB, and a viewer whose socket accepts nothing for 10 s is disconnected. A viewer that falls behind loses frames up to the next keyframe, asked for once when its queue has drained; replies it does not read (pongs, state) are never buffered past the same 8 MiB, it is disconnected instead. At most two viewers; client messages are at most 4 KiB, a closed set of flat objects that refuses unknown fields and deeper nesting unparsed (the first, unauthenticated message included), and limited to 100 a second, pings (at most 125 bytes) among them, with a separate 100 a second for what lets go of input (key up, button up, release of control), so a release is not dropped behind a burst of moves; rejections are logged by kind only, at most 20 a minute. A viewer starts view-only; Take control takes the host hold (ending the guest’s session) and each input extends it to 60 s, so a closed tab cannot hold a display. Viewer input is a second closed set (bounded pointer, scroll, a fixedKeyboardEvent.codetable,type-rule text for paste, at most 2000 characters a message) synthesized into that VM’s view only; nothing touches the host pasteboard or event system, and held keys and buttons are released on release, disconnect, hold expiry and stream stop. A paste is typed a key at a time, each key only while its viewer still controls, so it ends with a release, a disconnect or a stream stop. Remote viewing throughiso hostis not offered. The audit recordsboundary.live_viewcounts only, once per boot: asiso stopobserved them, or, for a boot that ends another way (session expiry, guest poweroff, an owner crash, a failed stop), as its owner last wrote them. An owner writes its changedboundary.live_viewandboundary.guest_computer_usecounts to the sandbox’sboot-counts.jsonevery 30 s and when it stops;inspectlists the boots that have ended asendedBoots, and the nextisocommand that inspects the instance records each one it has not recorded (computer-use-audited.jsonin the instance directory holds the boot ids). The list is read with the bounds of a running owner’s report, and nothing in it fails the inspection.iso-sandbox cu streamis not anisocommand, so nothing is recorded while the boot runs. - Control socket. It sits in the per-user
iso-sbxdirectory, mode 0600, and accepts only the owning uid (getpeereid), as for Linux owners. - Stop and TTL. A guest cannot wedge a stop. Each host write to the helper channel is bounded by its request’s deadline (a write that times out drops the connection), the helper shutdown is abandoned after 20 s in favour of a forced stop, and the owner exits (ending the in-process VM) 240 s after the stop sequence begins if the VM has not stopped by then. A stop request, TTL expiry or signal that arrives while the VM is still starting is held and runs once the start completes (the owner also exits 240 s after such a request if the start never completes).
- Host CLI.
isohands out a macOS guest only afterIsolationGate.verifyMacEffectiveaccepts the owner’s report: the record’s owner, template, network mode and resources; one display; no shares, audio, serial, USB or console devices (a clipboard needs one); only the clone’s own disk; only the helper’s vsock listener; and the dedicated10.231.N.0/24network and address. The owner reads these from the configuration the VM booted with and the listeners it registered. Unknown effective fields fail closed. At boot the guest helper must also have confirmed the pinned host key; later handoffs rely on that pin, which the instance’sknown_hostsenforces, so a slow or reconnecting helper does not block them, though anything it reports must still match the boot. The SSH pin comes from the runtime (inspect.sshHostKey), never from the network, and later boots require the same key. The one installation public key (vm_key.pub) is the authorized key given at create; no host secret is given to the guest. - Template provisioning (accepted trade-off).
iso setup --guest macosgives the build a root script (MacProvision) that fetches the Command Line Tools throughsoftwareupdate, a GitHub CLI release pinned by checksum, and the Claude Code and Codex installers from the same URLs the Linux image uses. It runs on the build’s own vmnet network before the template is sealed; the template records the script’s SHA-256 and iso refuses a template whose recorded script differs. The script setsAcceptEnv *, as the Linux image does, so the forwarded aliases reach the guest. - Filtered egress. As on Linux: a host-only network with no route, the
iso-egresscompanion behind anssh -Rtunnel on guest loopback, and the signed readiness proofs, read from the macOS sandbox’s own runtime directory. The guest probe uses/usr/bin/perl’s alarm and/bin/cat, which both guest systems have. Command-line tools use the forwarded proxy variables; GUI applications do not read them and fail closed.
Linux guests with a display
Instances of desktop images (design)
reuse the macOS guests’ computer-use paths above, with these differences:
- Devices. The VM gains a virtio-gpu scanout, a USB keyboard and a USB screen-coordinate pointer, added by the owner from the sandbox record’s display mode, never from guest data. The live inventory must show exactly that one graphics device and scanout; a headless sandbox still refuses any. The hypervisor-exposed surface (virtio-gpu, xHCI) is Virtualization.framework’s.
- Kernel. These VMs boot a second, iso-built kernel pinned by SHA-256
separately from the qualified one (
KernelPin.desktopAllowed), re-checked at every boot. Neither pin admits the other kernel. - Frames (guest → host). The owner reads the IOSurface VZ renders the
scanout into: it checks the surface’s size and pixel format, which VZ
sets, copies a fixed-size buffer and forces the alpha byte. It parses
nothing guest-authored. The lookup depends on
VZVirtualMachineView’s private structure; a miss refuses the frame (blank_frame) and never falls back to another capture. - Binding. A Linux guest cannot reboot inside its VM, so a session’s guest boot is the owner’s host-generated boot ID; nothing guest-reported takes part.
- Guest computer use (vsock 7802). As for macOS guests, and only for a
sandbox created with it; the isolation gate requires
vsockPortsto be exactly[7802]then and[]otherwise. The guest’s MCP server isiso-cu-mcp, iso’s own code from the verified release; it runs in the guest and is untrusted there like any guest process. - Live view and audit. The live view is the macOS guests’ listener,
under the same rules; a display owner’s
inspectreportsliveViewListeningand, asruntime, this boot’s guest computer-use and live-view counts, whichiso stoprecords asboundary.guest_computer_useandboundary.live_view; a boot that ends withoutiso stopis recorded fromendedBoots, as a macOS guest’s is. A headless instance reports and records neither. - Image. Ubuntu packages for the display path, and Firefox from
Mozilla’s apt repository: its key must match a pinned fingerprint, and
apt takes only
firefoxfrom it (pinned above Ubuntu’s) and never installs its other packages (build-time trust in that one package, like the NodeSource and Docker repositories). No capture, input or encoder package. Setup copiesiso-cu-mcpinto the build context only if it is an arm64 Linux ELF, and hashes it into the image identity. - Release. The archive carries
iso-cu-mcpandvmlinux-desktop(not codesigned: they are Linux files), covered by the archive’s signature and checksums and byBUILD.json’s hashes; the release build refuses an unpinned kernel.install.shandiso updateinstall both files when the archive carries them and remove installed copies when it does not. Building them fetches, at release or source build only and never from an installediso: the kernel tarball fromcdn.kernel.org(SHA-256 pinned), the Static Linux SDK fromdownload.swift.org(checksum pinned), the build image from Docker Hub with packages fromsnapshot.ubuntu.comandports.ubuntu.com(digest pinned), and, when no Swift checkout holds it, the base kernel configuration from theapple/containerizationrevisioniso-sandbox/Package.resolvedpins (SHA-256 pinned). The release and candidate workflows build the kernel in a separate job on an arm64 Linux runner (.github/workflows/desktop-kernel.yml), because GitHub’s hosted macOS runners cannot start a build VM; that job fails on a kernel that is not pinned, andscripts/build-release.py --desktop-kernelchecks the kernel and its source tarball against the pins again before it archives them. A local build runs the same script under Applecontainer.
iso update trust chain
Self-update (Update.swift, UpdateRelease.swift) must preserve, in order:
-
Metadata from the pinned
chr33s/isoGitHub repo (compile-time const). -
normalizeTag— the version tag is validated as semver before it enters the API URL path (path-traversal guard). -
Mandatory signature.
SHA256SUMS.sigmust be present and must be an OpenSSHSSHSIG(ssh-keygen -Y sign) over the exactSHA256SUMSbytes, in namespacerelease-sums@chr33s, by a key in the compiled-inReleaseSigners.keys(ReleaseSignature.swift); nothing inSHA256SUMSis read before it verifies.install.shchecks the same list withssh-keygen -Y verify. This is the provenance floor that does not depend ongh, and it holds in test mode too.The key is a maintainer’s SSH key, used from their ssh-agent or a key file under
~/.ssh, and never in CI:release.ymlpublishes a draft, andscripts/sign-release.pychecks the draft’s digests and pinned attestation before signing and publishing it. The key list is compiled in rather than fetched fromgithub.com/<user>.keys, so a GitHub account compromise alone cannot re-key updates. It lives in three places —ReleaseSigners.keys,.github/release-signersandALLOWED_SIGNERSininstall.sh— whichsignerListAgreesAcrossBinaryInstallerAndSigningScriptkeeps equal. Rotation: a release signed by a listed key ships a binary that also lists the next key; the old key is dropped in a later release. Losing every listed private key strands installed binaries on their current version (reinstall throughinstall.sh), so keep a second, offline key listed. -
Mandatory checksum. The
SHA256SUMSasset must be present (install is refused otherwise) and every downloaded tarball is verified against it (verifySHA256, fixed-size digest compare). -
Best-effort attestation.
gh attestation verify --repo chr33s/iso --bundle attestations.jsonl(Sigstore provenance), against the bundle asset downloaded from the same release.--bundlemeans no attestations-API call and no credential —ghmarks the flagDisableAuthCheckFlag, so no token orgh auth loginis needed. The bundle asset is fetched with a deliberately unauthenticated request (a barecurlinUpdate.swift,download_bundleininstall.sh) rather than throughdownload_asset/gh release download, which would re-attach the very credential this transport exists to avoid — a SAML-restricted token would then 403 on the fetch and drop the chain back to the API path. Keep both fetches credential-free. It is not offline: without--custom-trusted-root,ghstill reachestuf-repo.github.comand the Sigstore public-good CDN for the trust root (one-day cache) and fails if neither is reachable.It does not weaken the check materially, but the two transports are not interchangeable, and the differences are worth stating rather than arguing away:
- The bundle path accepts a superset. The API path only returns
attestations registered in the repo’s attestation store, so minting one
requires
attestations: write. The--bundlepath accepts any correctly-signed bundle sitting in a release, which requires onlycontents: write. - The bundle path is unrevocable.
DELETE /orgs/{org}/attestations/digest/{digest}exists, Fulcio certificates carry no CRL or OCSP, and nothing ingh’s verification path consults a revocation source — so a bundle already saved by a client keeps verifying indefinitely after the attestation is deleted.
What still defeats a substituted bundle is the subject-digest binding —
ghdigests the artifact and requires a matching subject — plus the signer pin. Both clients pass--cert-identity https://github.com/chr33s/iso/.github/workflows/release.yml@refs/tags/<tag>,--source-ref refs/tags/<tag>and--deny-self-hosted-runners(Provenance.verifyArguments,signer_pinininstall.sh), on the bundle and the API path alike. A bundle minted by any other workflow inchr33s/iso—candidate.ymlalso holdsattestations: write— or byrelease.ymlfor a different tag, or on a self-hosted runner, is refused.--repoalone would accept all of those.A release that publishes no bundle asset — or one whose download fails, or whose bundle is empty — falls back to the API path, where
ghrequires a credential authorized for the org even though the store itself is anonymously readable.Update.swiftandinstall.shtreat all three identically, because for a client they are one situation: no bundle to read. An empty bundle is rejected rather than passed through becauseghbefore 2.56.0 (cli/cli#9541) reports success on one, having verified nothing;release.ymlalso fails the release rather than publish one. A bundle that downloads and fails to verify is refused outright, not retried through the API — that is no stricter on integrity, but a digest mismatch, a corrupt download and an unusableghall surface here, and switching transports would mask them. Skipped with a logged note ifghis absent, and skipped entirely whenISO_UPDATE_API_BASE_URLis overridden (test mode). So Sigstore provenance is not guaranteed on hosts withoutgh— the signature is the floor there. - The bundle path accepts a superset. The API path only returns
attestations registered in the repo’s attestation store, so minting one
requires
-
Extraction with
tar -xzf --no-same-owner --no-same-permissions(path-escape safe), then an atomicrename-over-self.
Neither signature layer can be revoked once a client holds it, so withdrawal
is by the next good release: anti-rollback refuses any target older than
the running binary — pinned --version and --force alike — unless
--allow-downgrade is passed, and ReleaseRevocations.digests lists archive
digests that are refused before the checksum is even compared. Together an
updated binary never moves back onto a withdrawn release without an explicit
opt-in. install.sh installs whatever VERSION names and has neither guard;
it is the deliberate recovery path.
ISO_UPDATE_API_BASE_URL is honored only by update-fixture test builds
(-D ISO_UPDATE_FIXTURES, used by tests/integration-update.sh); a
production build refuses to update, or run the background check, while it is
set, before any network request. In a fixture build it redirects the origin
and disables attestation; the release signature is still required. In
production, release metadata must carry the canonical tag (and exactly the
pinned one for --version), and every asset used must be the one asset of its
name at exactly https://github.com/chr33s/iso/releases/download/<tag>/<name>;
curl requests and redirects are HTTPS-only and a token never follows a
redirect to another host. Only the pinned github.com default + attestation
provide Sigstore provenance. Flag any change that widens where that override
is honored, or that softens any step above.
Authorization policy
policy (policy.md, design/iso-policy.md)
only narrows existing permissions. Its trusted inputs are the host operator,
the configuration, host-owned state (policy-binding.json,
policy-instance.json, stage manifests after bounded parsing), and the
proxy startup document on stdin. The principal is the instance and VM boot,
bound by the host at launch: guest headers, timestamps, claimed approvals and
claimed identities are never inputs. The proxy re-validates the policy it
receives and checks its digest; the host verifies a version 3 signed
readiness reply binding boot, epoch, digest and proxy generation before the
guest gets a capability. Missing or corrupt enforcing state fails closed;
nothing downgrades an enforcing launch to an older protocol or a raw-key
path. Approvals are an in-process receipt from an explicit answer at the
controlling terminal — never a file, token, flag, environment variable or
guest callback. The policy digest identifies content; it is not a signature,
and this feature does not defend against the host administrator.
Experimental: paravirtualized Core AI (off; outside the stated boundary)
coreai (coreai.md,
design) is the one iso feature that
weakens the host to strengthen the guest. It is off by default, refused
unless acknowledge_reduced_host_security is true, and never part of a
release:
- AMFI relaxed.
com.apple.private.virtualizationloads on a non-Apple binary only with AMFI relaxed (amfi_get_out_of_my_way-class boot-args), which turns code-signing enforcement off for every process on the host, not onlyiso-sandbox-coreai. The Enhanced Security entitlements of the other iso executables are still present but no longer verified. iso never changes boot-args or SIP: the owner’s preflight reads them, refuses a fully secured host, and the boot is audited ashost.security.reduced. - Shared hardware. The guest reaches the host GPU and Neural Engine drivers through paravirtual devices. A bug there is a guest→host escape class Gate O otherwise excludes. The gate still requires exactly the recorded accelerator classes, read back from the booted configuration, and the owner’s reduced-host preflight; any other device fails as host exposure.
- Private API. Classes and selectors are resolved at run time and only
in the
-DISO_COREAIbuild; absent means unavailable, never a crash. The release verifier refuses anycom.apple.private.*entitlement and theiso-sandbox-coreaibinary. - Guest-authored report. The helper’s
coreai_statusreply (compute kind names, delegate flag) is bounded by the protocol, re-checked by the host, and used only for theupline and the audit.
Documented, accepted trade-offs
These are deliberate and documented in AGENTS.md /
docs/ARCHITECTURE.md. Don’t “fix” them without
understanding the rationale; do flag a change that widens them:
- Enforcing quotas trade proxy recovery for no cross-boot state. An enforcing boot never relaunches its proxy (that would reset its quota); provider access is lost until the next boot. Quotas reset at every boot.
- Native agent installers are trusted build inputs. Provisioning fetches
Claude’s installer from
claude.aiand Codex’s fromhttps://chatgpt.com/codex/install.shover HTTPS, then runs them as the configured guest user. Provisioning runs inside thecontainer buildbuilder VM, and live agent updates inside the instance VM. This build-time trust is distinct from the untrusted guest boundary described above.
Stop-and-confirm checklist
Stop and get explicit human confirmation before merging a change that:
- adds an outbound URL, a network listener, or an egress/
FORWARD/NAT rule — name the boundary it crosses and what authenticates it; - forwards a new secret into the guest, or makes an existing one persistent inside the guest;
- runs a host subprocess on tainted (guest- or fetch-derived) bytes — no shell
strings; use a
ProcessRunnerargv /RemoteCommand.arg; - writes a host filesystem path derived from tainted data — validate against traversal first;
- logs or traces tainted or secret content — that channel becomes an exfiltration path;
- softens any step of the
iso updateverification chain; - widens the host-control boundary — a new host-agent entrypoint or argument, a frame field that names a path or command, a durable grant or bearer, or a relay destination not taken from native proof.