Using Herdr safely from an AI agent inside a nono sandbox through a proxy
The author runs Claude Code inside the nono[1] sandbox, a tool that limits a program's access to files, network and commands; on macOS it uses Seatbelt. He wants the agent to use the Herdr[2] terminal multiplexer for agents too, but opening Herdr directly would let the agent escape the sandbox, because the herdr-core[3] process that manages the terminals runs outside it.
The fix is a proxy between the agent's hc command and herdr-core; they exchange messages over Unix sockets in the JSON-RPC 2.0[4] format. The proxy enforces two rules: every new terminal runs its command wrapped in nono run, and the agent can only control terminals that nono manages. It rejects all other methods, including running on another machine and keep, which restarts a program's shell; keep is disabled because that shell would run outside nono.
The sandbox profile allows the agent to connect only to the proxy's socket, not to the real core's, and the hc connection address is set with the HC_SOCKET variable. The first Claude Code is started through the proxy by a launch script, so its terminal also gets the nono-sandboxed=1 label; otherwise the agent's messages to that terminal would be rejected. The proxy runs under launchd, and the author checks the setup with hc get, looking for the label and for the nono run wrapper. The author's conclusion is that Herdr stays useful for agents while the nono boundary holds.
Sources
-
JPZenn JA
サンドボックス内のAIエージェントにHerdrを安全に使わせたい


