Run claude code in an isolated container sandbox.
uvx trusted-agent claude --dangerously-skip-permissions "Do something"
Backends
The backend is auto-selected from the host OS. Override with --backend {auto,podman-gvisor,apple-container}.
podman-gvisor(Linux default) — rootless podman running images under gVisor'srunsc. Two layers: container + user-space kernel. RequirespodmanandrunsconPATH.apple-container(macOS default) — Apple's nativecontainerCLI. Each container runs in its own minimal Linux VM viaVirtualization.framework, so the VM boundary is the sandbox. Requires Apple Silicon and macOS 15+ (macOS 26 recommended). Ifcontaineris not installed, the tool prompts to install it via Homebrew (brew install --cask container);container system startis invoked automatically when the service is not running.
You need to be signed-in in claude-code on the host.
Security delta on macOS
The Linux backend applies several defense-in-depth knobs that have no equivalent under Apple Container and are skipped there:
--cap-drop=ALL,--userns=keep-id,--security-opt=no-new-privileges,--pids-limit, and the cgroup flags (--cgroup-manager=cgroupfs,--runtime-flag=ignore-cgroups).
Apple's container CLI does not expose any of these Linux-side knobs. On macOS the per-container Linux VM provides a hardware-backed isolation boundary that those flags were emulating in software.
Agents
The first token of the command picks which host configs are projected into the sandbox. Unknown commands (e.g. bash) get no projections.
claude(default) —~/.claude.json,~/.claude/.credentials.json,~/.claude/settings.json,~/.claude/plugins/.opencode—${XDG_DATA_HOME:-~/.local/share}/opencode/(auth tokens) and${XDG_CONFIG_HOME:-~/.config}/opencode/(config, agents, skills).crush—${XDG_CONFIG_HOME:-~/.config}/crush/and${XDG_DATA_HOME:-~/.local/share}/crush/.
Each set is copied to a temp dir before mounting, so token refreshes and in-session writes never touch the host originals. The bundled variants only ship claude; install opencode or crush in a custom variant Dockerfile to use them.
Variants
Pick a pre-built image variant with --variant NAME (defaults to default):
default— node + python + common dev tools.nodejs— addspnpmandyarn.rust— adds the Rust stable toolchain (with clippy and rustfmt).android— adds JDK 17 and the Android SDK.
uvx trusted-agent --variant rust claude
Drop your own Dockerfile at ~/.config/trusted-agent/variants/<name>/Dockerfile to add a variant. User variants take precedence over bundled ones with the same name. To extend the lean base, start your file with FROM trusted-agent-default:latest.
Image caches are not shared between backends — each backend builds into its own store on first use.
Changelog
All notable changes to this project are documented in this file. The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
0.10.0
Added
- Project host configs for
opencodeandcrushinto the sandbox when those are the command being run. Claude Code remains the default and keeps its existing projections; running anything else (e.g.bash) projects nothing. - Apple backend forwards the host's DNS servers (
--dns) to bothcontainer runandcontainer build. Works around apple/container#402: the gateway DNS proxy silently fails to start whenever another host service (e.g. Mullvad's local resolver) holds port 53, leaving containers without DNS.
Fixed
- Apple backend now detects whether the
containerCLI usesimageorimagesas its image-management subcommand (renamed in 0.6.0). The old hardcodedimagesmadeimage_existsalways fail, so every run rebuilt the image from scratch. - On macOS, Claude Code stores its OAuth tokens in the login Keychain, not
in
~/.claude/.credentials.json; the credentials projection now falls back to theClaude Code-credentialsKeychain item, so the sandbox no longer starts logged out. - Homebrew install hint updated:
containerships as a formula now, not a cask (brew install container).
0.7.2
Fixed
nodejsvariant build no longer collides with the pnpm/yarn corepack shims that ship innode:22-slim(npm install -gnow passes--force).
0.7.1
Fixed
trusted-agent --help/-hnow prints local usage and exits instead of building the image and forwarding the flag toclaudeinside the sandbox.
0.7.0
Added
- Image variants. The single Dockerfile is split into
default(lean base with Python),nodejs(adds pnpm + yarn),rust, andandroid. Pick one with--variant NAME. Users can drop their own variant at~/.config/trusted-agent/variants/<name>/Dockerfile; user variants take precedence over bundled ones.
Changed
- Image is now tagged
trusted-agent-<variant>:latestinstead oftrusted-agent:latest. The old image is no longer built and can be removed withpodman image rm trusted-agent:latest. defaultvariant no longer bundles the Rust toolchain or the Android SDK; use--variant rust/--variant androidto get them.
0.6.2
Added
- Render the changelog on the PyPI project page alongside the README, via the
hatch-fancy-pypi-readmebuild hook.
0.6.1
Added
- Mirror the host's
~/.claude/plugins/into the sandbox at container start so installed plugins are available without manual reinstall. Carries overenabledPluginsandextraKnownMarketplacesfrom the host's~/.claude/settings.jsoninto the projected user settings.
0.5.0
Added
- Bind-mount the git common dir for linked worktrees so git commands resolve inside the sandbox.
- Rust toolchain (stable, with clippy and rustfmt) and the Android SDK (cmdline-tools, platform-tools, API 34, build-tools 34.0.0) in the image.
0.3.0
Added
- Install
uv/uvxin the sandbox image. - README with basic usage.
0.2.0
Added
- First working version: run Claude Code inside a podman + gVisor sandbox with
a projected
~/.claude.json, projected credentials, and a/workspacebind-mount.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file trusted_agent-0.10.0.tar.gz.
File metadata
- Download URL: trusted_agent-0.10.0.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
74b8e31b6602f3484b88e245eb00a63eed4a92aa64c1f6ff60657b5bc16a910d
|
|
| MD5 |
9d168ae61d96b48d2a088bce8b7a40f7
|
|
| BLAKE2b-256 |
27925b1556b9a0eee7068040b44701d968329a9dee5410c50b309c007a6857c6
|
Provenance
The following attestation bundles were made for trusted_agent-0.10.0.tar.gz:
Publisher:
publish.yml on almet/trusted-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trusted_agent-0.10.0.tar.gz -
Subject digest:
74b8e31b6602f3484b88e245eb00a63eed4a92aa64c1f6ff60657b5bc16a910d - Sigstore transparency entry: 2340512731
- Sigstore integration time:
-
Permalink:
almet/trusted-agent@ca75bb684d0e7269996bf6abb15448e475fb8b98 -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/almet
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ca75bb684d0e7269996bf6abb15448e475fb8b98 -
Trigger Event:
push
-
Statement type:
File details
Details for the file trusted_agent-0.10.0-py3-none-any.whl.
File metadata
- Download URL: trusted_agent-0.10.0-py3-none-any.whl
- Upload date:
- Size: 16.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3d2cfb5f41c45a437fcbbe29b9fc67a66dd63a63f523c9e8a81b15792d55d0d
|
|
| MD5 |
c0557a6fbc7a6d30654ee06cdde359a5
|
|
| BLAKE2b-256 |
768f086622701d45fb828bea19729abf13494a7bb8c7704f2f0619416b00f392
|
Provenance
The following attestation bundles were made for trusted_agent-0.10.0-py3-none-any.whl:
Publisher:
publish.yml on almet/trusted-agent
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
trusted_agent-0.10.0-py3-none-any.whl -
Subject digest:
a3d2cfb5f41c45a437fcbbe29b9fc67a66dd63a63f523c9e8a81b15792d55d0d - Sigstore transparency entry: 2340512736
- Sigstore integration time:
-
Permalink:
almet/trusted-agent@ca75bb684d0e7269996bf6abb15448e475fb8b98 -
Branch / Tag:
refs/tags/v0.10.0 - Owner: https://github.com/almet
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ca75bb684d0e7269996bf6abb15448e475fb8b98 -
Trigger Event:
push
-
Statement type: