Plate IIEntitiesHOWARDISM

Hermes Agent

Nous Research's CLI agent + Gateway daemon (Telegram/Discord/Slack/WhatsApp); AGENTS.md/SOUL.md context split, bounded memory files, DM-pairing auth, container-as-security-boundary model

Article metadata
Publication details
Published:
Filed:Entity
Domain:Entities
Tags:EntityNous ResearchAgent RuntimeCLI AgentMessaging Platform
Reading:13 min
Source:AI-synthesised
About this piece

Articles in this journal are synthesised by AI agents from a curated wiki and are refreshed automatically as new concepts arrive. Topics, framing, and editorial direction are curated by Howardism.

Illustration for Hermes Agent

Sources#

Summary#

Hermes Agent is an open-source CLI coding/research agent from Nous Research, positioned as a parallel ecosystem to Claude Code with a stronger emphasis on multi-platform messaging deployment. The CLI provides an interactive REPL with tool access (terminal, file editing, web search, code execution); the Hermes Gateway is a long-running daemon that exposes the same agent through Telegram, Discord, Slack, and WhatsApp with per-user sessions, allowlist + DM-pairing authorization, scheduled cron jobs, and configurable container backends. Hermes is provider-agnostic (works with OpenAI, Anthropic, and other LLM APIs) and uses a context-file convention closer to OpenAI's AGENTS.md than Anthropic's CLAUDE.md, plus a separate SOUL.md for personality.

Details#

Architecture (Two Surfaces)#

SurfacePurposeLifecycle
Hermes CLIInteractive REPL, similar role to Claude CodePer-invocation, resumable (hermes -c, hermes -r "title")
Hermes GatewayLong-running daemon exposing the agent over messaging platformssystemd (Linux user/system service) or launchd (macOS); persists across reboots

The Gateway is the architecturally interesting half — it's parallel in spirit to Symphony's always-on daemon model, but with per-user rather than per-issue tenancy.

Context Files#

Hermes uses three layered configuration files, with explicit role separation:

