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
Go SDK A first-class Go SDK with full parity to the Rust, TypeScript, and Python SDKs: sandbox lifecycle, exec and PTY, filesystem, networking, secrets, snapshots, volumes, images, and event streams. The library uses CGO over a runtime-loaded FFI bundle, sogo get works without a Rust toolchain.
SEEK_DATA/SEEK_HOLE copying, so create and inspect stay fast. The CLI ships msb snapshot create | open | list | list-dir | remove | reindex | export | import | verify, and msb run --from <name|path> boots a fork. The same surface is available in all four SDKs.
--init hands PID 1 inside the guest off to systemd, OpenRC, s6, or any other init binary while the agent continues serving the host channel from a child process. Shutdown adapts to the new PID 1 (for example, SIGRTMIN+4 for systemd) with a SIGTERM fallback. All three SDKs gained matching init / initWith surfaces.
exec.log (JSON Lines) capturing stdout, stderr, and PTY output, readable via the new msb logs command and logs() SDK methods. Sandboxes that fail before the agent is ready now emit a structured boot-error.json that the CLI renders as a typed error block instead of a generic “process exited” message. Spawn-time exec failures are now reported through a typed ExecFailed message with kinds such as NotFound, PermissionDenied, NotExecutable, and OutOfMemory. The CLI exits 127, 126, or 1 per POSIX convention.
See Sandbox logs.
DNS queries are subject to egress policy
DNS lookups are now treated as a regular egress action rather than an exception. Under a deny-by-default policy with no rules, DNS is blocked; allow DomainSuffix(".good.com") only permits lookups for *.good.com; allow host udp/53 + tcp/53 grants resolution wholesale. The public_only and non_local presets prepend a DNS-allow rule so default sandboxes still resolve names, and Rule.allowDns() / Rule.allow_dns() is available across SDKs.
See Networking DNS.
Other features
- Ingress policy gate on published ports. Inbound TCP connections on published ports are now evaluated against the network policy before the listener accepts them; denied peers receive a TCP RST instead of a graceful close. See the networking overview.
MSB_HOMEenv override. Point a sandbox at an isolated state directory without touching$HOME, useful for CI jobs that share a runner. The build script honors the same variable, so build-time and runtime paths agree.- Secret injection for Basic auth. Placeholders inside
Authorization: Basic <base64>headers are now decoded, substituted, and re-encoded. The proxy also detects bypass attempts via URL percent-encoding, JSON unicode escapes, and placeholders split across TCP writes. The Python SDK gained the sameSecretInjectionoptions (headers,basic_auth,query_params,body) as the Node SDK. createWithProgressin the Node TS SDK. Stream image pull events (layer downloads, extraction) while creating a sandbox; the returnedPullSessionresolves to the live sandbox. See the TypeScript SDK reference.--replace-graceflag. Configure how longreplace()waits for the previous sandbox to shut down before escalating, exposed in the CLI and all SDKs.
Bug fixes
replace()no longer hangs for 30 seconds when the previous sandbox is mid-shutdown; it now escalates fromSIGTERMtoSIGKILLafter the grace period.- Stdin payloads larger than the kernel pipe buffer (about 64 KiB on Linux) are delivered correctly, and broken-pipe errors surface as a new
stdin_errorexec event instead of being silently dropped. - Address families are gated on host route availability, so v4-only hosts no longer advertise an IPv6 address into the guest and v6-only hosts can publish ports.
- Connection timeouts during the relay handshake now respect the 30-second deadline and prefer
boot-error.jsonover a raw IO error when available. - Prebuilt runtime downloads use the platform certificate store, so builds behind enterprise TLS proxies with custom CAs succeed instead of failing with
UnknownIssuer. - OCI digests with path traversal components are rejected, keeping cache filenames safe.
- The Node SDK accepts kebab-case
link-localin plain-object network policies, matching the documented public form. - The Node SDK’s
msbpath resolution works under Bun, which does not propagate JS-sideprocess.envmutations to native code. - Bind-mounting host directories the caller does not own (for example
/tmp,/var, mounted USB drives) no longer fails withOperation not permittedbefore the VM boots.