Skip to content

Decide production agent sandbox framework: AppContainer, OpenClaw Docker, or MXC #202

Description

@yikkuro

Problem

MicroClaw needs a production security boundary for agent tool execution. We currently have three plausible approaches with materially different threat models, deployment requirements, user experiences, and maintenance costs:

  1. Windows AppContainer — MicroClaw's existing Windows-native implementation with custom RO/RW directory permissions, NTFS ACL management, and interactive permission prompts.
  2. OpenClaw Docker sandbox — OpenClaw's built-in Linux-container sandbox running through Docker Desktop/WSL2; an experimental MicroClaw integration exists in Experimental: replace AppContainer with mandatory Docker sandbox #198.
  3. Microsoft MXC — policy-driven cross-platform containment using native platform backends, including Windows ProcessContainer/AppContainer/BaseContainer mechanisms; currently public preview and explicitly not yet presented as a production security boundary.

A production choice must be made before further investment or release. Running multiple partially overlapping sandbox systems without a clear ownership model increases complexity and can create unsafe fallback paths.

Goal

Select and document the production sandbox architecture for MicroClaw agent/tool execution, supported by an explicit threat model, reproducible security tests, product UX requirements, deployment constraints, and an implementation/migration plan.

Options to evaluate

A. MicroClaw Windows AppContainer

  • Windows-native tools and paths
  • Existing dynamic RO/RW folder prompt UX
  • Custom ACL/provisioning/runtime interception code owned by MicroClaw
  • Known synchronization, timeout, and desired-vs-effective-state complexity
  • Strong Windows coupling and maintenance burden

B. OpenClaw Docker sandbox

  • Built-in OpenClaw lifecycle/tool routing
  • Linux container isolation through Docker Desktop/WSL2
  • Secure container defaults available: non-root, read-only root, no network, dropped capabilities, resource limits
  • Requires Docker Desktop/WSL2 and Linux-compatible tools
  • Host access uses fixed Docker bind mounts; no built-in dynamic folder permission prompt
  • Experimental integration: Experimental: replace AppContainer with mandatory Docker sandbox #198

C. Microsoft MXC

  • Declarative policy model with Windows-native ProcessContainer and other backends
  • Direct RO/RW host-path policies without requiring Docker for the default Windows backend
  • Potentially replaces custom launcher/policy implementation while retaining Windows compatibility
  • Public preview/pre-1.0; repository currently warns policies must not yet be treated as security boundaries
  • No built-in runtime permission broker; Electron/MicroClaw must own consent UX
  • Native sidecar, host preparation, ACL restoration, Windows-version, and MSIX questions require proof

Required threat model

Define what the sandbox must protect against, including:

  • Malicious or prompt-injected model-generated commands
  • Untrusted skills/plugins and child processes
  • Reads/writes outside approved folders
  • Credential, browser-profile, SSH/cloud-token, and application-data access
  • Network exfiltration and localhost/service access
  • Process spawning, persistence, UI automation, named pipes, registry, devices, and host escape
  • Symlink/junction/reparse-point, UNC, mount, and path-canonicalization attacks
  • Cross-agent/session data leakage
  • Sandbox unavailability, startup failure, stale configuration, and downgrade/fallback behavior
  • Compromised Gateway versus compromised tool subprocess assumptions

Evaluation criteria

Create a measured comparison covering:

Area Questions
Security boundary What OS/runtime primitive enforces isolation? What is inside the trusted computing base? Is it fail-closed?
Filesystem RO/RW host folders, path canonicalization, dynamic permission UX, mount/ACL lifecycle, concurrent agents
Network Default egress, allowlisting, DNS/localhost, proxy bypass, auditability
Process/tool compatibility Windows/PowerShell/native apps versus Linux tools; child-process containment
Scope Per turn/session/agent isolation and cleanup semantics
User experience Installation, prompts, status transparency, recovery, offline behavior
Distribution EXE and MSIX compatibility, elevation, Store policy, signing, Docker/WSL/VM prerequisites
Reliability Startup latency, resource use, updates, crash recovery, stale state, rollback
Maintainability Upstream ownership, custom code size, platform support, release cadence
Maturity Security claims, version stability, independent review, known limitations

Required proof-of-concept tests

Run the same adversarial test suite against each viable option:

  • Approved RO path can be read but not written; approved RW path can be modified
  • Unapproved Desktop/home/AppData/system/credential paths are blocked
  • Junction/symlink/reparse and parent-path escapes fail closed
  • Child processes inherit restrictions
  • Network-off blocks DNS, direct IP, localhost, IPv4/IPv6, and proxy-based escape
  • Secrets are absent from environment, filesystem, logs, and crash output
  • Cross-agent/session isolation works
  • Configuration changes produce honest desired/effective status
  • Sandbox startup/configuration failure never falls back to unrestricted host execution
  • Cancellation, crash, app restart, update, and uninstall leave no unsafe permissions/runtime state
  • EXE and MSIX clean-machine install and lifecycle validation
  • Performance measurements: cold/warm startup, memory, CPU, and typical tool latency

Decision deliverables

  • Architecture Decision Record naming the selected framework and rejected alternatives
  • Approved threat model and security assumptions
  • POC results with reproducible commands/tests and target Windows versions
  • UX specification for folder access and command approvals
  • Deployment/prerequisite and Microsoft Store impact assessment
  • Fail-closed and rollback design
  • Migration plan from existing AppContainer settings/ACLs and experimental Docker state
  • Security review before production enablement

Acceptance criteria

  • All three approaches are evaluated against the same threat model and test matrix, or a documented blocker explains why an option was eliminated early
  • The selected framework passes the agreed fail-closed/adversarial tests on supported Windows versions
  • Product and Security approve the user-consent and host-folder-access model
  • EXE/MSIX deployment and upgrade implications are validated
  • An ADR and staged implementation/migration plan are approved
  • Experimental implementations are either promoted with safeguards or removed; no ambiguous dual-sandbox fallback remains

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions