Skip to content

Verifying the sandbox on macOS and Windows

The sandbox is unit-tested on every platform, and these scripts check a real machine end to end. Results so far:

Platform Runtime Result
Linux containerd 2.3.6, nerdctl 2.1.6 all checks pass
Linux, MOB_SANDBOX_ISOLATION=gvisor the same, with runsc release-20261005.0 all checks pass
macOS 27.0.1, Apple silicon Apple container 1.5.0 all checks pass
Windows 11 (10.0.26100) WSL 2.9.3 containers (wslc) all checks pass

Each script builds mob from the checkout, then checks the following and prints PASS/FAIL per check:

Check What it proves
container status the runtime CLI is found and its service answers
container pull image pull works; a FAIL with 429 is the registry rate limit, not Mob
env, bind mount, workdir -e, -v SRC:DST, -w are accepted, from a path containing a space
writes reach the host the bind mount is read-write
exit status a container’s exit code comes back
stdin with -i piped input reaches the container
--network none, --cpus 1, --memory 256m the limits take effect: only lo, one CPU’s quota (or one VM CPU), 256 MiB of memory
tool runs without approval mob serve --demo offers the sandbox tool and runs it in /workspace
workspace persists, the rest is discarded only /workspace survives between calls
workspace on the host it is data_dir/sandbox/<conversation>
nonzero exit, output capped the tool reports exitCode and truncated
limits apply sandbox.network, cpus and memory reach the tool’s containers
stop removes the container --name plus the runtime’s force-remove work
runs under gVisor (with MOB_SANDBOX_ISOLATION=gvisor) dmesg in the container reports gVisor, through the CLI and the tool

A failed run keeps its work directory (config, serve.log, workspaces) and prints its path.

Requirements: Apple silicon, macOS 26, Bun, Git.

  1. Install Apple’s runtime from the signed .pkg on the releases page, then start it:

    Terminal window
    container system start # accept the default kernel when asked
    container system status
    container run --rm alpine:3.20 echo ok
  2. Run the check from the checkout:

    Terminal window
    git clone https://github.com/fdkevin0/mob && cd mob
    scripts/verify-sandbox.sh
  3. Also try the real data directory, whose path contains a space (~/Library/Application Support/mob): add the sandbox: section from config.example.yaml with enabled: true, run build/mob serve --demo (bun run build:cli first), and in the web UI send /sandbox uname -a; pwd; ls /Users.

Requirements: Windows 11 with virtualization enabled, a WSL release that includes WSL containers, Bun, Git.

  1. Install or update WSL with containers, then check wslc:

    Terminal window
    wsl --update --pre-release # if wslc is not yet in the stable release
    wsl --version
    wslc run --rm alpine:3.20 echo ok
  2. Run the check from the checkout (PowerShell; Windows PowerShell 5.1 or 7):

    Terminal window
    git clone https://github.com/fdkevin0/mob; cd mob
    powershell -ExecutionPolicy Bypass -File scripts\verify-sandbox.ps1
  3. Repeat with your normal user profile path (%LOCALAPPDATA%\mob by default), as in step 3 for macOS, and send /sandbox ls /mnt/c — it must fail.

Requirements: containerd with nerdctl and CNI plugins, and runsc from gVisor’s install guide on containerd’s PATH.

Terminal window
runsc --version
sudo nerdctl run --rm --runtime runsc alpine:3.20 dmesg # prints "Starting gVisor..."
MOB_SANDBOX_ISOLATION=gvisor scripts/verify-sandbox.sh

The script’s full output, plus for any FAIL:

  • the runtime’s version (container --version or wsl --version);
  • serve.log from the kept work directory;
  • the output of the failing step run by hand, with --help for that subcommand (container run --help, wslc run --help, wslc rm --help), since the flags Mob uses are taken from documentation that may lag the CLI.