mensfeld/code-on-incus
Give each AI agent its own isolated machine with root, Docker, and systemd. Active defense detects and stops threats automatically.
What it solves
Code on Incus (COI) provides a secure, isolated environment for AI coding agents to operate in. It prevents AI agents from having direct access to your host system, protecting your sensitive credentials, SSH keys, and environment variables while still giving the agents the full system-level access (root, Docker, package managers) they need to perform complex coding tasks.
How it works
COI uses Incus system containers—which behave like lightweight virtual machines with full init systems—rather than standard application containers. Each AI agent session is given its own container with its own home directory and a mounted project workspace.
To maintain security, COI implements:
- Active Defense: Kernel-level monitoring using nftables to detect and automatically respond to threats like reverse shells, data exfiltration, and credential scanning by pausing or killing the container.
- Credential Isolation: Host credentials are never exposed by default; they are only provided via explicit mounts or secure forwarding (like SSH agent forwarding).
- Protected Paths: Critical project files (like
.git/configand.vscodesettings) are mounted as read-only to prevent supply-chain attacks. - Sandbox Context: An auto-injected file (
SANDBOX_CONTEXT.md) informs the AI tool about its restricted environment.
Who it’s for
Developers who use AI coding agents (such as Claude Code, OpenCode, or pi) and want to grant them full machine access without risking their host system's security or stability.
Highlights
- Full System Access: Agents get root access and Docker support within the container.
- Real-time Threat Detection: Automatically pauses or kills containers upon detecting high-risk network activity.
- Parallel Sessions: Support for multiple isolated "slots" for the same workspace.
- Persistence: Containers can be persistent or ephemeral, with workspace changes always saved.
- Host Integration: Securely forwards SSH agents, specific TCP ports, and Unix sockets.
- Snapshotting: Ability to create checkpoints and rollback changes to the container state.
Related
- Project
- Project
- Dispatch
- Project
- Project