Repository navigation
feat(dev): run libxmtp agents in Docker Sandboxes - #4753
Conversation
| extra-substituters = https://xmtp.cachix.org | ||
| extra-trusted-public-keys = xmtp.cachix.org-1:nFPFrqLQ9kjYQKiWL7gKq6llcNEeaV4iI+Ka1F+Tmq0= | ||
| EOF_CONFIG | ||
| include_line="include $config_dir/libxmtp-sbx.conf" |
There was a problem hiding this comment.
The generated Nix config uses the wrong include directive: nix.conf requires !include, so bootstrap writes a line that Nix cannot parse and later Nix commands fail. Please correct the directive.
| include_line="include $config_dir/libxmtp-sbx.conf" | |
| include_line="!include $config_dir/libxmtp-sbx.conf" |
Posted via Macroscope — Code Quality
| ;; | ||
| key) | ||
| (($# == 2)) || { usage >&2; exit 2; } | ||
| register_key "$1" "$2" |
There was a problem hiding this comment.
Security: key only checks that a sandbox with this name exists; unlike start, it never calls check_vm. If that sandbox was replaced or reconfigured with unexpected kits or host mounts, following the documented key-registration command sends the credential to its proxy anyway, where the altered guest can use it. Please validate the existing VM before registering the key.
| register_key "$1" "$2" | |
| [[ $state != absent ]] || fail 'Run start before registering a key' | |
| check_vm | |
| register_key "$1" "$2" |
Posted via Macroscope — Security
ApprovabilityVerdict: Needs Human Approval Macroscope's review found this PR requires human approval — This PR introduces a substantial Docker Sandbox and Orca workflow with host-managed provider credentials, VM lifecycle controls, and external integrations. Unresolved findings identify a broken Nix configuration directive and a credential-isolation gap when registering keys with an existing sandbox. You can add or adjust custom eligibility rules. Learn more. |
Run libxmtp coding agents, Nix builds, and a local backend inside one Docker Sandboxes VM, with a public clone of
mainand no host checkout or SSH-agent forwarding.Add native v3 kits for Claude Code and Codex, a small host wrapper under
dev/sbx, and per-session provider/model examples. Start checks existing kits and mounts, requires an empty Docker MCP catalog, repairs incomplete bootstrap, and connects Orca. Pause unlinks Orca before stopping so automatic reconnect cannot wake the VM. Provider keys use hidden host prompts and scoped proxy placeholders.The README covers Morph's 1M context, Anthropic API keys and Claude subscription login, Codex API keys and ChatGPT OAuth, and native credential-isolation limits. Sandbox tests are manual under
dev/sbx, outside CI discovery. Native Docker 0.50 retains Claude history volumes after destroy and reattaches them on same-name/kit recreation; the README and command output state this limit.Validation:
dev/nix-shell 'just lint-config': passed.dev/nix-shell 'python3.11 -B dev/sbx/test_sandbox.py': 14 passed.just test dev: existing Android emulator fixture hit its ADB timeout; isolated rerun passed (8 tests). All other Python modules, the 206 release-tools tests, and the 4 Fly tests passed.0eb6c5c1fbfound no remaining findings after mount/bootstrap fixes and the documented native-history decision.Note
Add Docker Sandbox tooling to run libxmtp dev agents in a VM
dev/sbxworkflow for running Claude/Codex agents inside a Docker Sandbox VM: asandboxCLI wrapper with start, pause, destroy, and key-register commands, plus a READMElibxmtp-claudeVM environment in sbxenv.yaml (8 CPUs, 24 GB RAM, no host mounts or published ports) and a post-create setup hook that runs the guest bootstrap scriptsbx secret set-customover stdin, never in command arguments; a smoke script checks the build and runs a backend message testsbx, Orca, and setup commands and covers lifecycle, key handling, and failure casesstartrefuses to run with foreign or multiple local VMs, a nonempty host MCP catalog, or SSH-agent forwarding enabled; same-name VMs with mismatched agent, mounts, or kits are not started or destroyedMacroscope summarized 0eb6c5c.