Skip to main content

Microsandbox runner plugin for Weft

Project description

weft-microsandbox

Microsandbox runner plugin for Weft.

This extension runs disposable command and one-shot provider_cli agent tasks inside Microsandbox microVM sandboxes. It is intended for probably-hostile tools, MCP servers, and skills that need a harder process and filesystem boundary than the host runner.

The runner name is microsandbox.

Install with:

uv add 'weft[microsandbox]'

The current Microsandbox SDK supports Linux x86_64/aarch64 and macOS Apple Silicon. The SDK is Apache-2.0 licensed. A working local Microsandbox runtime is required for real execution; weft spec validate --preflight --load-runner checks the local runtime gate explicitly.

Tool Mode

{
  "spec": {
    "type": "command",
    "process_target": "python",
    "args": ["-c", "print('hello')"],
    "runner": {
      "name": "microsandbox",
      "options": {
        "image": "python:3.12-alpine",
        "mode": "tool",
        "network": "none",
        "workspace_mode": "none"
      }
    }
  }
}

Agent Mode

{
  "spec": {
    "type": "agent",
    "persistent": false,
    "agent": {
      "runtime": "provider_cli",
      "conversation_scope": "per_message",
      "runtime_config": {
        "provider": "codex"
      }
    },
    "runner": {
      "name": "microsandbox",
      "options": {
        "image": "ghcr.io/acme/codex-provider:latest",
        "mode": "agent",
        "executable": "codex",
        "network": "allow",
        "workspace_mode": "none"
      }
    }
  }
}

runner.options.executable is the executable inside the guest image. It is not resolved on the host.

Runner Options

  • image: required OCI image.
  • mode: optional; derived from spec.type as tool for command tasks and agent for agent tasks.
  • executable: required for agent mode; guest-local provider CLI command.
  • network: none by default, or allow.
  • workspace_mode: none by default, or copy, mount-read-only, or mount-read-write.
  • mounts: explicit host mounts. Entries default to read-only.
  • cwd: guest working directory. Required for workspace modes.
  • sandbox_name_prefix: optional runtime name prefix.

Security Defaults

  • network defaults to none.
  • workspace_mode defaults to none.
  • host environment variables are not forwarded unless they are explicit in spec.env.
  • persistent and interactive tasks are rejected.

Current Limitations

Memory, CPU, and file-descriptor limits are passed to the Microsandbox SDK, but the runner does not yet map SDK OOM or metrics evidence to RunnerOutcome(status="limit"). A guest killed by the runtime for memory pressure may currently surface as a generic execution error.

This runner is a process, VM, and filesystem boundary. It is not a semantic defense against prompt injection or malicious output.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

weft_microsandbox-0.5.1.tar.gz (11.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

weft_microsandbox-0.5.1-py3-none-any.whl (15.0 kB view details)

Uploaded Python 3

File details

Details for the file weft_microsandbox-0.5.1.tar.gz.

File metadata

  • Download URL: weft_microsandbox-0.5.1.tar.gz
  • Upload date:
  • Size: 11.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for weft_microsandbox-0.5.1.tar.gz
Algorithm Hash digest
SHA256 4d77fdb75da8aaa9b15fcbefae41c16d843c6f048b52684c7323765e5a22962d
MD5 9a238be9738f180e18e93debd13c447b
BLAKE2b-256 b017ee12a1d409ed5fa377d3bdfb4a4f81c7c081da16041a433ca9f43127adbe

See more details on using hashes here.

File details

Details for the file weft_microsandbox-0.5.1-py3-none-any.whl.

File metadata

  • Download URL: weft_microsandbox-0.5.1-py3-none-any.whl
  • Upload date:
  • Size: 15.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.11 {"installer":{"name":"uv","version":"0.11.11","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for weft_microsandbox-0.5.1-py3-none-any.whl
Algorithm Hash digest
SHA256 7a4855e15c743d41068693d0a42c2fbfb4f3c7de062d4665fea2f90bd0773f28
MD5 3a2106feac648a593ed918c399f0e031
BLAKE2b-256 44a1585c3d6105861c2269087c565c8426d978eb027ca4d72830f2ee15e17794

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page