Harness: support provider-native process/filesystem semantics and preinstalled adapter payloads
Description
Harness currently assumes that a sandbox session has POSIX shell and path semantics during bootstrap and adapter startup. Core and adapter code uses command strings such as pwd and mkdir -p, composes guest paths with path.posix, and installs adapter bridge dependencies through package-manager commands.
That default is reasonable for existing POSIX sandboxes, but it prevents two broader Harness use cases:
- Native non-POSIX sandbox providers. A provider backed by the native Windows filesystem and
child_process.spawn() cannot faithfully implement POSIX commands or accept POSIX-composed guest paths.
- Preinstalled adapter payloads. A signed desktop runtime, offline worker, or prebuilt managed image may already contain an exact adapter bridge and its dependencies, but adapters cannot currently select that payload and skip package-manager bootstrap/network access.
This is not specific to one provider adapter. Both the published Codex and Claude Code Harness adapters currently use an adapter-owned bridge bootstrap, package installation, shell command strings, and POSIX directory setup. Codex and Claude are useful reproductions, not the desired abstraction boundary.
Relevant published areas include:
@ai-sdk/harness sandbox bootstrap, work-directory discovery, skill installation, bridge readiness and replay paths;
@ai-sdk/provider-utils experimental sandbox session process/filesystem contract;
@ai-sdk/harness-codex and @ai-sdk/harness-claude-code bridge bootstrap and startup.
Desired outcome
A Harness sandbox provider should be able to own its guest process, filesystem, home-directory and path semantics without emulating a POSIX shell. An adapter should be able to use an immutable, consumer-supplied preinstalled payload and omit package installation when that mode is selected.
The exact public API is intentionally left open for maintainer design. A solution should provide these capabilities without requiring one particular method shape:
- direct executable-plus-argv launch, preserving paths and arguments containing spaces;
- provider-owned guest path composition, home discovery and recursive directory creation;
- an immutable adapter payload identity distinct from machine-specific installation paths;
- an opt-in preinstalled mode that performs no package-manager install or bootstrap network request;
- unchanged default behavior for existing adapters and sandbox providers.
The preinstalled identity may participate in cache and lifecycle decisions, but host credentials, arbitrary executable locations and local profile paths should not become portable Harness state.
Reproduction
Implement a Harness network sandbox provider over the native Windows filesystem and child_process.spawn() without Git Bash or WSL, then create either a Codex or Claude Code Harness session.
Bootstrap and startup encounter a combination of POSIX-only commands/path composition and adapter-owned package installation before a turn can run. Wrapping the outer worker in Electron, Tauri or a packaged Node process does not change those nested assumptions.
Suggested acceptance coverage
- a native Windows provider with paths containing spaces and no POSIX shell;
- a POSIX provider retaining the existing default bootstrap behavior;
- preinstalled adapter startup with no ambient package manager and no bootstrap network access;
- skills/tool setup, bridge readiness and replay using provider-owned paths;
- create, turn, detach, stop, resume/replay and destroy lifecycle coverage;
- relocation of the same immutable payload does not change its content identity;
- public documentation for any new experimental sandbox or adapter capability.
Codex and Claude Code are appropriate initial consumer proofs. The reusable capability should live at the narrowest boundary justified by the repository's compatibility and abstraction rules rather than introducing Codex-specific sandbox primitives.
Versions inspected
@ai-sdk/harness: 1.0.64
@ai-sdk/harness-codex: 1.0.66
@ai-sdk/harness-claude-code: current source on 2026-08-08
Code of Conduct
I agree to follow this project's Code of Conduct.
Harness: support provider-native process/filesystem semantics and preinstalled adapter payloads
Description
Harness currently assumes that a sandbox session has POSIX shell and path semantics during bootstrap and adapter startup. Core and adapter code uses command strings such as
pwdandmkdir -p, composes guest paths withpath.posix, and installs adapter bridge dependencies through package-manager commands.That default is reasonable for existing POSIX sandboxes, but it prevents two broader Harness use cases:
child_process.spawn()cannot faithfully implement POSIX commands or accept POSIX-composed guest paths.This is not specific to one provider adapter. Both the published Codex and Claude Code Harness adapters currently use an adapter-owned bridge bootstrap, package installation, shell command strings, and POSIX directory setup. Codex and Claude are useful reproductions, not the desired abstraction boundary.
Relevant published areas include:
@ai-sdk/harnesssandbox bootstrap, work-directory discovery, skill installation, bridge readiness and replay paths;@ai-sdk/provider-utilsexperimental sandbox session process/filesystem contract;@ai-sdk/harness-codexand@ai-sdk/harness-claude-codebridge bootstrap and startup.Desired outcome
A Harness sandbox provider should be able to own its guest process, filesystem, home-directory and path semantics without emulating a POSIX shell. An adapter should be able to use an immutable, consumer-supplied preinstalled payload and omit package installation when that mode is selected.
The exact public API is intentionally left open for maintainer design. A solution should provide these capabilities without requiring one particular method shape:
The preinstalled identity may participate in cache and lifecycle decisions, but host credentials, arbitrary executable locations and local profile paths should not become portable Harness state.
Reproduction
Implement a Harness network sandbox provider over the native Windows filesystem and
child_process.spawn()without Git Bash or WSL, then create either a Codex or Claude Code Harness session.Bootstrap and startup encounter a combination of POSIX-only commands/path composition and adapter-owned package installation before a turn can run. Wrapping the outer worker in Electron, Tauri or a packaged Node process does not change those nested assumptions.
Suggested acceptance coverage
Codex and Claude Code are appropriate initial consumer proofs. The reusable capability should live at the narrowest boundary justified by the repository's compatibility and abstraction rules rather than introducing Codex-specific sandbox primitives.
Versions inspected
@ai-sdk/harness:1.0.64@ai-sdk/harness-codex:1.0.66@ai-sdk/harness-claude-code: current source on 2026-08-08Code of Conduct
I agree to follow this project's Code of Conduct.