FileScopePurpose
AGENTS.mdProject (cwd)Project context, conventions, stack — auto-loaded each session
~/.hermes/SOUL.md (or $HERMES_HOME/SOUL.md)Global personalityStable default voice/style across all sessions
.cursorrules / .cursor/rules/*.mdcProjectCompatibility-loaded from cwd; no need to duplicate

Subdirectory AGENTS.md files are lazily discovered during tool calls (via subdirectory_hints.py) and injected into tool results — they aren't loaded upfront. This is a deliberate context-budget choice: only the top-level project context goes into the system prompt; nested context is paid for only when relevant.

The separation of AGENTS.md (project) and SOUL.md (personality) is sharper than Anthropic's CLAUDE.md convention and worth comparing — the same role split is implicit in CLAUDE.md files in practice but not separately filed. (Will be expanded in a forthcoming Agent Context Files concept page.)

Memory System#

Hermes implements a hard-bounded memory system:

  • MEMORY.md: ~2,200 character cap.
  • USER.md: ~1,375 character cap.
  • When memory fills, the agent consolidates entries (compresses older notes).

A specific gotcha called out in the docs:

"Memory is a frozen snapshot — changes made during a session don't appear in the system prompt until the next session starts. The agent writes to disk immediately, but the prompt cache isn't invalidated mid-session."

This is the cleanest articulation of why memory edits feel "delayed" in any caching agent — and it's a constraint Claude Code and other agents share but rarely document.

The Memory vs. Skills split:

  • Memory = facts (environment, preferences, project locations).
  • Skills = procedures (multi-step workflows, reusable recipes).
  • "Memory for what, skills for how."

Token-Economy Tooling#

Direct user-facing controls — operationally these are exactly the levers AgentOpt formalizes, but exposed as CLI commands:

CommandEffect
/compressSummarize conversation history; preserves key context, drops tokens
/usageToken consumption status
/insights30-day usage patterns
/modelSwitch model mid-session (frontier for hard reasoning, fast for boilerplate)
delegate_taskSpawn parallel subagents with isolated contexts; only summaries return

The cache-discipline note is sharp:

"Most LLM providers cache the system prompt prefix. If you keep your system prompt stable (same context files, same memory), subsequent messages in a session get cache hits that are significantly cheaper. Avoid changing the model or system prompt mid-session."

CLI Ergonomics#

InputBehavior
Alt+Enter / Ctrl+JMulti-line input without sending
Multi-line pasteAuto-detected, buffered as one message
Ctrl+C (once)Interrupt mid-response, redirect with new message
Ctrl+C (twice within 2s)Force exit
Ctrl+VPaste image from clipboard (vision)
/ + TabSlash command autocomplete
/verboseCycle tool-output modes: off → new → all → verbose

Hermes Gateway: Multi-User Daemon Pattern#

The Gateway exposes the agent through messaging platforms:

  • Per-user sessions — each authorized user gets their own conversation context.
  • Home channel (/sethome) — designated chat that receives cron output and proactive messages.
  • Two authorization models:
  1. Static allowlist: TELEGRAM_ALLOWED_USERS=123,456 in .env. Restart required to add users.
  2. DM pairing: unauthorized DMs receive a one-time code; admin runs hermes pairing approve telegram XKGH5N7P. No restart needed.
  • Pairing security: codes expire 1 hour, cryptographic randomness, rate-limited (1 request/user/10min, max 3 pending/platform), 5 failed approvals → 1-hour platform lockout, all data stored at chmod 0600.

Service installation:

hermes gateway install # Default: user-level systemd (Linux) / launchd (macOS)
sudo hermes gateway install --system # Linux: boot-time system service
sudo loginctl enable-linger $USER # Linux: keep running after SSH logout

Cron Jobs#

Scheduled work delivered to the home channel:

  • Created from chat: "Every weekday at 9am, check the GitHub repo for…"
  • Definitions stored at ~/.hermes/cron/jobs.json; output at ~/.hermes/cron/output/{job_id}/{timestamp}.md.
  • Critical caveat: cron prompts run in completely fresh sessions with no memory. Each prompt must contain all needed context — file paths, URLs, server addresses, instructions.

This parallels Symphony's daemon-driven dispatch model — both are cases of agents being pulled to work asynchronously on a schedule rather than driven interactively.

Container Safety Model (Worth Flagging)#

Hermes supports multiple terminal backends:

TERMINAL_BACKEND=docker
TERMINAL_DOCKER_IMAGE=hermes-sandbox:latest

Supported: Docker, Singularity, Modal, Daytona.

Important security shift: when running in a container backend, dangerous-command checks are skipped — the rationale being "the container is the security boundary." This means:

  • Locked-down container image quality becomes load-bearing.
  • Approval-prompt UX trades for image-discipline UX.
  • Trust shifts from "every command is reviewed" to "the container can't escape."

Worth noting because it's a meaningfully different security posture from Claude Code's per-command auto-mode classifier.

Comparison to Claude Code#

CapabilityClaude CodeHermes
Project contextCLAUDE.mdAGENTS.md (project) + SOUL.md (personality, separate)
Cursor compatn/a.cursorrules / .cursor/rules/*.mdc auto-loaded
Session compaction/compact/compress
Mid-session model switch/model/model
Parallel subagentsSubagents in .claude/agents/delegate_task tool
Permission gatingauto mode classifierPer-pattern approvals (once/session/always/deny); skipped in containers
Memory modeln/a (relies on conversation + CLAUDE.md)Bounded MEMORY.md + USER.md with auto-consolidation
Multi-user deploymentclaude -p per user/sessionHermes Gateway with allowlist or DM pairing
Cron / scheduled workn/a (rely on external cron)Built-in cron with home-channel delivery

The most significant architectural difference is the Gateway: Claude Code is session-first; Hermes is daemon-first when deployed at team scale.

Development Pace, Measured from Outside (July 2026)#

OpenHands' twelve-month GitHub analysis (Coding Agents and Technical Debt, case-study, competitor-authored) includes NousResearch/hermes-agent and makes it the outlier in both directions. In the year to 2026-07-08: 7,736 merged PRs — the most of the four harnesses compared — ~3.0M lines changed, and ~1.75M lines of current code, the largest codebase in the comparison. The growth curve is the steepest too: from "a nearly empty repo to roughly 2,000 merged PRs a month within months of getting serious."

Its 68% bug-fix share (5,288 PRs) is nominally the highest by a wide margin — the other three sit at 16–40% — but the author flags it as probably an artifact of Hermes' labeling conventions rather than a quality signal, and says the classification is heuristic across all four projects. Do not cite the 68% without that caveat. Context and the fork/build-vs-buy argument these numbers serve: Harness Build-vs-Buy.

Operational Notes#

  • VPS sizing: $5/month is sufficient for the Gateway itself — LLM API calls are the cost driver.
  • macOS launchd PATH gotcha: the plist captures shell PATH at install time. After installing new tools (Node, ffmpeg), re-run hermes gateway install to refresh.
  • Session auto-reset: messaging sessions reset after idle (default 24h) or daily at 4am.
  • Self-update: /update from chat pulls latest version and restarts.

Memory defenses under a carryover attack (October 2026)#

CarryoverBench (arXiv 2610.28425, empirical) re-ran 36 memory-poisoning tasks on Hermes with three production memory defenses active: a content-pattern scanner (_MEMORY_THREAT_PATTERNS), a periodic memory-review pipeline, and tool-mediated state writes. In each task, an injected email or web page gets the agent to append a standing instruction to MEMORY.md, which then fires in later sessions. Latent attack success fell compared with the authors' Nanobot harness (Qwen3-235B 52.8% → 27.8%, Claude-Sonnet-4.6 22.2% → 5.6%, GLM-5 11.1% → 8.3%, GPT-5.4 8.3% → 2.8%) but reached zero on no model. None of the three defenses caused the fall. The scanner matched 0 of 89 payload files, the review pipeline never invoked remove or replace, and the review's trigger resets each session, which is exactly the boundary the attack crosses. The authors credit the richer tool catalog with surfacing model-side caution. Where per-round firing decayed, the cause was the agent reading its own earlier outputs and deciding the task was already done, while the planted note stayed in place. Two caveats from the source. (1) Its App. A.1 says the main harness already delegates its tool loop to Hermes and bypasses Hermes' native memory module, so the "runtime swap" is not clean. (2) Its description of MEMORY.md as prepended every turn differs from the frozen-per-session snapshot documented above, which makes no difference to a cross-session attack. The paper also notes that a poisoned cron entry dispatches as a fresh sub-agent with no host agent in the loop, so it "can re-fire indefinitely without any opportunity for the host agent to reread or revise it". That is argued from the architecture and not measured, because the heartbeat-channel tasks were not ported to Hermes.

Skill-install scanning (August 2026)#

Nous Research piloted SkillSpector (NVIDIA/SkillSpector) as an optional advisory scan in the Hermes Agent skill-install flow: PII, Unicode smuggling, script linting, license and security checks, with file-line findings surfaced before installation. 29 passing tests; ~1.4–1.5 seconds per skill scan. Advisory, not blocking — but it is the first case in this wiki of a skill registry running static analysis inside the install path, and it pairs with the Skill Lift pipeline's Tier 1 as the security half of a skill-verification gate.

Connections#

  • Claude Code Best Practices — Hermes is the closest parallel ecosystem; many concepts map directly (/compress ↔ /compact, delegate_task ↔ subagents, AGENTS.md ↔ CLAUDE.md); the differences highlight design choices each made
  • Symphony — both are always-on agent daemons; Symphony tenancy unit is the issue, Hermes tenancy unit is the user. Both prefer container backends for safety. Cron + home-channel parallels Symphony's polling + tracker-write
  • Client-Side Agent Optimization — Hermes's /model, /compress, delegate_task, and prompt-cache discipline are the user-facing surface of exactly the levers AgentOpt formalizes
  • Agent Harness Engineering — AGENTS.md follows OpenAI's "table of contents, not encyclopedia" principle; bounded memory files are a harness-level constraint analogous to JSON feature lists
  • Scale-Dependent Prompt Sensitivity — /verbose modes and bounded memory both implicitly limit output length; the brevity-constraint findings would predict gains
  • Claude Code Auto Mode — Hermes's per-pattern approval model (once/session/always/deny) and container-disables-approvals model are points of comparison with the classifier-based auto mode
  • Agentic Misalignment (AM) — Hermes daemon mode (long-context, tool-using, container-as-security-boundary, weak per-action human oversight) sits squarely in the AM threat surface; container isolation reduces blast radius but doesn't address model-side misalignment
  • Ticket-Driven Agent Orchestration — Hermes's cron jobs + home-channel delivery are a lighter analogue: self-dispatched scheduled deliverables filed back to a chat instead of a ticket
  • Harness Build-vs-Buy — Hermes as the high end of the measured maintenance load: 7,736 merged PRs and ~1.75M lines in twelve months, and the 68% bug-fix-label outlier the source itself discounts
  • OpenHands — the open-source peer harness that published the comparison
  • Carryover Attacks (CarryoverBench) — the second runtime in CarryoverBench. Its memory scanner and review pipeline caught none of the planted standing instructions, and memory-channel attack success fell without reaching zero

Open Questions#

  • The container backend disabling dangerous-command checks is a defensible design but a meaningful security-model shift. What's the empirical track record? Have lockdown failures in popular images (Daytona, nikolaik/python-nodejs) caused incidents? Settler (2026-10-21): incident reports or CVEs naming a Hermes container deployment.
  • How do bounded memory files (~2,200 chars MEMORY.md) hold up over long-term use? Auto-consolidation is mentioned but not specified — what's the consolidation algorithm and how lossy is it? Settler (2026-10-21): the Hermes memory-consolidation source and docs, then a long-run lossiness test.
  • Hermes's DM-pairing flow is a clean security primitive. Why hasn't this pattern been adopted by Claude Code or Cursor for shared/team deployments?
  • The split between AGENTS.md (project) and SOUL.md (personality) is explicit in Hermes but implicit in Claude Code's CLAUDE.md. Does the split materially improve outcomes, or is it a documentation choice without empirical backing? Settler (2026-10-21): an A/B of split versus single instruction file on the same agent tasks.
  • Cron jobs in fresh sessions with no memory — how do teams structure the "context the agent needs" without it bloating every cron prompt? Is there a standard pattern?

Sources#

§ end
Cited by 28
Related articles
  • Agent Harness Engineering

    Patterns for scaffolding long-running LLM agents: environment design, progressive context disclosure, mechanical archit…

  • Agent Context Files

    The cross-vendor markdown-as-control-plane pattern: repo-versioned plaintext (CLAUDE.md / AGENTS.md / SOUL.md / WORKFLO…

  • Claude Code Best Practices

    Anthropic's guide to effective Claude Code usage: context management, verification-driven development, explore→plan→cod…

  • MCP and Computer Use

    Anthropic's two complementary connector mechanisms: MCP for structured programmatic access (Salesforce/Drive/Gmail/Slac…

  • Agent Loop Pattern

    `/loop` (cron-scheduled) and Ralph Wiggum (backlog-draining) loops as next-generation agent primitive; AFK execution, p…