ai-jail
A local sandbox for AI coding agents on Linux and macOS limits host access while keeping development tools and agent credentials available by default.
ai-jail is a sandbox for developers who want to limit the damage an AI coding agent can cause through mistaken commands. It targets accidental changes outside a project, and doesn't provide a security boundary against malware or hostile code.
- Project boundaries: Agents can edit the project directory and get a separate temporary home, with controls to hide sensitive project files or grant access to specific host paths.
- Development tools: Toolchains and persistent dependency caches are available by default, along with filtered package-registry access for dependency downloads.
- Credential controls: The invoked agent's credentials and state are shared by default, but you can disable that access; GitHub, AWS and other tool credentials require explicit opt-in.
- Network restrictions: You can disable network access entirely or use filtered connections, with optional phantom credentials that keep real API keys outside the sandbox for requests to assigned hosts.
ai-jail runs locally on Linux and macOS and is open source under GPL-3.0. Its default toolchain access allows filtered registry traffic, so the default setup isn't fully offline. GPU, display, Docker socket and SSH access are disabled by default. Anything running inside the sandbox can use the agent credentials shared with it.
Linux uses bubblewrap with additional operating-system restrictions where available. macOS uses Apple's deprecated sandbox-exec interface. Neither backend protects against kernel or driver vulnerabilities, terminal emulator vulnerabilities, or all IPC and side-channel risks. Hostile workloads require a disposable VM.