Sandboxed system administration for LLM agents
Project description
Shannot Sandbox
Shannot lets LLM agents and automated tools safely explore your Linux systems without risk of modification. Built on PyPy sandbox architecture, it provides hardened sandboxing for system diagnostics, monitoring, and exploration - perfect for giving Claude or other AI assistants safe access to your systems.
Claude shannot do that!
Features
🔒 Run Untrusted Code Safely
- PyPy sandbox intercepts all system calls
- Virtual filesystem prevents unauthorized access
- Network-isolated execution (no socket access)
- Session-based approval workflow for subprocess execution
🤖 Perfect for LLM Agents
- Let Claude and other AI assistants explore systems safely
- Command approval profiles control what executes automatically
- Interactive TUI for reviewing queued operations
- MCP (Model Context Protocol) integration restored in v0.5.0
🌐 Control Remote Systems
- Run sandboxed scripts on Linux servers from any platform via SSH
- Zero-dependency SSH implementation using stdlib only
- Fetch files from remote hosts automatically
- No Python installation required on remote targets
⚡ Deploy in Minutes
- Zero external dependencies - pure Python stdlib only
- Auto-setup downloads PyPy runtime on first use
- No containers, VMs, or complex configuration required
- Works out of the box on any Linux system
Requirements
Host system:
- Python 3.11+ (CPython or PyPy)
- Zero external dependencies!
Sandboxed code:
- Must use Python 3.6 compatible syntax
- Requires a PyPy sandbox executable (auto-downloaded on first run)
Installation
- Host (any platform): Python 3.11+, zero runtime dependencies!
- Sandbox binary: PyPy sandbox (auto-downloaded on first run via
shannot setup)
Install Shannot
# Recommended: Install with UV (works on all platforms)
curl -LsSf https://astral.sh/uv/install.sh | sh # macOS/Linux
# Or for Windows: irm https://astral.sh/uv/install.ps1 | iex
uv tool install shannot
# Alternative: pipx (recommended for Ubuntu/Debian with PEP 668)
pipx install shannot
# Alternative: Traditional pip
pip install --user shannot
# Development install (contributors only)
git clone https://github.com/corv89/shannot.git
cd shannot
pip install -e .
Note: Shannot has zero runtime dependencies - pure Python stdlib only! The PyPy sandbox binary will be auto-downloaded when you first run shannot setup runtime.
Quick Start
1. Install the runtime
shannot setup runtime
This downloads and installs the PyPy 3.6 stdlib to ~/.local/share/shannot/runtime/. You can also run shannot setup for an interactive setup menu.
2. Run a script in the sandbox
shannot run script.py --tmp=/path/to/tmp
The sandbox binary (pypy-sandbox) is auto-detected from PATH or standard locations. The --tmp option maps a real directory to the virtual /tmp inside the sandbox.
3. Review pending sessions
shannot approve
Opens an interactive TUI for reviewing and approving queued operations from dry-run sessions.
How It Works
Unlike traditional container-based sandboxes, Shannot operates at the system call level, providing fine-grained control over exactly what sandboxed code can do.
Shannot uses PyPy's sandbox mode to create a secure execution environment:
- System call interception - All syscalls from sandboxed code are intercepted and virtualized
- Virtual filesystem - File operations map to controlled paths, preventing unauthorized access
- Subprocess approval workflow - Commands queue in sessions for human review before execution
- Session-based execution - Review, approve, or deny operations through an interactive TUI
- Zero persistence - All changes exist only within the session, nothing touches the real system
This architecture enables LLM agents to explore systems safely while giving humans final control over any potentially risky operations.
CLI Reference
shannot setup
Interactive setup menu or configuration subcommands.
Subcommands:
setup Interactive setup menu
setup runtime Install PyPy sandbox runtime
setup remote Manage SSH remote targets
setup mcp MCP server installation
shannot setup runtime
Install PyPy stdlib for sandboxing.
Options:
-f, --force Force reinstall even if already installed
-q, --quiet Suppress progress output
-s, --status Check if runtime is installed
--remove Remove installed runtime
shannot run
Run a script in the sandbox.
Usage: shannot run [options] <script.py> [script_args...]
Options:
--pypy-sandbox PATH Path to pypy-sandbox executable (auto-detected if not specified)
--lib-path PATH Path to lib-python and lib_pypy (auto-detected if not specified)
--tmp DIR Real directory mapped to virtual /tmp
--nocolor Disable ANSI coloring
--raw-stdout Disable output sanitization
--debug Enable debug mode
--dry-run Log commands without executing
--script-name NAME Human-readable session name
--analysis DESC Description of script purpose
--target USER@HOST SSH target for remote execution
shannot approve
Launch interactive TUI for reviewing and approving pending sessions.
shannot setup remote
Manage SSH remote targets for executing sandboxed code on remote hosts.
Subcommands:
setup remote add <name> Add a new remote target
setup remote list List configured remote targets
setup remote test <name> Test connection to a remote target
setup remote remove <name> Remove a remote target
shannot status
Show system health and configuration status.
Options:
--runtime Show only runtime installation status
--targets Show only remote targets status
Use Cases
System diagnostics for LLM agents - Let Claude or other AI assistants safely inspect system state without modification risk
Safe exploration - Test unfamiliar code or diagnose issues without worrying about side effects
Automated monitoring - Build scripts with guaranteed controlled execution
Example Workflow
# 1. Write a diagnostic script (Python 3.6 compatible)
cat > check_system.py <<'EOF'
import subprocess
import os
# Check disk space
print("=== Disk Usage ===")
subprocess.call(['df', '-h'])
# Check memory
print("\n=== Memory Info ===")
with open('/proc/meminfo', 'r') as f:
for line in f.readlines()[:5]:
print(line.strip())
# List running processes
print("\n=== Processes ===")
subprocess.call(['ps', 'aux'])
EOF
# 2. Run in sandbox (operations queue for approval)
shannot run check_system.py
# 3. Review and approve subprocess calls
shannot approve
# With remote execution on production server
shannot run check_system.py --target prod-server
# Check status
shannot status
Configuration
All settings are in a single TOML file:
- Project-local:
.shannot/config.toml(takes precedence) - Global:
~/.config/shannot/config.toml
Example config:
[profile]
auto_approve = ["cat", "ls", "find", "grep", "head", "tail"]
always_deny = ["rm -rf /", "dd if=/dev/zero"]
[audit]
enabled = true
rotation = "daily"
max_files = 30
[remotes.prod]
host = "prod.example.com"
user = "admin"
Security Considerations
⚠️ Important: Shannot provides strong isolation but is not a complete security boundary.
What Shannot provides:
- System call interception and virtualization
- Virtual filesystem isolation
- Subprocess execution control with approval workflow
- Zero network access (sockets disabled)
Known limitations:
- PyPy sandbox interpreter vulnerabilities could allow escape
- Virtual filesystem still exposes information about mapped paths
- No built-in CPU/memory resource limits
- Don't run as root unless necessary
For production use, combine Shannot with:
- Resource limits (systemd, cgroups)
- Principle of least privilege (dedicated service accounts)
- Regular security updates
See SECURITY.md for detailed security considerations.
License
See LICENSE file for details.
Project details
Release history Release notifications | RSS feed
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 shannot-0.8.2.tar.gz.
File metadata
- Download URL: shannot-0.8.2.tar.gz
- Upload date:
- Size: 109.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9a80eab511c5adb80b2bfd75747dcbf4c934999e9ea3e33f94dfd1cf891cb96c
|
|
| MD5 |
521751ee4505bc3cd16c56550f7b3720
|
|
| BLAKE2b-256 |
f08b7fa2b7bcaaccbc9309cc8882368f89ee06a800d0f3e487d376ab901e0923
|
Provenance
The following attestation bundles were made for shannot-0.8.2.tar.gz:
Publisher:
release.yml on corv89/shannot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shannot-0.8.2.tar.gz -
Subject digest:
9a80eab511c5adb80b2bfd75747dcbf4c934999e9ea3e33f94dfd1cf891cb96c - Sigstore transparency entry: 779837826
- Sigstore integration time:
-
Permalink:
corv89/shannot@6057f498ffb062ecf8102d6cf0cb1458600afba4 -
Branch / Tag:
refs/tags/v0.8.2 - Owner: https://github.com/corv89
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6057f498ffb062ecf8102d6cf0cb1458600afba4 -
Trigger Event:
release
-
Statement type:
File details
Details for the file shannot-0.8.2-py3-none-any.whl.
File metadata
- Download URL: shannot-0.8.2-py3-none-any.whl
- Upload date:
- Size: 103.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9bc002d6bafad80503869574d2b16fc455b2ff08f1ce81776937f7207e1c16e8
|
|
| MD5 |
649318e555b19c173ed36121b7feaf98
|
|
| BLAKE2b-256 |
231dca199af0c35c168f5e3d71295bb91b7768c74fa8e59b10105cd29fdc5f20
|
Provenance
The following attestation bundles were made for shannot-0.8.2-py3-none-any.whl:
Publisher:
release.yml on corv89/shannot
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
shannot-0.8.2-py3-none-any.whl -
Subject digest:
9bc002d6bafad80503869574d2b16fc455b2ff08f1ce81776937f7207e1c16e8 - Sigstore transparency entry: 779837827
- Sigstore integration time:
-
Permalink:
corv89/shannot@6057f498ffb062ecf8102d6cf0cb1458600afba4 -
Branch / Tag:
refs/tags/v0.8.2 - Owner: https://github.com/corv89
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@6057f498ffb062ecf8102d6cf0cb1458600afba4 -
Trigger Event:
release
-
Statement type: