Documentation Index
Fetch the complete documentation index at: https://docs.microsandbox.dev/llms.txt
Use this file to discover all available pages before exploring further.
New features
Rotation-aware log streamingSandbox.log_stream / logStream / LogStream lands in the Rust, Node, Python, and Go SDKs, alongside read_logs for sorted snapshots. The engine merges exec.log, runtime.log, and kernel.log including their rotated siblings, and each entry carries an opaque cursor so consumers can resume after a disconnect. msb logs and msb logs -f now ride the same engine; if a follower falls behind retention it receives a typed MissedRotation error with a hint to restart instead of silently skipping records.
AgentClient surface lets SDK callers talk to a sandbox’s agentd directly through the relay, sending and receiving framed CBOR without going through the typed sandbox API. Rust ships both a typed tier (with a validated core.ready handshake and cached ready bytes) and a raw tier; Node, Python, and Go expose the raw tier and keep CBOR encoding in userland. Useful for experimenting with new agent operations or building higher-level tooling on top of the protocol.
stat_virtualization chooses between Strict, Relaxed, and Off, and host_permissions chooses between Private and Mirror. Defaults stay Strict + Private, so existing sandboxes are unchanged. The new combinations make it possible to bind-mount foreign-owned read-only paths like /tmp, mirror guest chmod bits to the host inode, and create real host-visible symlinks from inside the guest. The --mount flag gains tag:host[:ro][,stat-virt=...][,host-perms=...] for opting in.
See Sandbox filesystem.
Network policy CLI consolidation
The egress and ingress flags collapse into one consistent surface. --net-default <allow|deny> sets both directions at once, *.foo.com is now accepted as a suffix shorthand inside --net-rule targets, and --no-net is sugar for --net-default deny (it now also blocks ingress, matching its name). TLD-broad patterns like *.com are rejected at parse time so they cannot widen blast radius by accident. --deny-domain and --deny-domain-suffix are removed; express the same intent with --net-rule "deny@..." plus --net-default allow.
BIND_ADDR:HOST:GUEST and /udp variants, and the Rust, Python, TypeScript, and Go SDKs gained matching bind-aware port APIs. Existing HOST:GUEST mappings continue to bind to 127.0.0.1.
--script flag
msb create --script NAME=BODY now produces a runnable script: the body is wrapped with a shebang derived from --shell (default /bin/sh), and the escapes \n, \t, \r, \\, \", \' are decoded so multiline scripts survive normal shell quoting. A new --script-raw NAME=BODY writes the body byte-for-byte for callers that bring their own shebang. --shell rejects empty, whitespace, and NUL values at parse time so a stray newline cannot inject lines into every generated script.
- Passthrough secret violation action. A new
Passthroughviolation policy forwards requests containing secret placeholders without substituting the real value, scoped to a configurable list of host patterns. Useful for letting non-sensitive traffic flow to hosts that happen to share placeholder syntax. See Sandbox secrets. - Python exec keyword arguments.
sandbox.exec("python3", ["script.py"], cwd="/app", env={...}, timeout=30.0)now works directly, instead of requiring anExecOptionsdict. See the Python SDK reference. - Configurable guest IP pools. Deployments can override the default IPv4 and IPv6 guest pools, and the default IPv4 pool changes from
100.96.0.0/11to172.16.0.0/12to avoid colliding with Tailscale. msb startaccepts variadic sandbox names. Start more than one sandbox in a single command.- Agent relay supports up to 128 concurrent clients. Raised from 16. The relay also reports its correlation-ID range size to each SDK during the handshake, so a future bump will not silently misroute frames on older clients.
- Configurable shared-memory metrics registry. Live per-sandbox metrics now live in a POSIX shared-memory segment instead of SQLite, removing steady-state writes to the catalog database. Capacity is tunable via
metrics.capacityin~/.microsandbox/config.json; the public metrics API is unchanged. See Sandbox metrics.
Bug fixes
- TLS interception no longer fails on long-lived sandboxes; cached per-domain leaf certificates are now refreshed before they expire.
- Sandbox writes are flushed to disk on
msb stopandsandbox.stop(); previously the host could tear down the VM before the guest synced ext4, occasionally losing in-flight writes across stop and start. As part of this fix,replace_with_graceis renamed toreplace_with_timeoutacross the CLI, Rust, Python, Node, and Go SDKs, andstop_with_timeout/connect_with_timeoutare now available onSandboxHandle. - The microsandbox CA is now installed into guest trust directories with mode
0755, creating those directories first when they are missing, so distro trust-store refreshes pick it up. msb logs --follow --jsonemits JSON Lines for the follow records, not just the initial snapshot, so streaming consumers no longer hit a parse error mid-stream.- Request bodies that arrive already content-encoded (gzip, brotli, deflate) are preserved verbatim during secret substitution instead of being silently rewritten.
msb run ./pathand other dot-prefixed inputs are now recognized as local image inputs instead of being interpreted as registry references.- Sandboxes with large environment-variable payloads no longer overflow at startup.
AllSandboxMetricsin the Go SDK reports the real uptime instead of zero.- Several
--net-rulesuffix entry points now reject TLD-broad patterns like*.comat parse time, with a clearSuffixTooBroaderror.