Platform Backends
Host support: This fork supports macOS 27+ on Apple Silicon only. Linux guests remain supported.
isolate has one backend: Apple Containerization on macOS 27+ Apple Silicon. There is no backend selection; unsupported operations fail explicitly.
macOS / Apple sandbox
The host CLI is built from the root Swift package (swift build, or
python3 scripts/build-release.py for the full archive). iso-sandbox is isolate’s runtime on Apple’s
containerization package
(iso-sandbox).
Each instance is one Linux VM running systemd from its own ext4 disk, on its own vmnet network (or, with network.transport: "brokered", with no network device), with no host mounts, socket relays, published ports, or host SSH-agent forwarding. The runtime’s sandbox record has no field for any of those, and isolate verifies the running VM’s effective configuration before every hand-out. design/apple-sandbox-runtime.md records why this replaced the earlier container machine fork.
Prerequisites
- Apple Silicon, macOS 27 or later. The runtime’s underlying vmnet API has a macOS 26 floor, but this fork’s supported host minimum is macOS 27.
iso-sandbox, built withscripts/build-iso-sandbox.sh(Xcode 27 and Swift 6.4 required).- Stock Apple
container1.7.1 or later, with its service running (container system start). isolate uses it only to build images (container build) and to supply the guest kernel it installs; instances never run on it. isolate never starts, stops, or restarts that service.
Binaries come from apple_container.binary (iso-sandbox) and apple_container.builder (container), or else fixed install locations: ~/.local/opt/iso-sandbox/bin/iso-sandbox, /usr/local/bin/iso-sandbox, /opt/homebrew/bin/iso-sandbox, and /usr/local/bin/container, /opt/homebrew/bin/container. PATH and project files are never consulted, and a binary that is group/world-writable or owned by neither you nor root is rejected, as is one under a directory that is owned by neither you nor root, world-writable without the sticky bit, or group-writable without the sticky bit unless its group is wheel or admin (Homebrew’s prefix is admin-writable).
Host Docker is not needed. Docker runs inside the guest.
Installing the runtime
scripts/build-iso-sandbox.sh # installs ~/.local/opt/iso-sandbox/bin/iso-sandbox
It builds the Swift package in release mode, signs it ad hoc with the hardened runtime, the Enhanced Security entitlements and com.apple.security.virtualization (iso-sandbox/iso-sandbox.entitlements), and installs it without sudo. It refuses an existing bin/ that is owned by neither you nor root, world-writable, or group-writable by a group other than wheel or admin. Pass a different prefix as the first argument and set apple_container.binary to match. Rebuild after pulling changes to iso-sandbox. --experimental-coreai instead installs the unreleased iso-sandbox-coreai, whose private entitlement needs a host with AMFI relaxed; see coreai.md. isolate accepts protocol 5 with containerization 0.54.0 and refuses any other protocol or containerization version.
Supported combinations
| iso-sandbox | containerization | macOS | Hardware | Evidence |
|---|---|---|---|---|
| 0.1.0 (protocol 5) | 0.54.0 | 27.0 | Apple Silicon | Requires the network mode and live bootId. Filtered egress also binds the live owner identity to its boot policy. Full filtered qualification remains open (evidence). |
The runtime also pins its guest kernel by sha256 (vmlinux-6.18.56-208-debug, sha256 98a1005f…f7511, the Kata 4.3.1 kernel container 1.7.1 installs) and its init image (vminit:0.54.0 by digest). iso setup fails with APPLE_RUNTIME_UNAVAILABLE on any other kernel.
Instances of desktop images boot a second kernel with the virtio-gpu and USB input drivers, pinned separately (KernelPin.desktopAllowed). Releases install it beside iso-sandbox as vmlinux-desktop, with iso-cu-mcp; from source, build it with scripts/build-desktop-kernel.sh OUT_DIR and set apple_container.desktop_kernel to OUT_DIR/vmlinux-desktop. scripts/build-iso-sandbox.sh also builds iso-cu-mcp with the Swift Static Linux SDK; on a host that cannot (Xcode’s own Swift rather than the swift.org toolchain, or no network to fetch the SDK) it warns and skips it, and only desktop images are unavailable. Every other instance keeps the kernel above; neither kernel is accepted in the other’s place.
Configuration
{
"apple_container": {
// "binary": "/absolute/path/to/iso-sandbox",
// "builder": "/absolute/path/to/container",
// "kernel": "/absolute/path/to/vmlinux", // must be a kernel the runtime pins
// "desktop_kernel": "/absolute/path/to/vmlinux-desktop", // a pinned desktop kernel, for `desktop` images
"probe_timeout_seconds": 10, // version, inspect, list
"operation_timeout_seconds": 60, // resource changes, deletes, guest commands
"create_timeout_seconds": 600, // create (first unpack of an image), grow, commit, restore, init, maintenance install
"boot_timeout_seconds": 120, // boot to SSH-ready
"stop_timeout_seconds": 90, // clean systemd shutdown
"build_timeout_seconds": 3600 // image build; `setup --builder-timeout` overrides
}
}
Each timeout must be between 1 and 86400 seconds. Unknown keys are rejected, and there is no key to mount the home directory, forward the SSH agent, share a network, or skip qualification. The vm CPU/memory, image, guest-user, profile, and workspace settings apply; vm.template_size_gib is the default disk size.
Instance-image APT update/install commands show download output, retry transient
repository failures twice, and use 30-second HTTP/HTTPS connection and data
timeouts. These do not extend build_timeout_seconds or bound native agent
installers separately.
State
Configuration defaults to ~/.iso/config.jsonc, and data_dir defaults to
~/.iso. An explicit --config path must exist. The default data root must
be a real directory when present; symlink and regular-file roots are refused.
Custom configuration may select a separate data_dir.
The local secret store (iso secrets) lives in <data_dir>/secrets/.
Backend state remains under <data_dir>/backends/apple-container-v1/:
owner.json(installation owner ID) andvm_keyimages/<name>/:template-config.json,apple-image.json, andbuild.loginstances/<name>/:apple-machine.json,known_hosts,operation.jsonwhile a mutation is pending,audit.jsonl(boundary audit),computer-use-audited.json(the boots whose computer-use counts the audit holds), and the shared sidecarsaudit/v1/: the run history (audit.md), kept outside instance directories so it outlives themruntime/, the iso-sandbox state root: kernel, init filesystem, private OCI store, cached base disks, committed disks, the maintenance boot disk (maintenance/), lock files (locks/), and one directory per sandbox (disk, record, console and owner logs, launchd plist, andboot-counts.jsonfor a display sandbox); macOS templates and sandboxes undermacos/templates/andmacos/sandboxes/images/<name>/macos-provision.shfor a macOS image: the provisioning script its template was built with
Control files are 0600, directories 0700. uninstall --purge destroys
owned instances and removes only backends/apple-container-v1/; config files,
the secret store (<data_dir>/secrets/) and unrelated files remain. Workspace copies skip .iso/. The
iso-<name> SSH aliases use # iso START / # iso END markers. Explicit
user aliases with the same name are refused. Paths may contain spaces but not quote or control characters.
Host records require the current schema and backend identity. Machine sidecars
also require an explicit lifecycle (reusable or disposable); unknown or
missing values are refused. A macOS instance’s sidecar adds
guest_os: "macos"; Linux sidecars omit it. A fresh installation does not adopt older state.
Fork macOS releases use this backend and include iso-sandbox beside iso.
The host prefers that adjacent runtime, then the manual install locations; an
explicit apple_container.binary still takes precedence. iso update targets
chr33s/iso.
Setup process
iso setup:
- Checks the platform, resolves and qualifies iso-sandbox (
iso-sandbox version: protocol 5, containerization 0.54.0), and createsowner.jsonand the VM-access key pair. - Initializes the runtime root: copies the kernel after checking its pinned sha256, and pulls the pinned init image. Unless the runtime already has the current maintenance image, builds it (Ubuntu with e2fsprogs; log in
maintenance-build.log), installs it withiso-sandbox maintenance install, and deletes the store copy. - Renders a minimal build context in a private temporary directory: a Dockerfile
FROM ubuntu:24.04pinned by digest, the Apple provisioning script (packages, profiles, OCI features, guest user, Claude Code, Codex, Docker), and a machine-setup script. The context contains the isolate public key only. There are no build arguments and no secrets. - Checks that the builder’s service is running, then runs
container build --platform linux/arm64 -t local/iso-<owner>:<hash>-<nonce>, with output inimages/<name>/build.log. Every build gets a fresh tag, so a rebuild never retags an image in use. - Saves the image as an OCI archive, imports it into the runtime’s private store, and deletes the builder’s copy.
- Boots the image in a disposable sandbox with no credentials, passing the same isolation gate an instance does. It checks the required guest binaries and the guest user’s uid (1000), and waits (up to
boot_timeout_seconds) forsshanddocker. Then it stops and deletes the sandbox. The unpacked disk stays cached for the firstiso up. - Records the image digest and input hash in
apple-image.jsonandtemplate-config.json. A failed build or verification deletes the new image and leaves the previous manifest and image in place. After a successful rebuild, the superseded image is deleted.
The image carries no SSH host keys and an empty /etc/machine-id. Each sandbox generates its own on first boot and keeps them across restarts. sshd refuses passwords and root logins and disables agent forwarding. Units that would fight the runtime’s addressing (networkd, resolved, udevd, timesyncd) are masked.
Marketplaces and plugins are not baked into the image. The first boot installs the configured claude and codex ones through the shared bootstrap; a profile’s marketplaces and plugins are not applied.
How instances work
iso up creates one sandbox per instance, named iso-<owner8>-<random16>. The steps:
- Write
operation.json. iso-sandbox createwith explicit CPUs, memory (MiB), and disk (--disk, or the committed image’s size, orvm.template_size_gib). The disk is an APFS clone of the image’s cached base, so this takes milliseconds after an image’s first use.- Check the runtime’s record: owner tag, CPUs, and memory.
iso-sandbox startloads the sandbox’s owner as a launchd job, explicitly requests startup withkickstartwithout-k, and returns once the owner answers. A loaded but deferredRunAtLoadjob is not readiness. The owner process holds the VM and a dedicated10.231.N.0/24vmnet network.- The isolation gate reads the effective VM configuration from the owner and checks all of the following:
- The sandbox runs
/sbin/init, without nested virtualization. - It boots from its own disk under
runtime/sandboxes/<id>/. - Its only mounts are the kernel pseudo-filesystems (
proc,sysfs,devtmpfs,mqueue,tmpfsat/dev/shm,cgroup2,devpts) from their fixed sources. - It has no socket relays, published ports, or agent forwarding.
- It has exactly one interface, on its own vmnet subnet, carrying the address the owner reports.
- Its CPUs, memory, and image digest match the record.
- The sandbox runs
- Read
/etc/ssh/ssh_host_ed25519_key.pubover the runtime’s native control channel (vsock exec, an argv rather than a shell string), confirm the owner did not restart meanwhile, and pin the key in the instance’sknown_hosts. - Connect over SSH with
StrictHostKeyChecking=yesagainst that pin, then hand off to the shared lifecycle: forwards, credentials, agent bootstrap, workspace copy, hooks.
Every later ssh_target (shell, exec, agent launch, push/pull, editor) re-inspects the sandbox and re-runs the gate before it returns a target. A sandbox keeps its address across restarts, unless its subnet had to be quarantined (see Recovery). Every start compares the host key with the pin. A changed or missing key fails with APPLE_HOST_KEY_CHANGED, and isolate never re-enrolls on its own. The one exception is iso restore: isolate replaced the disk itself (which removes the host keys), so the next start pins the key the guest generates.
Workspaces are always copied. --mount directories are synced once; use iso push/iso pull.
Brokered instances (network.transport: "brokered")
differ in steps 2, 4, 5 and 7:
iso-sandbox create --network brokeredrecords the mode and allocates no subnet.iso-sandbox start --network-policy <digest>records the boot’s network-policy digest. The owner builds the VM with no interface, reads the liveVZVirtualMachineaftercreateand before the guest’s init runs, and stops it unbooted unless it has no network device and exactly one socket device. It then serves a0600stream socket beside its control socket.- The gate requires
transport: brokered,networkDevices: 0,socketDevices: 1, no interface and no address, the runtime’s channel policy equal to iso’s own copy (and its digest equal to iso’s recomputed digest), and the boot’s network-policy digest equal to the one iso started it with. A vmnet sandbox reporting any of these fields is refused. - SSH uses
ProxyCommand=<iso-sandbox> connect --root <root> <id> --boot <boot> --channel-policy <digest> --network-policy <digest>and the pinned alias as its host name. The connector asks the owner for onesshstream; the owner admits it only for the live boot and those digests, within its stream limits, and dials guest vsock port 2222 itself. The managed~/.ssh/configalias carries the sameProxyCommand, so an alias from an earlier boot is refused untiliso up/iso startrefreshes it. iso-sandbox streams list --root <root> <id>reports, andstreams close --root <root> <id> [--session S]revokes, a running brokered sandbox’s open streams.
The runtime advertises this as the brokered-transport feature on protocol 5;
vmnet output is unchanged.
Local model servers on host loopback reach the guest over a per-instance ssh -R 127.0.0.1:<guest-port>:<host-addr>:<host-port> tunnel. The forward goes to the exact loopback address the URL names. The guest port is the same as the host port, except that a privileged port (below 1024) moves to port + 40000, so https://localhost becomes https://localhost:40443 in the guest. localhost and 127.0.0.1 URLs keep their host, so TLS names still verify. Other 127.x addresses are rewritten to 127.0.0.1 for plain HTTP only. IPv6-loopback endpoints are rejected. Every boot first closes the tunnels recorded for the previous boot. Each bootstrap then reconciles the tunnels for both agents: live tunnels are kept, tunnels the config no longer needs are closed, and two endpoints that need the same guest port with different destinations are an error.
Resize, commit, restore
All three need the instance stopped.
iso resize --mem/--vcpusrecords the new values withiso-sandbox set, tagged with an operation id, and reads them back. They apply at the next start. The change is journaled; an interrupted one is reconciled on the nextiso startfrom the runtime’s record. With--start, if the boot fails and the sandbox is confirmed stopped again, the previous values are restored through the same journaled update, and only if the runtime’s last committed operation is still the forward change; otherwise, or if the rollback cannot be confirmed, the result isAPPLE_OPERATION_UNCERTAIN. The guest sees one more vCPU than configured: the runtime’s own overhead.iso resize --disk(formerly--size) grows the disk offline. The runtime clones the disk, extends it, and runse2fsck/resize2fsin a short maintenance VM, with the instance’s disk attached as data. It then publishes the grown disk and its new size as one recoverable update (a crash between the two is finished by the runtime’s next operation on the sandbox), so this takes about a second. Shrinking is refused.- Maintenance image. Maintenance VMs boot their own small image (Ubuntu with e2fsprogs), which
iso setupbuilds with the stock builder and installs into the runtime outside its image store, then removes from the store. It does not depend on any instance’s image, so deleting or replacing images never affects growth or commits.iso setupreinstalls it when its recipe version changes. iso commit --image <name>saves an APFS clone of the disk with its SSH host keys and machine-id removed.iso up --image <name>andiso restorethen clone it, and every instance created from it generates its own identity.iso restoreswaps in a clone of a committed disk, or a fresh copy of a base image with--reprovision. It then grows the new disk back to the instance’s size if that is larger. The operation is journaled: a restore interrupted by a crash is reconciled on the nextiso startfrom the runtime’s record, and it re-pins the host key only if the runtime’s last committed operation is that restore (a higher disk generation alone is not enough).
Stop, destroy, recovery
- Stop.
stopasks systemd to halt (the runtime forces the VM down after 60 s) and confirms the sandbox reachedstopped. An unconfirmed stop isAPPLE_OPERATION_UNCERTAIN, and nothing is deleted. When the normal liveness check fails (an unqualified runtime, a sandbox that fails the gate, or an unfinished journal),iso stopstops the owned sandbox through the runtime alone, with no SSH and no qualification, and keeps its disk.iso statuslists such an instance asunknown. A boot that fails or times out duringiso startstops the sandbox again. - Interrupts. Ctrl-C interrupts only image builds, creates, and boots. Stop, delete, and cleanup commands always run to completion.
- Destroy.
destroyacts only on sandboxes whose names and local records match this installation’s owner ID; the runtime also refuses to delete a sandbox whose recorded owner differs. It stops and deletes the sandbox, confirms it is gone, then removes local state. If an operation was interrupted (operation.jsonexists),destroychecks what the runtime actually has and removes only what the journal says isolate created. - Crashed owners. The VM lives inside its owner process. If that process dies, the VM powers off (no VM is ever orphaned). The background user-domain launchd job relaunches after abnormal exits, booting the same disk even while the GUI session is locked, and leaves clean exits stopped (recovery checks). Journaled ext4 recovers on restart, but unsynced guest writes can be lost.
- Subnet leaks. After an unclean exit, vmnet keeps the sandbox’s subnet reserved for hours. The runtime then quarantines it and moves the sandbox to a free subnet, so its address changes while its identity does not.
- Image deletion. Only this installation’s images and committed disks are deleted. Instances never depend on them after creation.
Diagnostics
| Identifier | Meaning |
|---|---|
APPLE_RUNTIME_UNAVAILABLE |
No usable iso-sandbox or builder, builder service not running, kernel not accepted, or unsupported platform. |
APPLE_RUNTIME_UNQUALIFIED |
Unknown runtime, protocol, containerization version, or output schema (including an unknown field in the effective configuration). |
APPLE_NETWORK_ISOLATION |
Missing, extra, or foreign network interface, or an address that does not match; for a brokered sandbox, any network device, interface or address, or a boot started with another network policy. |
APPLE_HOST_EXPOSURE |
A host mount, socket relay, published port, agent forwarding, foreign root disk, or non-systemd init; for a brokered sandbox, a channel policy other than iso’s. |
APPLE_IDENTITY_CONFLICT |
Ownership, name, image, resource, or boot identity mismatch. |
APPLE_HOST_KEY_CHANGED |
Missing or changed pinned host key. |
APPLE_SESSION_EXPIRED |
The instance’s limits.session_ttl has passed. The owner halts the VM at the deadline; the host also refuses to hand out a sandbox whose deadline has passed. iso stop then iso start begins a new session. |
APPLE_BOOT_TIMEOUT |
Boot or readiness failed or exceeded its deadline, or no valid host key appeared in time; the error includes the last lines of the console log. Disk and journal are kept. |
APPLE_OPERATION_UNCERTAIN |
Timed-out or cancelled runtime call, unconfirmed stop, a booting or crashed sandbox, or an unfinished journal; reconciled on retry. iso list shows a crashed sandbox as stopped, since iso start accepts it. |
iso logs (snapshot and --follow) replaces control characters in the guest’s console output before printing it.
Runtime and builder commands run with a cleared environment: only HOME, USER, LOGNAME, TMPDIR, locale, and a fixed PATH pass through. SSH_AUTH_SOCK, API and GitHub tokens, DYLD_*, and CONTAINER_* overrides are dropped. The launchd job that runs each owner gets a fixed environment of its own. Guest-bound ssh, scp and rsync likewise inherit only a minimal host environment plus the values isolate forwards, so a user’s SendEnv patterns cannot leak an unrelated host variable.
Validation status
Validated on macOS 27.0 (Apple M5 Max) with iso-sandbox 0.1.0 and containerization 0.45.0, and on 2026-11-10 with containerization 0.54.0 (full integration suite: 298 passed, 2 opt-in skips); see the table above.
- Runtime (
tests/integration-apple-sandbox.sh; the selection experiment is indesign/apple-sandbox-runtime.md):- Peer isolation: a root guest cannot reach another sandbox by TCP, UDP, or ICMP over IPv4 or IPv6. That holds with forged on-link routes, static neighbour entries, spoofed source addresses, and broadcast/multicast, and after restarts; the host reaches each listener as the positive control.
- Host exposure: no mounts, agent sockets, host canary file, or host vsock listeners reach the guest, and a canary secret never reaches the runtime, its logs, the image, or the guest.
- Identity and lifecycle: pinned SSH over the native channel; 20 stop/start cycles with no loss of data or identity; CPU/memory changes, disk growth, and commit/restore.
- Recovery and scale: every crash-injection scenario ends in a known state, and 1/4/8 concurrent sandboxes each get their own address and subnet.
- isolate end to end: the suite’s
isophase coverssetup(build, import, verification),up,exec,status,stop/start,resize --size/--mem/--vcpus(the older spelling of--disk), rollback of a failedresize --start,commit,restorewith host-key re-pinning,destroy, and image deletion. Run by hand on 0.1.0 only:upwith an explicit disk,logs,up --imagefrom a committed image with a fresh identity, and rejection of a guest-changed host key.
Not covered: other macOS releases or kernels, and live-provider API calls.