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.
Metadata
Release files for agent-leash 0.13.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| agent_leash-0.13.0.tar.gz | 378.3 kB | With provenance | Details for agent_leash-0.13.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| agent_leash-0.13.0-py3-none-any.whl | Python 3 | none | any | Details for agent_leash-0.13.0-py3-none-any.whl |
Total release size: 509.8 kB
Release files / agent_leash-0.13.0.tar.gz
| Download URL | agent_leash-0.13.0.tar.gz |
|---|---|
| Size | 378.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cf1eeac0f874c88b69c5c1da27a88847c1e921305e48376c78e99b5998262d50
|
|
BLAKE2b-256 checksum How to use checksums |
3f7ac8a320c2b266e1f8eaefe4bbe603bfdcdd9cdfd070e1d275c9f251a42d7c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logRelease files / agent_leash-0.13.0-py3-none-any.whl
| Download URL | agent_leash-0.13.0-py3-none-any.whl |
|---|---|
| Size | 131.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
cac032d5455ee09d9f7219cab9fafc1e4cbb77fbafaea6485f598f2e067db39c
|
|
BLAKE2b-256 checksum How to use checksums |
2917616c51c813c85859e6e5c0df560087b967df14aca7a59e00a3a27ebe6fe3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logSecurity for agent-leash 0.13.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for agent_leash-0.13.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 28, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.