by mensfeld
Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically..
# Add to your Claude Code skills
git clone https://github.com/mensfeld/code-on-incusGuides for using ai agents skills like code-on-incus.
Last scanned: 5/15/2026
{
"issues": [],
"status": "PASSED",
"scannedAt": "2026-05-15T06:58:25.241Z",
"semgrepRan": false,
"npmAuditRan": true,
"pipAuditRan": true
}No comments yet. Be the first to share your thoughts!
coi)Isolated machines for AI coding agents - with active defense.
COI gives each AI agent its own machine - a full system container with root access, systemd, Docker, and the ability to install anything. Agents work like they would on a real server: run services, manage packages, use cron - without touching your actual system. Files stay correctly owned, no permission hacks needed.
Your credentials stay on the host. SSH keys, environment variables, and Git tokens are never exposed to AI tools unless you explicitly mount them. If something goes wrong, COI catches it - reverse shells, credential scanning, data exfiltration - and pauses or kills the container automatically. No manual intervention needed.
Built by developers, for developers who run AI agents and want to know what those agents are doing. Not a product, not a startup - a tool that does the job.

Currently supported:
Coming soon:
Tool selection:
coi shell # Uses default tool (Claude Code)
coi shell --tool opencode # Use opencode instead
Permission mode - Control whether AI tools run autonomously or ask before each action:
# ~/.coi/config.toml or .coi/config.toml
[tool]
name = "claude" # Default AI tool
permission_mode = "bypass" # "bypass" (default) or "interactive"
See the Supported Tools wiki page for detailed configuration, API key setup, and adding new tools.
Core Capabilities
Host Integration
[ssh] forward_agent = true)forward_env in config)[timezone] config)~/SANDBOX_CONTEXT.md tells AI tools about their environment (network mode, workspace path, persistence, etc.). Automatically loaded into each tool's native context system: Claude Code via ~/.claude/CLAUDE.md, OpenCode via the instructions field in opencode.json (opt out with auto_context = false)Security & Isolation
.env files, Git credentials, and environment variables are never exposed unless explicitly mountedsecurity.privileged=true is detected, which defeats all container isolationcoi health checks seccomp, AppArmor, and privilege settings to confirm full isolation.git/hooks, .git/config, .husky, .vscode mounted read-only to prevent supply-chain attackschattr +i during sessions, preventing unshare -m + umount bypass of read-only mounts (opt out: [security] host_immutable = false)user.useConfigOnly=true, preventing AI tools from committing as the default "code" user/dev/incus) disabled by default, preventing host path and topology leaksSafe Dangerous Operations
# Install
curl -fsSL https://raw.githubusercontent.com/mensfeld/code-on-incus/master/install.sh | bash
# Build image (first time only, ~5-10 minutes)
coi build
# Start coding with your preferred AI tool (defaults to Claude Code)
cd your-project
coi shell
# Or use opencode instead
coi shell --tool opencode
# That's it! Your AI coding assistant is now running in an isolated container with:
# - Your project mounted at /workspace
# - Correct file permissions (no more chown!)
# - Full Docker access inside the container
# - GitHub CLI available for PR/issue management
# - All workspace changes persisted automatically
# - No access to your host SSH keys, env vars, or credentials
Incus is a modern Linux container and virtual machine manager, forked from LXD. Unlike Docker (which uses application containers), Incus provides system containers that behave like lightweight VMs with full init systems.
| Capability | code-on-incus | Docker Sandbox | Bare Metal | |------------|-------------------|----------------|------------| | Credential isolation | Default (never exposed) | Partial | None | | Real-time threat detection | Kernel-level (nftables) | No | No | | Reverse shell detection | Auto-kill | No | No | | Data exfiltration alerts | Auto-pause | No | No | | Network isolation | Firewalld (3 modes) | Basic | No | | Protected paths | Read-only mounts | No | No | | Auto response (pause/kill) | Yes | No | No | | Audit logging | JSONL forensics | No | No | | Supply-chain attack prevention | Git hooks/IDE configs protected | No | No |