akitaonrails/ai-jail
Multi-OS sandbox to run AI agents with better constraints (it is not 100% secure, but enough)
What it solves
AI coding agents—like Claude, Codex, or Devin—can make mistakes that damage the host system, such as running a mistyped command that deletes unrelated important files outside the project. ai-jail solves this by running the agent inside an OS sandbox, keeping the project directory as the blast radius. It is designed to prevent accidents from a trusted-but-fallible agent, not to defend against malware or a motivated attacker. With ai-jail, you can enable auto-accept ("YOLO mode") in AI harnesses with reasonable confidence that nothing outside the project will be harmed.
How it works
ai-jail places the AI agent inside an OS sandbox. On Linux, it uses bubblewrap plus Landlock, seccomp, and resource limits; on macOS, it uses Apple's sandbox-exec. The first run in a project opens a terminal UI that reviews host access before anything is saved. You can choose from presets like "Fully closed", "For developers" (the default), or "Mostly open", and you can make granular adjustments. The "For developers" preset grants filtered model API access, harness login/state, dependency tooling, and the active host GitHub token (shown as OPEN because it carries all token permissions). Everything else—network, GPU, display, audio, and more—is off by default. The project directory is writable, but the rest of the host is hidden unless you explicitly expose it. The saved policy lives under ~/.config/ai-jail/projects (or $XDG_CONFIG_HOME), outside the project, and can be reviewed later with ai-jail configure.
Who it’s for
AI coding agent users who want to run agents like Claude, Codex, Devin, or similar with less risk of accidental damage. It's also for tool and wrapper developers who can integrate with ai-jail via a versioned wrapper integration contract. ai-jail is not a hard-security tool; it does not replace a disposable VM when running genuinely hostile or untrusted code.
Highlights
- Runs AI agents in an OS sandbox: bubblewrap + Landlock + seccomp on Linux, sandbox-exec on macOS.
- First-run interactive review shows exactly what access is granted; presets like "Fully closed", "For developers", and "Mostly open" simplify setup.
- The project directory is the blast radius; everything else is exposed only by explicit per-capability choice.
- Saved policy lives in a config file outside the project, easy to review or reconfigure.
- Supports --no-agent-state for isolated, logged-out runs.
- Integrates with Devin CLI and other harnesses, sharing credentials and state safely.
- Wrapper integration contract for tool developers, included with ai-memory and available to any launcher.
- Secure defaults: network, GPU, display, audio, and many other host resources are off by default.
Related
- Project
- Project
- Project
- Project
- Project