Confine.Nix — AI skill for Claude Code
Sandbox for AI coding agents on macOS, declared in Nix, enforced by the kernel.
How to install Confine.Nix
This entry records only its repository, not the path inside it, so there is no
exact command to give. Open tbsklg/confine.nix and copy the folder into
~/.claude/skills/, or the file into ~/.claude/agents/.
What Confine.Nix does
Sandbox for AI coding agents on macOS, declared in Nix, enforced by the kernel.
Alternatives in AI
- Agent Kernel — Minimal kernel to make any AI coding agent stateful 334 ★
- Cplt — Sandbox for AI coding agents 114 ★
- Enso OS — The first AI plugin that speaks first 88 ★
README
confine.nix
A sandbox for any command-line program on macOS: a coding agent, a test runner, an install script you don't trust.
You write a `confine.toml`: which program runs, which tools it may use and which API it may reach. confine starts the program under a Seatbelt profile that denies everything else. Your credentials stay outside the sandbox: a gateway adds an API's key, and a broker runs your tools with their own logins.
confine uses [Nix](https://nixos.org) to build the programs the sandbox may run and to keep them read-only.
This reduces what the program can reach, but it is not a complete isolation boundary; see [Security limits](docs/README.md#security-limits). Apple Silicon only.
Quickstart
This sets up Claude Code as the program. You need [Nix](https://nixos.org/download) with flakes, and a Claude login: run `claude` once outside confine and log in.
mkdir -p ~/.confine/envs/dev && cd ~/.confine/envs/dev
nix flake init -t github:tbsklg/confine.nix
nix profile add .
Then, in a project:
confine-dev claude
The env is configured in `~/.confine/envs/dev/confine.toml`, where the sandbox can't read or change it:
#:schema ./confine.schema.json
name = "dev"
preset = "claude"
[gateway.anthropicOauth]
After editing it, run `nix profile upgrade --all`. Until then, `confine-dev` keeps using the sandbox you installed.
Documentation
- Using confine: set up, reach an API, give the program tools, update, security limits, troubleshooting
- Reference: confine.toml, confine, confine-client, debug log
- Upgrade notes: what to change after an update
- confine in Nix: your own presets, gateways and catalogs
- Design: why the sandbox is built outside the project
- Changelog: what changed, and why
- Development
Presets, gateways a
Related Skills
Zandy.Nix
Sandbox for AI coding agents on macOS, declared in Nix, enforced by the kernel
Skilljail
Manifest-declared, kernel-enforced least privilege for AI agent skills (Claude Code SKILL.md). Seatbelt/Landlo
Agentacl
Access control and sandboxing for AI coding agents on macOS. Stop Claude Code, Codex, Gemini CLI, Copilot CLI
BulkheadScope
Sandbox policy reality-check and least-privilege minimizer for AI coding agents. Merges every permission layer
Fable Director
Token governance for Claude Code: the top model directs, execution goes to the cheapest adequate means. Routin
Agentlanes
Run several AI coding agents on one machine without collisions: file leases, job slots, an event log, and kern
Related Agents
Reality Checker Tram
Tier-2 Harness Auditor for Team RAM. Cross-session, cross-project health audits. Verify invariants are enforce
Kernel Coding Style Critic
Specialist critic for linux-kernel-dev answers · scores ONLY coding style — kernel coding-style.rst adherence