A secure Docker environment for exploring Claude Code safely.
Project details
claude-airlock provides a hardened Docker sandbox for running Claude Code with enhanced security. Capture every action taken during the session while ensuring that the environment remains isolated and tamper-proof. Ideal for development and testing, this tool allows for in-depth analysis and control in a contained environment.
claude-airlock provides a secure and isolated environment for running Claude Code within a hardened Docker sandbox. This project ensures that only the relevant project is accessed, while all session activities are meticulously logged and monitored. Designed with developer security in mind, claude-airlock is versatile and works effectively from any shell or compatible editor that allows custom commands.
Containerized Sessions: Each session runs in a dedicated Docker container where only the current project is mounted, safeguarding it with a read-only root filesystem that minimizes risks by dropping unnecessary capabilities. Sensitive .env files are read as empty, and Claude's configuration is locked to read-only mode. On Linux, sessions can utilize gVisor for additional isolation through a specialized kernel.
Detailed Activity Logging: Every action within the session—including connections, DNS lookups, and processes—is recorded securely from outside the sandbox. This prevents any tampering with the logs, and outputs can be visualized through the --trace command, which flags any modifications or deletions during the session.
File Change Alerts: The system proactively notifies users when files that could execute commands on the host (such as Git hooks or Makefiles) are modified during a session, ensuring that developers are aware of potentially significant changes.
Line Mode Interface: A simplified user interface called Line Mode allows for greater clarity than the native display, presenting a clearer view of all operations while they occur.
Customizable Network Controls: Features including an egress filter and SSH agent are opt-in, providing users with the flexibility to activate or deactivate them based on project requirements.
Here's a quick example of how to run claude-airlock:
cd ~/code/my-project
claude-airlock # Builds the necessary image upon first use
claude-airlock -p "summarise this" < notes.txt # Pipe input without needing a TTY
With options for monitoring, debugging, and controlling what aspects of the environment are available, claude-airlock provides both operational efficiency and security for developers engaging with computational tasks in potentially sensitive contexts.
For more information about requirements, configuration settings, session management, and troubleshooting, consult the detailed sections in the README or docs.
Comments
0Start the conversation
Share the first comment.