Skip to content

feat(mxc): isolate sandbox policy configuration per agent - #5

Draft
ChazGo wants to merge 7 commits into
mainfrom
workclaw/mxc-per-agent-20261003
Draft

ChazGo wants to merge 7 commits into
mainfrom
workclaw/mxc-per-agent-20261003

Conversation

@ChazGo

@ChazGo ChazGo commented Oct 4, 2026 •

Copy link
Copy Markdown
Owner

Why

Allow each configured agent to select its own MXC network mode, execution timeout, and filesystem policy files instead of sharing one plugin-wide policy selection. Draft for design and code review; full Gateway/finance-agent E2E remains deferred.

Changes

  • Strict plugin-owned per-agent overrides for network, timeoutSeconds, and mxcPolicyPaths, with canonical host IDs (including leading underscores), unsafe-key rejection, and known-agent validation.
  • Propagate trusted resolved agent identity through sandbox creation, workspace resolution, and explain.
  • Snapshot selected configuration; reject selected overrides under effective shared scope; preserve forced-private skill/session isolation and Docker/Podman-only managed guest projects.
  • Keep helper shells network-blocked and cap native/outer timeouts.
  • Invalidate plugin registry caches and retained/borrowed registrations on roster membership changes; ordinary agent-setting edits do not trigger plugin reloads.
  • Reject read/write versus read-only overlap through physical junction/symlink aliases as well as lexical paths. Fail closed on resolution errors; preserve emitted lexical mount identities. This closes static admission aliasing, not retargeting races.
  • Document the future per-tool/optional-intent integration boundary: agent defaults are not per-invocation authorization; catalog requirements are not grants and must not be cached as a handle's current tool policy. The store is not implemented here.

Semantics for review

Plugin-wide values are defaults, not mandatory common ceilings. Omitted agent fields inherit. Explicit policy-file lists replace the defaults, including []; this does not remove built-in sandbox protections. Policy files augment filesystem access and cap timeouts, subject to validation/protected-path checks. Files are loaded per handle; editing a file does not revoke an in-flight command. Exec grants do not become filesystem-tool mounts.

Current validation — 6634bef

  • 274 fresh, deduplicated passing cases: 193 MXC (including 11 real Windows physical-alias cases), 61 cache/roster/reload/context/contract/service cases, and all 20 broad boundary cases. Filtered service cases are not counted.
  • Core types, all 27 canonical core-test graphs, root types, MXC package-boundary types, changed type-aware lint and formatting passed. MXC SDK preparation used its supported finite timeout override; no security guards were disabled.
  • Independent reviews covered the initial feature and both correction patches. Break-to-prove checks failed on intended original assertions and passed after byte-identical restoration.
  • Full typed build passed (56m34s), including 151 SDK exports, 96 plugins, UI, runtime checks and metadata.
  • Canonical MXC/AI-bundled npm packaging passed (11m34s); inventory/dependency/import-graph checks and independent 14,294-entry inspection passed. No private validation overrides, lockfiles or logs packaged.
  • Final archive: 103,065,600 bytes; SHA256 82223d93cde55dce1ed76f589cb5e2b20b6e78fd9d48d25e2c04fc608f3c3982. Custom npm-format distribution, not stock frozen release, MSIX or an offline dependency bundle; not installed or delivered.
  • Separate native SDK 0.8.0 / executor 0.8.0+7dac1a9 base-container probes verified read-only and ungranted access denial, writable positive control, alias-write denial and a 1-second timeout. These are native API probes, not full Gateway/finance E2E; no native escape demonstrated.

Dependency provenance

The configured mirror did not serve required packages and direct npm TLS failed. Private validation used official release tarballs verified against original lockfile SHA-512 values: fs-safe 0.23.0 and matching Windows native package; Codex 0.160.0 with actual CLI version verified. Existing package-age exemptions, TLS, lifecycle and other security settings were preserved. Shipping dependency metadata is unchanged. This is exact-package-content validation, not a successful frozen registry install.

Remaining limitations

  • Skill-library selection-authority test: confirmed inherited Windows EPERM, reproduced identically on clean upstream 3d66dd51b57d8e16acf481d6425c7b95ad3d264b and final PR source, each 11 pass / 1 fail. An identical second save fails on directory rename before rollback assertions; that invariant remains unexercised. No errno catch or test was weakened. Earlier sibling evidence remains 284 pass / 1 baseline fail / 6 skips and is not added to fresh counts.
  • Final UI startup gzip is 93 bytes above its report-only budget: not a performance-budget pass. UI source/budget tooling are unchanged; no emitted clean-base comparison yet.
  • Final exact-built registration → registered factory/backend → shipped launcher → SDK/native host-API harness passed A–B–A and concurrent A/B own-access/readonly/cross-agent isolation, policy-list replacement/inheritance, invalid-owner/context/scope rejection, distinct native IDs, 1s/3s native timeouts, helper timeout ceilings/network-block payloads, and actual filesystem-bridge own-access/cross-agent denial. No mocks or source edits. This is genuine built plugin-to-native proof, not Gateway session/model-tool integration.
  • Network remains inconclusive: host endpoint controls succeeded but the default-network sandbox positive control timed out on both same-host loopback and non-loopback addresses. Denied-agent/helper failures alone are not enforcement proof. A controlled endpoint on another reachable host is needed for B-positive/A-negative/helper-negative checks without firewall or containment changes.
  • Authorized separate-Gateway installation and session/model-tool routing remain outstanding. Other native tiers and retarget races are unproven. No Gateway update/restart or real finance-data access performed.
  • Hosted ClawSweeper did not review this fork: dispatch was a no-op without configured App integration, and the upstream service is not a public third-party reviewer. Main CI/security review skip drafts; skipped jobs are not passes. Labeler requires unavailable App credentials.

Keep this PR draft. Separate from the existing Windows security-presets draft.

Chaz Gordish (Agent) added 7 commits October 3, 2026 16:16
…ding)

Preserve current-base per-agent policy changes and add private-skill callback and managed-project rejection coverage. Source syntax, docs inventory and diff checks pass. Current-base tests have not run: exact frozen dependencies remain unavailable through the configured registry route. No typecheck, lint, build, native execution or mutation proof; not ready for push or PR.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant