Repository navigation
Description
Current Status
- 2026-04-23: complete via merged PR Bind headless remote sessions to explicit workspace roots #135 (
d3f9bbe6f7a8d57f85e73b172fb06768aa1aa6e2). - Branch:
jh/workspace-sandbox-root-20260423 - Scope landed: explicit session workspace roots for headless runtime cwd, agent context, and utility command/read/search/watch enforcement.
From the Maestro remote/runtime review on 2026-04-22.
Reviewed heads:
evalops/maestro@ae6e88a22d3a36d34d07c5c507375cfd7fdcd372evalops/platform@7b003938349939052f90ae41241599993a7c06c9
Parent tracker: #76
Problem
Remote/headless sessions do not yet have a first-class workspace/sandbox root. Much of the server-side runtime falls back to the Maestro web server process cwd, while remote utility requests can pass their own cwd. That is workable for a local dev web server, but dangerous and ambiguous for hosted remote servers.
Evidence:
src/web-server.ts:497-510builds agent context sources and composer state withGitSnapshotContextSource(process.cwd()),TeamMemoryContextSource(process.cwd()), andcomposerManager.initialize(..., process.cwd()).src/server/hosted-session-manager.ts:116-143,383-445, and501-543persist/start/branch sessions withcwd: process.cwd()and memory updates using the process cwd.src/headless/utility-command-manager.ts:185-199accepts command cwd and only asksvalidateShellParamsfor a resolved cwd.src/tools/shell-utils.ts:113-153validates command/cwd shape and existence, but does not bind cwd to a session workspace root.src/headless/utility-file-search.ts:92-115,src/headless/utility-file-read.ts:44-59, andsrc/headless/utility-file-watch-manager.ts:119-125resolve their operating roots from request cwd orprocess.cwd().
Scope
- Add an explicit
workspaceRoot/workspaceId/sandboxIdfield to headless session create/attach state, with validation and audit-visible metadata. - Thread that root through
createAgent,GitSnapshotContextSource,TeamMemoryContextSource, MCP config loading, LSP/checkpoint initialization, hosted session metadata, and utility managers. - Restrict utility command cwd, file search cwd, file read path, and file watch root to the session workspace root or to an allowed mounted volume list.
- Decide the hosted workspace provisioning story: existing checked-out worktree, ephemeral git worktree, container/volume, or Platform-supplied workspace lease.
- Emit session/workspace/sandbox identifiers into headless snapshots and
maestro.*events so Platform run/event records can join on the same boundary.
Acceptance Criteria
- A remote headless session cannot run
utility_command_start,utility_file_search,utility_file_read, orutility_file_watch_startoutside its assigned workspace root. - Agent context sources no longer use the web server process cwd for hosted/headless sessions unless that cwd is explicitly the session workspace root.
- Hosted session rows and session headers persist the explicit workspace/sandbox identifiers.
- Tests cover cwd/path traversal, absolute path escape attempts, file watch outside-root rejection, and local/offline fallback behavior.
Related: #76, #72, #73, #74, evalops/platform#780.
Runtime Parity / Conformance Links
- Define Rust core runtime parity contract for hosted Maestro #84 — Rust core runtime parity decision for hosted Maestro.
- Add headless runtime conformance suite for Rust parity #85 — headless runtime conformance suite that should gate Rust-hosted runner parity.
Use #85 as the protocol-level acceptance bar: lifecycle, subscribe/events/messages/heartbeat/disconnect, viewer/controller roles, permission request/response, utility operations, workspace-root enforcement, cursor replay/reset, and drain/resume behavior should match across the current TypeScript web/headless bridge and the target Rust runtime.
Activity
haasonsaas commentedon Apr 23, 2026
Cross-linking evalops/platform#852 here. The new remote-runner security review makes this issue one of the explicit production gates for hosted sessions: the runtime needs explicit workspace sandbox binding plus outside-root rejection, not just a control-plane policy check.
That requirement is now written down in the shared security-review doc instead of living only in the broader platform issue prose.
haasonsaas commentedon Apr 23, 2026
PR is up at #135.
This slice makes the headless session workspace root explicit, pins hosted sessions to the configured runner workspace, threads that root into agent/runtime cwd, and blocks utility command/read/search/watch access outside it. Focused tests plus the hosted workspace-root conformance checks are green locally.
haasonsaas commentedon Apr 23, 2026
Merged in #135 on 2026-04-23. This landed explicit
workspaceRootsession state for hosted/headless sessions, threads that root through agent/runtime context, and rejects utility command/read/search/watch access outside the assigned workspace root.Commit:
d3f9bbe6f7a8d57f85e73b172fb06768aa1aa6e2PR: #135