Repository navigation
Conversation
Move extensions/mxc from @microsoft/mxc-sdk 0.8.0 raw ContainerConfig to the 1.0 `@microsoft/mxc-sdk/v1` ContainerRequest API, launched through spawn/spawnWithPty from the plugin's Node launcher. - Build a v1 ContainerRequest with directional network policy (egress follows the network setting; ingress and host loopback stay denied), the existing filesystem admission, curated environment with inheritDefaultEnvironment off, and clearPolicyOnExit. - Pin the native components with MXC_BIN_DIR/MXC_FFI_DIR. An mxcBinaryPath override must be <dir>\<arch>\wxc-exec.exe with mxc_ffi.dll beside it; any other layout fails closed instead of falling back to packaged binaries. The launcher rechecks both files and never inherits host MXC_* variables. - Readiness probes the host through the launcher with the same pinned mxc_ffi. - A command stopped by its timeout exits 124 with a stderr notice. - Replace the raw wxc-exec --dry-run contract test with a probe of the generated request through the SDK and a real launcher run. Co-authored-by: Copilot <[email protected]>
Replace the @microsoft/mxc-sdk 0.8 dangerous-exec entries with the 1.0.0 paths, following an independent review of the verified 1.0.0 artifact. Counts are provisional until the real packed plugin scan runs; if it disagrees, investigate the finding rather than raising an allowance. Removed (0.8 paths absent from 1.0.0): - dist/platform.js 4: replaced by dist/v1/platform.js 3 plus the moved bubblewrap probe scripts below. - dist/policy.js 1: replaced by dist/v1/policy/filesystem.js 1. - dist/sandbox.js 2: SDK v1 runs non-PTY commands through native FFI bindings instead of these child_process calls. Added: - dist/bwrap-probe-anchor.js 1, dist/bwrap-probe-helper.js 1, dist/bwrap-probe-worker.js 1: moved Bubblewrap version-probe behavior (bounded supervisor; the helper runs `bwrap --version` with fixed args). Linux-only; not reachable from the plugin on Windows. - dist/v1/platform.js 3: platform discovery (dism feature query, `wxc-exec --probe`, `lxc-ls --version`), reached only through getPlatformSupport(), which the plugin does not call. - dist/v1/policy/filesystem.js 1: icacls ACL inspection moved and narrowed from 0.8 policy.js; only getAvailableToolsPolicy() calls it, and the plugin does not. Kept: - dist/diagnostic.js 1: unchanged from 0.8; `whoami /user` runs at SDK import on Windows to name the diagnostics pipe. Co-authored-by: Copilot <[email protected]>
MXC SDK 1.0 cannot request a least-privilege AppContainer, so the appcontainer-dacl and appcontainer-bfs tiers now run a regular AppContainer that can reach resources granted to ALL APPLICATION PACKAGES. base-container has no LPAC token and is unaffected. Readiness logs a neutral notice naming the AppContainer tier without blocking activation, and the README documents the tiers and the observed host builds. Also drop the launcher test's unused probe stubs left over from the reverted guard. Co-authored-by: Copilot <[email protected]>
Move the payload decoding and field assertion helpers out of mxc-backend.test.ts so the SDK 1.0 cutover stays under the line-cap ratchet without trimming coverage. Co-authored-by: Copilot <[email protected]>
@microsoft/mxc-sdk 1.0.0 refuses native stdio, and so every non-PTY command, on Windows below Node.js 24.21.0 within 24 or 26.8.0, which is narrower than OpenClaw's engines range. Block activation with the requirement and the Gateway's version instead of failing each command with exit 127. Co-authored-by: Copilot <[email protected]>
MXC SDK 1.0 moves its node-pty dependency from 1.2.0-beta.15 to 1.1.0, and node-pty 1.1.0 publishes its scripts/ directory. The packed scan reports three dangerous-exec findings there, all in maintainer tooling: - node-pty/scripts/gen-compile-commands.js (1): line 8 runs the fixed string `npx --offline node-gyp configure -- -f compile_commands_json`. Only the manual `compileCommands` npm script reaches it. - node-pty/scripts/increment-version.js (2): lines 47-48 run `npm view <name> versions --json` with fixed arguments. It is a release helper that no package script references. Nothing reaches either file at runtime or at install. node-pty lib/, its install and postinstall hooks (prebuild.js, post-install.js), the SDK dist, and the plugin dist don't reference them. The counts are exact, following the node-addon-api/tools precedent from 8841578. Limitation: REVIEWED_DEPENDENCY_FINDING_LIMITS binds a finding by dependency path and count only, not by content hash. A changed script with the same path and count would still pass, so any node-pty version or content change needs a fresh review even if the counts stay the same. The entries were reviewed independently against the scanned package bytes. Co-authored-by: Copilot <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs real behavior proof before merge. What this changesThis PR migrates the Windows MXC sandbox plugin to SDK 1.0, including request translation, native-component selection, and process lifecycle handling. Example: An operator configures mxcBinaryPath as C:\Tools\wxc-exec.exe.
Review scores
ProductKind: Feature · Worth it: Needs a maintainer decision · Fix scope: Complete Merge readiness⛔ Blocked before merge - 4 items remain Keep this PR open: it provides a distinct SDK 1.0 migration absent from main, but accepting the changed AppContainer boundary remains a maintainer decision. Priority: P2 Decision needed
Before merge
Findings
Tests
Agent review detailsHow this fits togetherThe optional MXC plugin translates OpenClaw sandbox commands and workspace policy into Windows container requests, returning command output and exit status while owning launcher cleanup. flowchart TD
A[OpenClaw sandbox command] --> B[MXC backend]
C[Workspace and operator policy] --> B
B --> D[Plugin launcher]
D --> E[MXC SDK 1.0]
E --> F[Windows sandbox process]
F --> G[Output and exit status]
Technical reviewBest possible solution: Ship the plugin-local SDK 1.0 cutover with an explicitly approved isolation contract and demonstrated compatibility for existing installations. Do we have a high-confidence way to reproduce the issue? This is an SDK migration rather than a reproduced current-main defect; main and v2026.10.6 use SDK 0.9.0, while the supplied Windows observations exercise SDK 1.0.0. Is this the best way to solve the issue? Updating the existing plugin adapter is the appropriate scope, and the old execution path is removed; broader isolation access requires an explicit owner decision. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against a8aee07e3870. Provenance checked
TestingProof path: shipped entry point. SecurityNeeds attention: The deliberate expansion from LPAC to regular AppContainer access needs explicit isolation-owner acceptance. EvidenceSecurity concerns:
What I checked:
Likely related people:
PR surfaceSource +313, Tests +1275, Docs +29, Config +4, Other +319. Total +1940 across 23 files. Added test files: 2. View PR surface stats
Review metrics
LabelsLabel changes: No label changes. Label justifications:
Rank-up movesOptional improvements that raise the rating; they are not merge blockers.
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment HistoryReview history (7 earlier review cycles)
Reviewed October 23, 2026, 4:32 PM ET / 20:32 UTC (Revision 8). |
Resolves the pnpm-lock.yaml conflict on @openclaw/libterminal: keep main's ghostty-web patch hash and this branch's node-pty 1.1.0 peer. Co-authored-by: Copilot <[email protected]>
Resolve conflicts with upstream 8656a68 while keeping the MXC SDK 1.0 cutover and its security contract. - extensions/mxc/package.json: keep @microsoft/mxc-sdk 1.0.0; take the upstream 2026.10.2 plugin version. - pnpm-lock.yaml: take upstream and re-apply only the SDK 1.0 deltas (mxc-sdk 1.0.0 with koffi 3.3.2, node-pty 1.1.0, semver 7.8.5; libterminal 0.3.9 optional node-pty peer). sha512 only. - scripts/plugin-npm-security-scan.mts: union of the upstream shared upper-bound entries and the SDK 1.0 dist/v1 entries. - src/mxc-spawn-launcher.mjs: port the SDK 1.0 launcher to natural exit (openclaw#168587): no process.exit; forwarded signals kill, then record the signal exit code after the grace period; signal and stdin listeners are released after wait(). Pinned native checks, 124 timeout and 127 launcher failure are unchanged. - tests: honor upstream low-value test removals, keep SDK 1.0 fail-closed native pinning and LPAC disclosure coverage, and cover listener release. Co-authored-by: Copilot <[email protected]>
MXC SDK 1.0 runs Windows ProcessContainer PTY sessions through wxc-exec under node-pty. That result always reports timedOut: false, and the executor's timeout status (-1) cannot be told apart from a command that exits -1, so PTY timeouts never reached the 124 normalization. The launcher now arms its own deadline at the request timeout for PTY runs. It reports 124 only when its timer killed a sandbox whose completion had not been observed and no forwarded signal had already cancelled it. A forced signal status still wins, a genuine -1 before the deadline is reported as-is, and a timer that fires after completion is ignored. The executor keeps the request timeout plus 5 s as a backstop. Non-PTY runs keep the SDK's own timedOut result. Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
@clawsweeper re-review |
|
🦞👀 Re-review progress:
|
|
We want to run OpenClaw with BaseContainer only. Our intended behavior is:
The current readiness check asks what the host supports generally, without including the workload’s actual settings. Would you support an opt-in BaseContainer-only setting and checking each workload’s complete request before launch? We would need to confirm creation-time enforcement separately with MXC, because a successful preflight alone does not guarantee which mode will be used. |
|
SDK 1.1 removes the ProcessContainer fallback modes, while this branch still targets 1.0 and accepts those modes. I have prepared a small follow-up patch to move this migration to 1.1, require BaseContainer at startup and remove the obsolete DACL preparation guidance. Commands still go directly to SDK creation. The patch adds no per-command preflight, diagnostic fingerprint format or configuration option. Hosts without native PSEC support would be unsupported, so that compatibility change needs your agreement. The plugin tests pass on Linux and Windows with native cases excluded; four existing launcher lint findings remain. Native workload and installed-upgrade qualification remain outstanding. Would you prefer to incorporate the patch here, or receive a PR against your migration branch? |
What Problem This Solves
The MXC sandbox plugin still uses the preview SDK 0.8 request and process APIs, which are incompatible with the released MXC SDK 1.0 runtime.
User Impact
MXC sandboxed agents keep the same workspace, network, environment, timeout, and cleanup behavior on SDK 1.0.
Operators need to account for three compatibility changes:
>=24.21.0 <25or>=26.8.0. The plugin fails activation with a remediation message on older releases.mxcBinaryPathmust select an SDK 1.0 architecture directory containing bothwxc-exec.exeandmxc_ffi.dll. Invalid or incomplete overrides fail closed instead of falling back to bundled native components.appcontainer-daclandappcontainer-bfstiers use a regular AppContainer and can reach resources granted toALL APPLICATION PACKAGES.base-containeris unchanged. The selected tier and boundary are logged and documented. Chaz accepted this boundary and the upgrade requirements for this migration.Ordinary sandboxed exec remains non-PTY. The retained SDK PTY path owns its deadline, kills the sandbox on timeout, returns
124, and writes the timeout notice.Why This Change Was Made
The plugin now builds an SDK 1.0
ContainerRequest, usesspawnorspawnWithPty, and pinswxc-exec.exeplusmxc_ffi.dllfrom one validated release directory. Launcher stream errors, backpressure, cancellation, timeout, and cleanup are explicitly owned so a failed stream cannot be reported as exit0.The dependency closure also pins
[email protected]for[email protected]source builds on platforms without a prebuild. The packed dependency scanner records the reviewednode-ptymaintainer-script findings; they are not install-time or runtime paths.Evidence
Current branch head
0cbf9b5481de42e1ea4207c1b27fd50441e51c0bincludes a test-only restoration of sandbox-policy admission coverage. Its parent merge0722b5d9cf4b5c7612bc142b6e68ee90f3333aa7integrates upstream061f22646cf6eb3c199f7f776ea6bdb1b92d971a.pnpm install --frozen-lockfileon Node.js 24.22.1: passed, including the 1,878-entry supply-chain policy check.pnpm test extensions/mxc/test/sandbox-policy-loader.test.ts --maxWorkers=1: passed 11 tests in 14.15 seconds.pnpm test:extension mxc: passed 14 files and 121 tests in 234.32 seconds.pnpm tsgo:extensions:test: passed.pnpm exec oxfmt --check extensions/mxc/src/mxc-backend.ts extensions/mxc/src/mxc-container-config.ts: passed.node --import ./scripts/tsx.mjs scripts/check-test-mock-exports.mts --staged --base upstream/main: passed with 7,136 grandfathered factories.The accepted Windows runtime proof is bound to candidate
6e69db30aa6bbbbb2454258a6b1f0b0008f86c52(treedff5db0a2d539c550f70dc63d203198b83a7c78b). The current-main merge only reconciles upstream owner/localization refactors and tests; it does not intentionally change the validated SDK 1.0 behavior. No candidate source changes arose from the runtime harness work.base-container, existing Crabboxharbor-prawnlease.run_fbef3881c610ceafd3624e5e429dcb80, duration 48m29.9s.0,run-exit=0, andacceptance.jsonrecordedaccepted: true.S.install,L1.plain,L2.pty-request,L4.cancel,L3.timeout,L5.no-hang,D.fs.rw.write,D.fs.rw.apply-patch,D.fs.skills.exec,D.fs.skills.bridge,D.fs.hostpath,D.identity.token,D.override.missing-ffi,D.override.not-arch-dir,D.override.restored,D.no-payload-dirs.Frozen runtime identities
B1FE5B090A7CC593750A4D126D2649912E63844D2454D8D752D8BAA16C40C45043F3689DE35868999AE81862F2B2AA397E8A7F9AD0374E34E99A5631DE3FF3D088AD7273D36B53EA490F506414C9F4F5FEBA2737CC946222FCA81E51A546D82F158F7685B44DE51F6C0DF1D153526CBCD3E1BC739A8DFC607721CEF75DE9E541062C008A942B2DB3BF74D1437F4A272E97959731E3991359486C9017935D467F99B7BE9E365474B7520ED5CB8200296C6BD8F1BDE42F9FA440D344F37CEF8142(23/23)BEC0CE6820C9C8F4E46800B28E1C8A84A2D1B5B872DAB91D6AC3220BFA567CEF05B3A7143CD9594FE0386E4B53598D247DFC09F1B96BB0BFF3344FBB0D8B381FBAA827281E7D63532A47852A8994AD3A2E67F8BDD6092947CA68F6864896F7F8(10/10)R7 through R9 are immutable harness diagnostics, not candidate failures. R10 replaced the extraction bottleneck with native
tarplus exact verification of all 50,113 host files.Not covered by the accepted run: npm/updater installation, a latest-stable SDK 0.8 upgrade on the current candidate, non-
base-containertiers, or the PTY path through an OpenClaw integration. PTY timeout behavior is covered at the launcher boundary because ordinary sandboxed exec is non-PTY.Redacted accepted runtime observations
The following is a redacted excerpt from the accepted
rows.tsvandrun.log. Machine-local paths, SIDs, and private file contents are omitted. These observations cover the validated Windowsbase-containerscope only.This does not add proof for retained
appcontainer-daclorappcontainer-bfstiers, or for an upgrade from v2026.10.6. Those remain explicit limitations and should not be inferred from the acceptedbase-containerrun.