Skip to content

feat: let chezmoi agent profiles use the host Docker engine - #42

Merged
MrPointer merged 1 commit into
mainfrom
feature/agent-docker-access
Nov 13, 2026
Merged

MrPointer merged 1 commit into
mainfrom
feature/agent-docker-access

Conversation

@MrPointer

Copy link
Copy Markdown
Owner

📝 Summary

The installer's container tests need Docker, but nono sandboxes block the engine socket, so sandboxed agents working on this repository could not run them. This PR lets the chezmoi agent profiles (Claude Code, Codex, OpenCode) reach the host Docker engine through an opt-in, per-profile feature. Socket grants are added at launch only for installed runtimes and trusted sockets, and agents use a separate Docker client config without registry logins.

Key Decisions

🧩 Per-profile sandbox features

nono.zsh gains a generic registry, _nono_agent_enable <profile> <feature> and _nono_agent_has_feature, that holds no profile names. Each agent shell file declares its features at file level, not inside launcher functions, because editors start agents through nono-agent-acp, which sources the agent files but calls the internal launch helpers directly. A declaration at file level reaches both the shell launchers and the editor path.

🔌 Socket selection at launch

Docker sockets are granted by _nono_agent_run, not listed in nono profiles. A profile unix_socket entry would grant whatever socket exists at that path at launch. The launcher considers a socket only when its runtime is installed (OrbStack, Docker Desktop, or Colima), and only when the path is a real socket (not a symlink), owned by the user, and not writable by group or others.

🔐 Docker client config without logins

~/.docker stays denied, because config.json can hold registry logins, and its credential helpers can read the keychain. Docker-enabled agents get DOCKER_CONFIG=~/.config/docker-agent, which only lists the runtime plugin folders so compose and buildx still work. Like the read-only package caches in the language profiles, agents can use Docker but cannot log in or push. BUILDX_CONFIG points at a writable cache folder, because the client config is read-only inside the sandbox.

🐧 Linux untested

Only OrbStack on macOS has been tested. On Linux, native Docker Engine (/run/docker.sock) and rootless Docker are not covered. nono also does not check Unix socket connections on Linux unless a profile sets linux.af_unix_mediation: "pathname", so the opt-in may not be enforced there. The process doc, domain doc, and nono skill record this gap.

🔄 Before & After

Area Before After
Docker in chezmoi agent sessions Socket blocked, docker fails Works through the trusted runtime socket
Other agent profiles No Docker access Unchanged
Docker client config Blocked ~/.docker, warning on every command Separate config without logins, no warning
Per-profile launch options Not supported File-level feature declarations, shared by shell and editor launches
Documentation None for Docker Process doc, domain rules, and nono skill guidance

The installer's container tests need Docker, but nono sandboxes block
the engine socket, so agents working on this repository could not run
them.

Profiles now opt in to Docker through a per-profile feature declared
in the agent shell files, which both the shell launchers and the
editor ACP launcher load. At launch, the shared wrapper grants the
socket of each installed runtime (OrbStack, Colima, Docker Desktop)
only when the socket is a real socket owned by the user and not
writable by others. Agents use a separate Docker client config that
lists plugin folders but holds no registry logins, so ~/.docker stays
denied.

Only OrbStack on macOS has been tested; the Linux gaps are documented.
@MrPointer
MrPointer merged commit 90ada54 into main Nov 13, 2026
5 checks passed
@MrPointer
MrPointer deleted the feature/agent-docker-access branch November 13, 2026 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant