Isolated sandbox for AI coding agents
Project description
agent-leash
Sandbox runner for AI coding agents:
- Restricts filesystem access to the current directory
- Custom allow-list to expose more directories as read-only or read-write
- Intercepts all network traffic with interactive per-domain approval
- Controls access to host services (podman, docker, ssh-agent, etc.)
$ pipx install agent-leash
$ aleash claude
Sandbox UI available on http://localhost:7612/
How it works
- Filesystem — bubblewrap restricts the agent to the current working directory. The rest of the filesystem is read-only or hidden.
- Network — mitmproxy intercepts all outbound HTTPS. Each new domain triggers a browser popup (and desktop notification). You choose: always allow, allow once, always block, or block once.
- Web UI — Vue 3 + xterm.js frontend served on
localhost:7612. Shows live terminal output, domain decisions
Requirements
| Tool | Install |
|---|---|
bwrap (bubblewrap) |
dnf install bubblewrap / apt install bubblewrap |
xdg-dbus-proxy |
dnf install xdg-dbus-proxy / apt install xdg-dbus-proxy |
| Python ≥ 3.11 | system or pyenv |
mitmproxy is installed automatically as a Python dependency.
Usage
Pass arguments
aleash claude -- --dangerously-skip-permissions
aleash run python script.py --some-flag
Terminal size
By default the local terminal controls the PTY size. The browser shows the fixed-size terminal with scrollbars. Use --browser-master to invert this (browser FitAddon resizes the PTY):
aleash --browser-master claude
Profile override
aleash --profile generic claude # run claude with the generic profile
Profiles
| Profile | What it binds |
|---|---|
claude |
~/.claude, ~/.claude.json, ~/.gitconfig, ~/.local/share/claude |
opencode |
~/.opencode, ~/.gitconfig, and opencode config/cache dirs |
generic |
nothing extra |
claude and opencode are auto-detected by binary name. Use --profile to override.
Data
All state lives in CWD/.aleash/:
| Path | Content |
|---|---|
CWD/.aleash/data.db |
SQLite: sessions, terminal logs, domain decisions |
~/.mitmproxy/ |
mitmproxy CA cert (auto-generated on first run) |
Delete CWD/.aleash/data.db to reset all history.
Contributing
See CONTRIBUTING.md.
License
MIT — see LICENSE.
Project details
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 agent_leash-0.8.0.tar.gz.
File metadata
- Download URL: agent_leash-0.8.0.tar.gz
- Upload date:
- Size: 376.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a238767e782d7f03abff7b12e2064a8b8726e3e7466b74d760451ec3753613fc
|
|
| MD5 |
27a98f149067474c35858f95ce2f70d4
|
|
| BLAKE2b-256 |
22089bcfe077dad05bfa856a035c5186385ec25d57fcebe0a817766de29aada5
|
Provenance
The following attestation bundles were made for agent_leash-0.8.0.tar.gz:
Publisher:
release.yml on mathieu-lacage/agent-leash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_leash-0.8.0.tar.gz -
Subject digest:
a238767e782d7f03abff7b12e2064a8b8726e3e7466b74d760451ec3753613fc - Sigstore transparency entry: 1780019414
- Sigstore integration time:
-
Permalink:
mathieu-lacage/agent-leash@83603a006d185ba64091f0ab2a7dba98c7d47a23 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/mathieu-lacage
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@83603a006d185ba64091f0ab2a7dba98c7d47a23 -
Trigger Event:
push
-
Statement type:
File details
Details for the file agent_leash-0.8.0-py3-none-any.whl.
File metadata
- Download URL: agent_leash-0.8.0-py3-none-any.whl
- Upload date:
- Size: 130.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0b57ea3b6ee2ea54d9e1d9519091fbdf596347c36b9363be0157cbbab58f587
|
|
| MD5 |
4c3c84b0cebb6367ccd4cd431547f0a0
|
|
| BLAKE2b-256 |
224a1a462b286743ed7718490f7dfcf7bb03f3efbea744e38ba53b7b91c45a25
|
Provenance
The following attestation bundles were made for agent_leash-0.8.0-py3-none-any.whl:
Publisher:
release.yml on mathieu-lacage/agent-leash
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_leash-0.8.0-py3-none-any.whl -
Subject digest:
a0b57ea3b6ee2ea54d9e1d9519091fbdf596347c36b9363be0157cbbab58f587 - Sigstore transparency entry: 1780019539
- Sigstore integration time:
-
Permalink:
mathieu-lacage/agent-leash@83603a006d185ba64091f0ab2a7dba98c7d47a23 -
Branch / Tag:
refs/tags/v0.8.0 - Owner: https://github.com/mathieu-lacage
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@83603a006d185ba64091f0ab2a7dba98c7d47a23 -
Trigger Event:
push
-
Statement type: