Commit Graph
5 Commits
Author SHA1 Message Date
dckc d58b77aa89 feat(sandbox): an empty root, by NixOS confinement
The filesystem was the one part of the sandbox that started from the
host's view and hid places from it (/run, /var/lib, /tmp, /home), so
the argument had to assume no sockets elsewhere. Both units now start
from an empty root: their closure (fullUnit, so PATH's packages too),
/bin/sh, the state directory and the two sockets, and nothing else.
socat is added to Hermes's closure by hand, since only config.yaml
names it.

CONTRIBUTING's table now has one row for files and sockets by path,
and the "sockets the sandbox doesn't hide" caveat is gone.

Generated-by: Claude Opus 5.5
2026-11-29 16:51:19 -06:00
dckc 6d48662c94 docs: condense CONTRIBUTING; status moves to the PR description
Generated-by: Claude Opus 5.5
2026-11-29 16:44:28 -06:00
dckc 052a9dc640 docs: CONTRIBUTING, with the argument for Hermes's confinement
How to check a change (doctests, the demo, evaluation), and a
Confinement section: the claim, why it assumes nothing about Hermes or
its config, each channel a process could use and what closes it, what
the two sockets grant, the VM's added boundary, what's not claimed, and
what has and hasn't been checked, with a probe for a running host.

Generated-by: Claude Opus 5.5
2026-11-29 16:37:03 -06:00
dckc a4b704a38c fix(sandbox): one sandbox for every process running as Hermes's user
- The LLM bridge runs as Hermes's user but saw the host's /run. Where
  same-uid ptrace is allowed, Hermes could take it over and reach any
  socket there. It now gets Hermes's sandbox, with only llm.sock.
- A socket on a read-only mount still accepts connect(), so
  ProtectSystem=strict doesn't hide sockets under /var/lib. /var/lib is
  now empty, with the state directory bound back in.
- ProtectProc=invisible and ProcSubset=pid: other processes, and their
  command lines, are out of sight.

Generated-by: Claude Opus 5.5
2026-11-29 16:36:13 -06:00
dckc e38d681a9e feat: Hermes confined to act only as an Endo guest
A NixOS module (nix/hermes-guest.nix) layers confinement on upstream's
services.hermes-agent: no network (PrivateNetwork), an empty /run with
two Unix sockets bound back in, and no user manager. Hermes reaches the
world through host.sock, the guest's Endo methods (listMessages,
request, lookup, reply, ...) as MCP, and llm.sock, an inference proxy
that holds the API key.

The same unit runs on a Linux host (nix/linux-host.nix) and in a vfkit
microVM on macOS (nix/vfkit-vm.nix), where systemd relays the two
sockets over vsock to launchd on the host (nix/darwin-host.nix).

test/demo.py runs unmodified Hermes against a fake host and a scripted
model, and checks what the host received.

Generated-by: Claude Opus 5.5
2026-11-29 16:34:39 -06:00