Hermes Reference¶
Complete guide to using the Hermes Agent with Preloop's Safety Layer.
Overview¶
Hermes is Nous Research's open-source autonomous coding agent. It supports MCP servers natively via its mcp_servers configuration block, which makes it a first-class citizen for Preloop onboarding.
Connecting Hermes to Preloop gives you:
- Tool governance — Every Hermes tool call passes through the Preloop MCP Firewall.
- Human approvals — Sensitive actions (writes, shell, money) can require approval from the Preloop dashboard, mobile, Slack, or email.
- Runtime sessions — Each Hermes process gets a durable runtime credential and shows up in the Agents view.
- Audit trail — Full request/response capture, attribution to a Hermes runtime principal, and exportable evidence.
Installation¶
Install Hermes from the upstream repository (see the Hermes docs for the latest options):
Hermes stores its configuration at ~/.hermes/config.yaml.
Onboard with the Preloop CLI (recommended)¶
The simplest path is to let the Preloop CLI find Hermes and rewrite its config so all MCP traffic flows through Preloop:
The CLI will:
- Detect a Hermes installation at
~/.hermes/(it also recognises~/.local/bin/hermesand an empty~/.hermes/config.yaml). - Back up
~/.hermes/config.yamlif one exists. - Insert a Preloop entry into the
mcp_servers:map pointing at your Preloop instance's/mcp/v1endpoint with a bearer token bound to a freshly minted runtime session. - Add a
preloop.controlblock withcontrol_ws_url,adapter_package, the durable bearer token, credential ID, managed agent ID, and runtime-session/source identity. The CLI can install and verify the runtime plugin withpreloop agents install-plugin hermes; the loaded plugin owns the always-open WebSocket to/api/v1/agents/control/wsso mobile, watch, and web clients can contact the agent after onboarding. - Register Hermes as a managed agent with
agent_kind: hermesso it appears in the Agents view with the Hermes icon.
If Hermes does not yet have a config file, Preloop will create one for you — you do not need to bootstrap ~/.hermes/config.yaml manually before running discovery.
If your Hermes build has not yet implemented or loaded the Agent Control adapter, this preloop.control block is ignored safely. MCP firewall and model gateway routing still work, and preloop agents validate hermes reports control_config_written, control_plugin_installed, control_plugin_verified, and control_channel_configured separately from the core managed MCP validation. Agent Control is not enabled until the adapter is running inside Hermes. The reusable Python integration kit and exact hook contract live in Agent Control Runtime Adapters.
Install the Agent Control runtime plugin¶
Managed onboarding writes the Preloop config and attempts to install the Hermes
runtime plugin through Hermes' own plugin manager when the hermes executable is
available on PATH or in ~/.local/bin. You can also run
preloop agents install-plugin hermes explicitly. If the native plugin installer is not
available, the CLI starts Preloop's managed Agent Control sidecar as an
actionable fallback so control readiness can still be verified. The standalone
plugin package in the Preloop repository is preloop-hermes-plugin:
preloop agents onboard hermes
pip install preloop-hermes-plugin
# or, if Hermes wraps PyPI installs:
# hermes plugins install preloop-hermes-plugin
preloop agents validate hermes
If command -v hermes is empty but Hermes was installed by pipx or the upstream
installer, add ~/.local/bin to PATH or invoke
~/.local/bin/hermes plugins install preloop-hermes-plugin directly. The package
registers via the hermes_agent.plugins entry point. Validation reports the
control channel as online after either the Hermes plugin or the managed sidecar
is loaded and sending presence or heartbeat events.
Agent Control Runtime Expectations¶
Agent Control is the user-facing name for live operator contact with enrolled agents. The backend WebSocket and command endpoint are implemented, but Hermes must provide native runtime behavior before an operator command can affect a running local agent:
- Read
preloop.control.control_ws_urland connect with the durable bearer token. - Own reconnect/backoff and keep the WebSocket open while the Hermes session is available for operator contact.
- Send heartbeat/status/presence envelopes so Preloop can show online state.
- Receive
send_messagecommand envelopes from web, mobile, or watch surfaces. - Advertise whether the runtime supports new sessions, existing sessions, text, voice metadata, and interrupts.
- Execute the command or inject it into the active Hermes session as a normal runtime action.
- Treat each operator message as an auditable user/operator turn in the current Hermes session, not as a hidden system prompt or policy bypass.
- Route any resulting tool calls and model calls through the configured Preloop MCP firewall and model gateway.
To preview without writing changes, pass the read-only flags to preloop agents discover (e.g. --dry-run).
Manual configuration¶
If you would rather wire Hermes by hand:
- Create an API key from Settings → API Keys in the Preloop dashboard.
- Edit
~/.hermes/config.yamland add Preloop to themcp_serversblock:
mcp_servers:
preloop:
url: https://preloop.ai/mcp/v1
headers:
Authorization: Bearer YOUR_API_KEY_HERE
enabled: true
- Verify the connection:
Preloop should appear in the list, and hermes mcp tools preloop should enumerate the tools your account exposes.
Usage¶
Hermes will:
- Discover the
pay_invoicetool through Preloop. - Send the tool call to the Preloop MCP Firewall.
- Trigger any matching approval workflow (dashboard, Slack, mobile).
- Receive the tool result once approval is granted.
Every call shows up under the Hermes runtime principal in the Agents view, and the durable bearer token issued during onboarding ties tool usage and model spend back to that agent.
Configuration locations¶
| Platform | Path |
|---|---|
| macOS / Linux | ~/.hermes/config.yaml |
| Project-scoped | ./.hermes/config.yaml |
Project-scoped configs override the user-level config. The Preloop CLI rewrites whichever config it discovers first (project-scoped takes precedence).
Troubleshooting¶
preloop agents discoverdoes not find Hermes — Ensure either~/.hermes/or~/.local/bin/hermesexists. You can also pass--include hermesto force-add the agent.- Tools are missing — Check that the API key used has the
mcp:readandmcp:writescopes, and that no MCP server allowlist is restricting Hermes from your account. - Approval requests time out — Increase
timeout_secondson the matching approval workflow or wire up a webhook so the Hermes session blocks until approval lands.
Related¶
- Connect your MCP client — Common steps for any MCP-compatible agent.
- Runtime Sessions — How Preloop tracks Hermes processes.
- Safety Layer & Access Rules — How tool calls are evaluated.