Introducing a new way to review your PRs.

Read the announcement

superradcompany / microsandbox

🧱 easy, fast, programmable and local-first microVM runtime and library

View on GitHub

27 documents · Updated Nov 23, 2026

overview

Knowledge Base updated: 2026-11-22

Microsandbox knowledge base

Microsandbox runs isolated workloads in lightweight virtual machines. Its core combines a runtime, guest agent, host networking, filesystem backends, image/snapshot pipelines, persistence, and public CLI/SDK interfaces.

Critical local state is maintained through the persistence layer and sandbox storage layout. Runtime protocol messages bridge host clients with guest services; snapshots and images provide reusable execution state.

flowchart TD
  CLI[CLI] --> SDK[SDKs and bindings]
  SDK --> Context[Local or cloud context]
  Context --> Runtime[Runtime orchestration]
  Runtime --> Sandbox[Sandbox lifecycle]
  Sandbox --> Agent[Guest agent]
  Sandbox --> Jobs[Managed jobs]
  Sandbox --> Network[Host networking]
  Sandbox --> FS[Filesystem backends]
  Sandbox --> Images[Images and snapshots]
  Images --> Checkpoint[Checkpoint and restore]
  Context --> DB[Persistent state]
  Agent <--> Protocol[Runtime protocol]
  Protocol <--> SDK
  Runtime --> Metrics[Metrics]
  Metrics --> Collector[Metrics collection]

Glossary

  • Sandbox — the host-managed VM-backed workload instance and its associated runtime state.
  • Context — SDK backend boundary that selects and operates local or cloud sandbox services.
  • Guest agent — software inside a sandbox that serves execution, filesystem, session, and control requests.
  • Snapshot — captured sandbox state and artifacts used to restore execution later.
  • Managed job — a tracked sandbox workload with lifecycle, output, attachment, and termination controls.

Invariants

  • Sandbox lifecycle operations are mediated by SDK handles and backend contexts, rather than direct caller mutation (sdk/…/handle.rs, sdk/rust/lib/context/**).
  • Snapshot creation and restoration use coordinated artifact paths rather than treating disk state as an opaque single file (sdk/rust/lib/context/local/snapshot/**).
  • The host/guest boundary remains versioned through protocol frames and message domains (crates/protocol/**).
  • Persistent sandbox metadata is owned by ordered schema migrations and the local database layer (crates/db/**, sdk/rust/lib/context/local/**).
  • Operational metrics are registered through the metrics registry before collection or delivery (crates/…/registry.rs).

Routing table