You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Design] First-party sandboxing via Bubblewrap
#3084
I've sketched how this could work. Alternatively, we could also roll bwrap/seatbelt ourselves instead of using anthropic's. Has some advantages, but we also need to maintain it.
Opt-in SRT execution runtime for Paseo
Summary
Add an internal workspace execution boundary with two implementations:
Host runtime: preserves current behavior and remains the default.
SRT runtime: runs workspace commands through Sandbox Runtime.
SRT is opt-in per workspace. Existing workspaces, protocols, and providers continue to use the host runtime unless a human enables SRT.
Workspaces remain local directories managed by Paseo. This phase does not define an external Docker, Fly, or remote-workspace runtime contract.
Runtime architecture
Each SRT workspace gets a supervisor that:
Starts when the first command runs.
Owns child processes, PTYs, stdio, signals, and cleanup.
Stops five minutes after its last child exits.
Terminates its children if it crashes.
Never retries a failed command outside SRT.
The runtime receives an execution purpose and identity. This lets it apply different provider, terminal, Git, or script requirements without sharing private state.
Execution covered by SRT
Route all workspace execution through the selected runtime:
Every agent provider, including Claude, Codex, ACP, OpenCode, Pi, and custom providers.
Interactive terminals and terminal profiles.
Workspace scripts.
Setup and verification commands.
Scheduled and loop-launched agents.
Git and forge commands.
Worktree creation and checkout hooks.
Trusted daemon operations
Keep these outside SRT:
Persistence and workspace registry operations.
File watching and the human-facing file explorer.
Relay and desktop infrastructure.
Speech and quota helpers.
Browser automation.
Structured workspace creation and archive operations.
Agent-triggered daemon operations are brokered capabilities. Limit them to:
The caller’s workspace.
Worktrees derived from it.
Workspaces explicitly granted by a human.
The daemon remains part of the trusted computing base. Agents do not receive arbitrary daemon file or command access.
Worktree creation
For a sandboxed source workspace:
Paseo creates the exact empty target directory.
The source supervisor runs git worktree add.
That invocation gets temporary RW access only to the target and required Git metadata.
Checkout hooks run inside SRT.
Paseo writes its trusted workspace metadata.
The new workspace receives a snapshot of the source runtime policy.
Setup commands run through the new workspace’s supervisor.
The new workspace gets fresh private provider state. It does not inherit transcripts.
SRT integration
Pin an exact reviewed SRT version. Do not use a floating version range.
Carry a small upstreamable patch that:
Makes network configuration optional.
Skips SRT proxies and Linux network namespaces when network enforcement is disabled.
Allows Paseo to disable SRT’s shared writable compatibility paths, including /tmp/claude, ~/.npm/_logs, and ~/.claude/debug.
Makes Keychain-capable macOS security services opt-in.
Review the patch and generated sandbox policies before every SRT upgrade.
Networking
Network access is unrestricted in this phase.
Preserve the host network namespace.
Preserve cross-command localhost communication.
Keep Paseo’s workspace service proxy working.
Do not add TLS interception or SRT proxy environment variables.
Make no network-isolation claim.
Network restrictions will be handled in a later phase.
Platforms and dependencies
Support:
Linux.
macOS.
WSL2 when both Paseo and the agents run inside WSL2.
Do not support:
Native Windows.
A native Windows daemon launching agents through WSL.
Containers that require SRT’s weaker nested mode.
Paseo ships the pinned SRT library and checks the helpers required by the effective platform and policy, including:
bwrap
rg
The correct seccomp helper
Linux user-namespace support
Compatible AppArmor policy
Any remaining SRT helper required by the pinned version
A missing security mechanism is a hard activation failure. Paseo must not weaken the policy or fall back to host execution.
Keep these SRT options disabled:
Weaker nested sandboxing.
Weaker network isolation.
[macOS only] Apple Events and application launching.
Filesystem policy
Default read policy
The default policy protects user data:
Deny all user home directories.
Deny common removable and mounted-data roots.
Deny shared temporary directories.
Keep system paths broadly readable and read-only.
Re-allow only:
The current workspace.
A Paseo-created sandbox home exposed as $HOME. This is not the user’s real home directory.
Private runtime and provider state for the current invocation.
Declared provider inputs.
Explicit human-added paths.
Repository-local Git metadata required for local Git operations.
Strict read policy
Add an expert setting in Paseo’s host configuration:
User-data protection: the default described above.
Strict allowlist: starts with a hidden filesystem root and exposes only required system paths, the workspace, sandbox state, and explicit additions.
Strict mode is config-only rather than part of the normal workspace form. Users may need to add RO paths for binaries, dynamic libraries, package managers, and provider installations.
Missing paths cause the command to fail. They never cause host fallback.
Default write policy
Deny writes everywhere except:
The workspace.
The Paseo-created sandbox home.
Private temporary and provider state.
Required Git metadata.
Explicit human-added RW paths.
A human workspace path may override Paseo’s normal read baseline. It may not override immutable SRT or Paseo security denies.
Added paths
Each added path is RO or RW.
At configuration time, Paseo:
Expands home-relative input.
Resolves symlinks.
Requires the target to exist.
Stores its canonical absolute path.
Rejects conflicting RO and RW entries.
Use this same mechanism for optional credentials and tool configuration. Do not add separate workflows for SSH, GPG, forge, or provider files.
Repository configuration, provider output, and agents cannot add paths.
Protected files
Keep these write-protected even when their parent is writable:
Shell startup files.
.mcp.json.
Git configuration.
Git hooks.
IDE configuration.
Claude command and agent definitions.
Other mandatory paths protected by SRT.
Resolve both the worktree-specific Git directory and the common Git directory. Allow required metadata writes while denying writes to hooks and configuration.
Scan for existing nested Git hooks and Git configuration at activation instead of relying only on SRT’s default search depth.
Git and forge behavior
Do not expose user Git or forge credentials by default.
Repository-local .git/config remains readable because Git needs the repository’s remotes, branches, and worktree metadata.
Do not expose by default:
~/.gitconfig
SSH keys or configuration
SSH agent sockets
GPG keys or signing-agent sockets
Credential helpers
Forge configuration
Forge access tokens
Authenticated Git pushes are expected to fail until the user adds the required files or sockets. Commits may also require the user to add non-secret identity configuration.
Users expose any Git or forge files through the ordinary RO/RW path list. Paseo does not parse forge configuration or try to separate settings from credentials.
Unix sockets and local IPC
Unix sockets are denied by default.
macOS
Allow explicit socket paths.
At activation:
The socket must exist.
Paseo resolves its canonical path.
Paseo records its owner and permissions for the warning.
The service may later recreate the socket at the same path.
Linux
Initially support:
Deny all Unix sockets.
An explicit dangerous allow-all setting.
Path-specific Linux grants are deferred because current SRT cannot enforce them securely. Codex has the same Linux limitation.
macOS services
[macOS only] Provider declarations may optionally request Mach services when needed.
Keychain-capable services are not enabled globally. When a provider requests them, show that every descendant command shares the access.
[macOS only] Keep Apple Events disabled so open, osascript, and Launch Services cannot start applications outside SRT.
Environment and private state
Do not inherit the daemon’s full environment.
Each agent or terminal identity receives:
A Paseo-created sandbox home.
A private temporary directory.
A small compatibility baseline such as PATH, locale, shell, and terminal values.
Variables declared by its trusted provider or execution purpose.
Variables explicitly approved by a human.
Always remove unrelated daemon state, including:
PASEO_PASSWORD
PASEO_HOME
Relay credentials
Daemon control tokens
Unrelated cloud or provider credentials
The agent-bound Paseo MCP token is the only daemon capability injected automatically.
Provider integration
Extend trusted provider declarations with:
Read-only account inputs.
Writable state requirements.
Environment requirements.
Provider-home relocation.
Skills and configuration inputs.
[macOS only, when needed] Mach-service requirements.
Custom providers may declare the same requirements through trusted host configuration. Agents cannot edit these declarations.
Codex and Claude
Use:
CODEX_HOME for Codex.
CLAUDE_CONFIG_DIR for Claude.
For each Paseo agent:
Create a private provider home.
Seed approved account authentication, configuration, and skills on every provider launch.
Preserve that agent’s transcripts, cache, debug data, and native child-agent state.
Do not expose another Paseo agent’s transcripts.
Let native child agents belonging to the same provider session share their parent’s private state.
Reseeding replaces the private credentials with the current host-account credentials on every launch. Credential refreshes made inside the previous provider process are discarded at the next launch.
When importing a provider session:
Paseo reads the session through its trusted provider adapter.
It verifies that the session belongs to the current or granted workspace.
It copies only that session and required child state into the new private provider home.
Providers requiring shared state
Private writable state is the secure default, not a hard requirement.
If a provider requires shared writable paths:
Show the exact paths.
Warn that agents may read or alter other sessions and persistent state.
Let the user approve those paths through the normal workspace path configuration.
Never enable them silently.
Never fall back silently to host execution.
Provider-native sandboxes
Paseo does not change Claude or Codex native sandbox settings.
The UI may recommend disabling redundant provider-native command sandboxes, but Paseo neither owns nor depends on that setting.
Skills and MCP
Skills
Workspace skills remain inside the workspace.
Account-level skills are copied or projected read-only into the private provider home.
Skill scripts execute inside SRT.
A skill receives no access beyond the files and capabilities granted to its agent.
Paseo MCP
Keep Paseo’s MCP endpoint as the structured host-capability bridge.
Replace the shared daemon-run token with an agent-bound token containing:
Caller identity.
Current workspace.
Derived-worktree access.
Human-granted workspaces.
Human-granted external capabilities.
Revoke the token when the agent stops or is archived.
Agents may use only:
Their current workspace.
Worktrees derived from it.
Workspaces covered by a human grant.
A cross-workspace grant gives access to the current Paseo MCP operations for that workspace.
Warn when the target uses the host runtime. Such a grant lets a sandboxed agent start unsandboxed agents, terminals, or scripts there.
Other MCP servers
Stdio MCP servers run as descendants inside SRT.
Host HTTP or SSE MCP servers are external capabilities.
Browser tools are external capabilities.
Each external capability requires a per-workspace human grant.
Derived worktrees inherit those grants.
Because networking is unrestricted in this phase, grants cannot stop an agent from contacting an independently reachable unauthenticated host service.
Docker
Docker is unsupported in SRT workspaces.
Advanced users may experiment with:
A narrow Docker approval broker exposed through an allowed socket.
The raw Docker socket if they accept that it effectively defeats the sandbox.
On macOS, a broker socket can be granted by path. On Linux, either option currently requires the dangerous all-sockets setting.
Paseo does not implement, test, or advertise either option as supported Docker integration.
Workspace configuration and UI
Add optional workspace runtime policy containing:
Runtime: host or SRT.
RO and RW path additions.
macOS socket paths.
Linux’s dangerous all-sockets setting.
Cross-workspace grants.
External-capability grants.
Add trusted UI and CLI controls for:
Selecting the runtime during workspace creation.
Inspecting the effective policy.
Enabling or disabling SRT.
Managing paths, sockets, and grants.
Setting a host-wide default for newly created workspaces.
Keep strict root-deny as an expert host-config setting.
Existing workspaces without runtime fields use the host runtime.
Repository files and agent tools cannot change runtime policy.
Live changes
A workspace must be idle before changing:
Runtime selection.
Filesystem policy.
Socket policy.
Provider requirements.
Workspace grants.
External capabilities.
Show which agents, terminals, scripts, or setup commands are blocking the change.
Worktree inheritance
A derived worktree receives a snapshot of:
Runtime selection.
RO and RW additions.
Socket settings.
Cross-workspace grants.
External-capability grants.
Later source-policy changes do not modify existing worktrees.
Protocol compatibility
All new persisted and wire fields are optional.
Expose a server capability for runtime-policy support. New clients gate the UI on it. Old clients ignore the optional workspace fields.
Do not simulate SRT behavior against an old daemon.
Existing host workspaces and provider behavior remain unchanged.
Errors and diagnostics
Before activation, show:
SRT version.
Platform support.
Dependency results.
Effective read and write policy.
Socket policy.
Provider requirements.
Dangerous grants.
External capabilities.
Cross-workspace grants.
Attach sandbox denials to the affected command, agent, or terminal.
Redact secrets and credential-bearing URLs.
Do not add a separate security audit store. Normal agent history or terminal scrollback may retain the inline failure.
Test plan
Policy tests
Cover:
Canonical paths and symlinks.
Missing paths.
RO/RW conflicts.
Human overrides.
Immutable denies.
Default and strict read baselines.
Sandbox homes and temporary directories.
Environment allowlisting.
Worktree inheritance.
Idle-time policy changes.
Linux integration
Verify:
Protected home, mounted-data, and shared-temp reads fail.
Workspace and explicit RW writes succeed.
RO paths cannot be changed.
Unix sockets fail by default.
Missing seccomp support fails activation.
The dangerous all-sockets setting works only when enabled.
Path-specific socket entries are rejected clearly.
WSL2 follows the Linux behavior.
Unsupported AppArmor and container setups fail with useful errors.
macOS integration
Verify:
Seatbelt applies the expected RO/RW policy.
Only approved Unix socket paths work.
Keychain access is denied by default.
Provider-specific Mach requirements work when enabled.
Apple Events and application launching remain blocked.
Execution coverage
Prove that every relevant path uses the selected runtime:
All agent providers.
Terminals and terminal profiles.
Scripts.
Setup and verification.
Schedules and loops.
Git and forge commands.
Worktree creation.
Checkout hooks.
Add a guard test that fails if workspace-scoped execution reaches the host spawn implementation for an SRT workspace.
Git security
Verify:
Existing hooks run inside SRT.
Hook and Git-configuration writes fail.
Linked-worktree metadata remains usable.
Checkout hooks cannot escape during worktree creation.
Existing nested hook paths are protected at any depth.
Authenticated Git push fails without explicitly added credentials.
Provider tests
Run real Codex and Claude smoke tests proving:
Authentication succeeds.
New sessions work.
Resume works after supervisor restart.
Skills work.
Stdio MCP works.
Native provider child agents work.
One Paseo agent cannot read another agent’s transcripts.
Credential reseeding behaves as specified.
Capability tests
Verify:
Daemon APIs require password authentication.
Agent MCP requires the correct agent-bound token.
Workspace listing and mutations respect grants.
Browser uploads cannot read outside the caller’s workspace scope.
External MCP and browser tools require grants.
Grants to host-runtime workspaces show the escape warning.
Agents cannot edit their runtime policy.
Compatibility tests
Verify:
Existing host workspaces behave as before.
Localhost communication works.
Paseo’s service proxy reaches sandboxed scripts.
Missing dependencies never cause host fallback.
Old workspace records load as host-runtime records.
New protocol fields remain backward-compatible.
Run targeted test files, then typecheck, lint, formatting, and platform CI.
Accepted security limits
Network access is unrestricted in this phase. Agents can reach the internet and host TCP services.
Provider credentials are readable. Commands can read credentials copied into their private provider home and exfiltrate them.
Optional macOS Keychain access is broad. A provider-specific Mach grant may expose more than that provider’s own credential.
Linux cannot block future hook paths. Existing paths are protected and Paseo-launched hooks remain confined, but later host-side Git could execute a hook created in a new nested repository.
The default policy is not root-deny. System paths remain broadly readable unless the expert strict policy is enabled.
External capabilities execute outside SRT. Browser tools and trusted host MCP servers carry their own authority.
A grant to a host-runtime workspace permits unsandboxed execution there.
Linux’s all-sockets setting removes the Unix-socket boundary.
User-approved shared provider state may expose other sessions.
SRT is experimental. Every upgrade requires a policy and patch review.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
I've sketched how this could work. Alternatively, we could also roll bwrap/seatbelt ourselves instead of using anthropic's. Has some advantages, but we also need to maintain it.
Opt-in SRT execution runtime for Paseo
Summary
Add an internal workspace execution boundary with two implementations:
SRT is opt-in per workspace. Existing workspaces, protocols, and providers continue to use the host runtime unless a human enables SRT.
Workspaces remain local directories managed by Paseo. This phase does not define an external Docker, Fly, or remote-workspace runtime contract.
Runtime architecture
Each SRT workspace gets a supervisor that:
The runtime receives an execution purpose and identity. This lets it apply different provider, terminal, Git, or script requirements without sharing private state.
Execution covered by SRT
Route all workspace execution through the selected runtime:
Trusted daemon operations
Keep these outside SRT:
Agent-triggered daemon operations are brokered capabilities. Limit them to:
The daemon remains part of the trusted computing base. Agents do not receive arbitrary daemon file or command access.
Worktree creation
For a sandboxed source workspace:
git worktree add.The new workspace gets fresh private provider state. It does not inherit transcripts.
SRT integration
Pin an exact reviewed SRT version. Do not use a floating version range.
Carry a small upstreamable patch that:
/tmp/claude,~/.npm/_logs, and~/.claude/debug.Review the patch and generated sandbox policies before every SRT upgrade.
Networking
Network access is unrestricted in this phase.
Network restrictions will be handled in a later phase.
Platforms and dependencies
Support:
Do not support:
Paseo ships the pinned SRT library and checks the helpers required by the effective platform and policy, including:
bwraprgA missing security mechanism is a hard activation failure. Paseo must not weaken the policy or fall back to host execution.
Keep these SRT options disabled:
Filesystem policy
Default read policy
The default policy protects user data:
Re-allow only:
$HOME. This is not the user’s real home directory.Strict read policy
Add an expert setting in Paseo’s host configuration:
Strict mode is config-only rather than part of the normal workspace form. Users may need to add RO paths for binaries, dynamic libraries, package managers, and provider installations.
Missing paths cause the command to fail. They never cause host fallback.
Default write policy
Deny writes everywhere except:
A human workspace path may override Paseo’s normal read baseline. It may not override immutable SRT or Paseo security denies.
Added paths
Each added path is RO or RW.
At configuration time, Paseo:
Use this same mechanism for optional credentials and tool configuration. Do not add separate workflows for SSH, GPG, forge, or provider files.
Repository configuration, provider output, and agents cannot add paths.
Protected files
Keep these write-protected even when their parent is writable:
.mcp.json.Resolve both the worktree-specific Git directory and the common Git directory. Allow required metadata writes while denying writes to hooks and configuration.
Scan for existing nested Git hooks and Git configuration at activation instead of relying only on SRT’s default search depth.
Git and forge behavior
Do not expose user Git or forge credentials by default.
Repository-local
.git/configremains readable because Git needs the repository’s remotes, branches, and worktree metadata.Do not expose by default:
~/.gitconfigAuthenticated Git pushes are expected to fail until the user adds the required files or sockets. Commits may also require the user to add non-secret identity configuration.
Users expose any Git or forge files through the ordinary RO/RW path list. Paseo does not parse forge configuration or try to separate settings from credentials.
Unix sockets and local IPC
Unix sockets are denied by default.
macOS
Allow explicit socket paths.
At activation:
Linux
Initially support:
Path-specific Linux grants are deferred because current SRT cannot enforce them securely. Codex has the same Linux limitation.
macOS services
[macOS only] Provider declarations may optionally request Mach services when needed.
Keychain-capable services are not enabled globally. When a provider requests them, show that every descendant command shares the access.
[macOS only] Keep Apple Events disabled so
open,osascript, and Launch Services cannot start applications outside SRT.Environment and private state
Do not inherit the daemon’s full environment.
Each agent or terminal identity receives:
PATH, locale, shell, and terminal values.Always remove unrelated daemon state, including:
PASEO_PASSWORDPASEO_HOMEThe agent-bound Paseo MCP token is the only daemon capability injected automatically.
Provider integration
Extend trusted provider declarations with:
Custom providers may declare the same requirements through trusted host configuration. Agents cannot edit these declarations.
Codex and Claude
Use:
CODEX_HOMEfor Codex.CLAUDE_CONFIG_DIRfor Claude.For each Paseo agent:
Reseeding replaces the private credentials with the current host-account credentials on every launch. Credential refreshes made inside the previous provider process are discarded at the next launch.
When importing a provider session:
Providers requiring shared state
Private writable state is the secure default, not a hard requirement.
If a provider requires shared writable paths:
Provider-native sandboxes
Paseo does not change Claude or Codex native sandbox settings.
The UI may recommend disabling redundant provider-native command sandboxes, but Paseo neither owns nor depends on that setting.
Skills and MCP
Skills
Paseo MCP
Keep Paseo’s MCP endpoint as the structured host-capability bridge.
Replace the shared daemon-run token with an agent-bound token containing:
Revoke the token when the agent stops or is archived.
Agents may use only:
A cross-workspace grant gives access to the current Paseo MCP operations for that workspace.
Warn when the target uses the host runtime. Such a grant lets a sandboxed agent start unsandboxed agents, terminals, or scripts there.
Other MCP servers
Because networking is unrestricted in this phase, grants cannot stop an agent from contacting an independently reachable unauthenticated host service.
Docker
Docker is unsupported in SRT workspaces.
Advanced users may experiment with:
On macOS, a broker socket can be granted by path. On Linux, either option currently requires the dangerous all-sockets setting.
Paseo does not implement, test, or advertise either option as supported Docker integration.
Workspace configuration and UI
Add optional workspace runtime policy containing:
Add trusted UI and CLI controls for:
Keep strict root-deny as an expert host-config setting.
Existing workspaces without runtime fields use the host runtime.
Repository files and agent tools cannot change runtime policy.
Live changes
A workspace must be idle before changing:
Show which agents, terminals, scripts, or setup commands are blocking the change.
Worktree inheritance
A derived worktree receives a snapshot of:
Later source-policy changes do not modify existing worktrees.
Protocol compatibility
All new persisted and wire fields are optional.
Expose a server capability for runtime-policy support. New clients gate the UI on it. Old clients ignore the optional workspace fields.
Do not simulate SRT behavior against an old daemon.
Existing host workspaces and provider behavior remain unchanged.
Errors and diagnostics
Before activation, show:
Attach sandbox denials to the affected command, agent, or terminal.
Redact secrets and credential-bearing URLs.
Do not add a separate security audit store. Normal agent history or terminal scrollback may retain the inline failure.
Test plan
Policy tests
Cover:
Linux integration
Verify:
macOS integration
Verify:
Execution coverage
Prove that every relevant path uses the selected runtime:
Add a guard test that fails if workspace-scoped execution reaches the host spawn implementation for an SRT workspace.
Git security
Verify:
Provider tests
Run real Codex and Claude smoke tests proving:
Capability tests
Verify:
Compatibility tests
Verify:
Run targeted test files, then typecheck, lint, formatting, and platform CI.
Accepted security limits
All reactions