Ai Agent Sandbox banner
janvojt janvojt

Ai Agent Sandbox

AI community

Description

A secure bubblewrap-based sandboxing solution for running Claude Code with strict filesystem isolation.

Installation

This entry records only its repository, not the path inside it, so there is no exact command to give. Open the source below and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

README

AI Agent Sandbox Script

A secure bubblewrap-based sandboxing solution for running AI coding agents with strict filesystem isolation.

Features

  • Whitelist-based filesystem access - Only explicitly allowed paths are readable
  • Blacklist protection - Block sensitive files within working directory
  • Full network access - Both local and internet access enabled
  • Configurable environment - Optional .env files and direct variables, no SSH agent access
  • Virtualenv support - Optionally expose the active Python virtual environment
  • Working directory isolation - Full read-write only in current directory

Requirements

  • bubblewrap - Install with:
    • Debian/Ubuntu: sudo apt install bubblewrap
    • Fedora: sudo dnf install bubblewrap
    • Arch: sudo pacman -S bubblewrap
  • An AI coding agent - Claude Code or OpenCode are currently supported

Installation

  1. Make the script executable:
chmod +x ai-agent-sandbox.sh
  1. (Optional) Move to a directory in your PATH:
sudo mv ai-agent-sandbox.sh /usr/local/bin/ai-agent-sandbox
  1. Create configuration directory:
mkdir -p ~/.config/ai-agent-sandbox
  1. Copy and customize the whitelist and blacklist files:
cp whitelist-example.txt ~/.config/ai-agent-sandbox/whitelist.txt
cp blacklist-example.txt ~/.config/ai-agent-sandbox/blacklist.txt
  1. Edit the files to match your needs:
nano ~/.config/ai-agent-sandbox/whitelist.txt
nano ~/.config/ai-agent-sandbox/blacklist.txt

Usage

Basic usage:

./ai-agent-sandbox.sh

Custom whitelist/blacklist:

# Single custom file (default file is still included)
./ai-agent-sandbox.sh \
  --whitelist /path/to/my-whitelist.txt \
  --blacklist /path/to/my-blacklist.txt

# Multiple whitelist/blacklist files
./ai-agent-sandbox.sh \
  --whitelist ~/shared-whitelist.txt \
  --whitelist ./project-whitelist.txt \
  --blacklist ~/shared-blacklist.txt \
  --blacklist