Hermes agent is root-equivalent and its approval gate can be bypassed #9

Open
opened 2026-11-16 10:39:00 -05:00 by polen · 0 comments
Owner

Problem

Docs state the agent's privilege is limited to nixos-rebuild on this repo. In practice the hermes user is root-equivalent and most of the approval gate can be bypassed:

  • sudo: the rule in devices/server/configuration.nix has no argument restriction and allows SETENV. sudo nixos-rebuild switch --flake /any/path is arbitrary root.
  • docker group: root by itself.
  • command_allowlist: auto-approves python3 /var/lib/hermes/workspace/tmp/* (the agent writes there, so arbitrary code), curl *, nix develop *, nix build *, go test *, sqlite3 *.
  • git push origin * is auto-approved, which contradicts "per-action approval on polen/*" in AGENTS.md.
  • security.tirith_enabled = false.

The agent reads untrusted text (web search, flyers, shared calendars) and runs on a third-party model. One prompt injection gives root on the host that holds the budget data and every sops secret.

Fix (options, to decide)

  • Replace the sudo rule with a polkit start-only rule on nixos-deploy.service (same model as the Forgejo runner), so the agent can only deploy main.
  • Remove hermes from the docker group, or give it a read-only socket proxy.
  • Drop workspace/tmp/*, curl *, nix develop * and git push origin * from the allowlist, or narrow them.
  • Restore NoNewPrivileges and ProtectSystem = "strict" once sudo is gone.
  • Update AGENTS.md and docs/agent-autonomy.md to describe the real boundary.
## Problem Docs state the agent's privilege is limited to `nixos-rebuild` on this repo. In practice the `hermes` user is root-equivalent and most of the approval gate can be bypassed: - **sudo**: the rule in `devices/server/configuration.nix` has no argument restriction and allows `SETENV`. `sudo nixos-rebuild switch --flake /any/path` is arbitrary root. - **docker group**: root by itself. - **command_allowlist**: auto-approves `python3 /var/lib/hermes/workspace/tmp/*` (the agent writes there, so arbitrary code), `curl *`, `nix develop *`, `nix build *`, `go test *`, `sqlite3 *`. - **`git push origin *`** is auto-approved, which contradicts "per-action approval on `polen/*`" in `AGENTS.md`. - **`security.tirith_enabled = false`**. The agent reads untrusted text (web search, flyers, shared calendars) and runs on a third-party model. One prompt injection gives root on the host that holds the budget data and every sops secret. ## Fix (options, to decide) - Replace the sudo rule with a polkit start-only rule on `nixos-deploy.service` (same model as the Forgejo runner), so the agent can only deploy `main`. - Remove `hermes` from the `docker` group, or give it a read-only socket proxy. - Drop `workspace/tmp/*`, `curl *`, `nix develop *` and `git push origin *` from the allowlist, or narrow them. - Restore `NoNewPrivileges` and `ProtectSystem = "strict"` once sudo is gone. - Update `AGENTS.md` and `docs/agent-autonomy.md` to describe the real boundary.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
polen/nixos#9
No description provided.