Hermes Agent Hooks - Explained Simply

Julian Goldie — founder, AI Profit Boardroom
By Julian Goldie · 7 min read
Get The AI Profit Stack Join AIPB →
🎯 1,000+ done-for-you AI agent workflows 📅 4 live coaching calls every week 🛡️ 7-day refund + 30-day ROI guarantee 👥 3,400+ AI operators inside

Hermes agent hooks let you run your own code at fixed points in the agent's life: before a tool runs, before the model is called, when a session starts, when a subagent finishes, and more. Hermes Agent is built by Nous Research, and its docs list four hook systems: plugin hooks, shell hooks, gateway event hooks and outbound webhooks. The newest change landed on 1 November 2026: a pre_llm_call hook can now block a whole turn before any model request is made.

📺 Watch: NEW Hermes Agent Update Changes AI!

🔥 Get the Agent OS as a free bonus: AI Profit Boardroom members get the full Agent OS zip, prompt libraries, daily tutorials and weekly live coaching calls. → Get inside

If you handle client data, that matters: a policy hook can stop a prompt cold, and Hermes stores only a placeholder in its place.

What Hermes agent hooks are

A hook is a callback: Hermes fires an event and your code runs. The Event Hooks page in the docs splits them into four systems:

If you want to build agent systems like this without starting from zero, the AI Profit Boardroom ($69/mo) is where I share the setups, prompts and workflows I use every week.

Hermes agent hooks by type: observers vs control

The plugins page groups the shipped plugin hooks into three categories. The category decides what your hook is allowed to do.

CategoryHooks (examples)What the return value does
Directive/controlpre_tool_call, pre_llm_call, pre_verify, pre_gateway_dispatchCan block, approve, rewrite or inject. Hermes reads specific return shapes.
Transformtransform_tool_result, transform_terminal_output, transform_llm_output, pre_transcriptionThe first valid string replaces the content.
Observerpost_tool_call, post_llm_call, on_session_start, on_session_end, subagent_start, subagent_stop, on_stream_delta, post_compaction, pre_commandIgnored. They watch and log only.

The full list also covers API request, approval and kanban task events. The docs treat the Event Hooks catalog as the canonical list.

pre_tool_call: block, approve or rewrite a tool

pre_tool_call fires right before every tool runs. If the model calls three tools at once, it fires three times. Your callback can return an action of block with a message, and the tool never runs. The message goes back to the model as the error. It can return an action of approve, which sends the call to the human approval gate. Or it can return an action of modify with new args, which are merged over the originals before the tool runs.

Block always beats approve, whatever order the plugins registered in.

pre_llm_call: inject context into the turn

pre_llm_call fires once per user turn, after context compression and before the main loop. Return a context string and Hermes appends it to the user message for that turn. It never touches the system prompt. The docs say this is on purpose: the system prompt stays the same across turns, so the prompt cache keeps working.

The docs list memory recall, RAG context, guardrails and per-turn analytics as the main uses.

📺 Watch: NEW Hermes Agent Updates are INSANELY GOOD! 🤯

New in Hermes agent hooks: pre_llm_call can block a turn

Commit ad9229c was authored on 31 October 2026 and merged to main on 1 November 2026 (UTC). The latest tagged release is v0.22.5 from 23 October 2026, so this is on main and not in a tagged release yet.

Here is what it does, per the docs and the commit:

The commit message calls this the supported seam for DLP, privacy and policy plugins that previously had to patch core.

The placeholder: where the blocked prompt goes

Follow-up commit 792330d closed a gap where the blocked prompt could still reach a model later through compaction or search.

Now the blocked prompt is stored only as a placeholder that says the message was withheld by a pre_llm_call policy hook. That placeholder is what later turns replay. It is also what compaction summaries, session_search, external memory providers and the background memory review read. The text you typed is kept only as display metadata, so the CLI resume recap, the TUI, the desktop app and the dashboard still show it to you.

Two more fixes:

A blocked turn also skips session titling and external memory prefetch and sync.

📺 Watch: NEW Hermes Plugin Update is INSANELY GOOD! 🤯

Hermes agent hooks timeouts: fail open vs fail closed

This is the setting that decides whether a broken hook lets things through or stops them.

For Python plugin hooks, plugins.hook_callback_timeout is 30 seconds by default. Set it to 0 to turn it off. The max is 600. When a bounded callback runs past it, Hermes abandons it so the agent loop keeps moving.

Shell hooks have their own per-entry timeout: 60 seconds by default, capped at 300. They fail open by default too. Add fail_closed set to true on a pre_tool_call entry and a missing script, a timeout, a bad exit or junk output all block the tool instead.

Setting up Hermes agent hooks as shell hooks

  1. Write a script. By convention it lives in ~/.hermes/agent-hooks/.
  2. Add it under the hooks block in config.yaml, keyed by event name, with a command, an optional matcher regex (pre_tool_call and post_tool_call only), an optional timeout and an optional fail_closed.
  3. Run Hermes. The first time each event and command pair fires, Hermes asks for consent. The hooks_auto_accept setting skips that prompt.
  4. Check what's configured with hermes hooks list.

Hermes sends the script a JSON payload on stdin and reads JSON back from stdout. A pre_tool_call script that exits with code 2 blocks the tool, which matches the Claude Code and Cursor convention. A pre_llm_call script can return either an action of block with a message or a decision of block with a reason.

One warning from the docs: gateway hooks in ~/.hermes/hooks/ load with no sandbox. Read any handler.py before you drop it in.

Practical uses for Hermes agent hooks

Where hooks earn their keep:

Hooks pair well with the best Hermes Agent plugins and Hermes cron jobs. For the full operating system I run around agents like Hermes, read the Agent OS guide. For how I test the models behind them, see Goldie Bench.

Want help mapping hooks onto your own business? Book a free AI strategy session and we'll look at where guardrails and automation fit.

Hermes agent hooks FAQ

Do Hermes agent hooks work in the CLI and in Telegram?

Plugin hooks and shell hooks work in both. Gateway event hooks run only in the gateway.

Can a hook stop the model from seeing a prompt?

Yes, on main since 1 November 2026. A pre_llm_call hook that returns an action of block with a message stops the turn before any inference request. The prompt is stored as a withheld placeholder, so later turns, compaction and memory providers never read it. It is not in a tagged release yet. The latest tag is v0.22.5.

What happens if my hook crashes?

Each hook type has its own rule. A crashed or timed-out pre_tool_call blocks the tool. A crashed pre_llm_call is skipped and the turn runs. Shell hooks fail open unless you set fail_closed on a pre_tool_call entry.

Where do I get help building hooks into a real workflow?

Join the AI Profit Boardroom for the playbooks, or book a free AI strategy session. If you want a done-with-you plan for your team, the strategy session is the place to start.

Set up one pre_tool_call guardrail today, then add a pre_llm_call block once it ships in a tagged release.

What members say about the AI Profit Boardroom

Read all 114 reviews on Skool →

★ 4.9 out of 5 from 114 member reviews on Skool

Yosuke Sato, AI Profit Boardroom member review (5 stars, paying member for 17 months): The best Skool course you get for AI! I have attended a few Skool courses before, but AI Profit Boardroom is the most active community and has great support from the management team, including Julian! You can get the most up-to-date information and practical implementations in this community. I highly recommend this!Mazzie T, AI Profit Boardroom member review (5 stars, paying member for 10 months): My mind is blown everyday with all the content and the incredible information. So much support and I love the personalised attention and quick responses. The community is great and people are very responsive and helpful.Rene Clayton, AI Profit Boardroom member review (5 stars, paying member for 9 months): The AI Profit Boardroom is a GAME CHANGER people. I could not be more thrilled that I joined!! So much support, more information than you can even consume, a huge value for what the small fee was. I have grown my business, my knowledge and my FUN!. SUCH a fantastic leader and group of humans. I am incredibly honored to be a part of this fantastic group of intelligent humans :-) THANK YOU!Arpiet Malpani, AI Profit Boardroom member review (5 stars, paying member for 8 months): Incredible learning from Julian and team. I started out in march and was able to build end to end SAAS with the help and learning from this group. I am incredibly thankful to Julian for crazy support and prompt response.James Grimm, AI Profit Boardroom member review (5 stars, paying member for 7 months): I asked Julian for help finding local business websites with little to no traffic. Julian was gracious in providing me my personal "how-to" video instruction. Wow, this is the pinnacle of customer service! I am just one of 3,400 subscribers and Julian took the time to help me personally. Thank you Julian for your assistance and outstanding custoemr support and care. James (Jim) GrimmNick Good, AI Profit Boardroom member review (5 stars, paying member for 4 months): I’m part of many AI groups and hands down, what Julian Goldie, has built here…the classroom trainings are amazing, but the community he has created is second to none (the community is worth the cost of joining!). If you’re looking to become the AI expert and build/create something meaningful, then AI Profit Boardroom is for YOU!Steven Gray, AI Profit Boardroom member review (5 stars, paying member for 4 months): Been in awhile. I’m a dad on a factory shift, not a tech bloke. Julian’s lot showed me how to use AI without drowning in tools. Avatar, voice, the workflow thinking — that’s what I needed. If you’re stuck on “where do I start,” this group’s worth it. I always read them.Steve Erickson, AI Profit Boardroom member review (5 stars, paying member for 4 months): I asked Julian a simple question, and he ended up creating a 10-minute video and a guide breaking down in extreme detail what I had asked. Amazing response!Rod Martin, AI Profit Boardroom member review (5 stars, paying member for 3 months): Julian is brilliant, and more prolific than I can keep up with (which is a great thing). His AgentOS is remarkable, and he is THE go-to guy for what you can really do (and not do) with the ever-increasing deluge of new AI upgrades and tools. HIGHLY recommend.Daniel Shulman, AI Profit Boardroom member review (5 stars, paying member for 4 months): Julian is very helpful. He doesn't try sell stuff you dont need and will give you a straight answer to your questions.Rj Herzog, AI Profit Boardroom member review (5 stars, paying member for 5 months): Top notch. If you are searching & searching thinking there is always something better out there.... You just found it. No need to look any further. Goldie covers it all & is super helpful. Can't beat the group either. Really can't recommend this group enough.Jermey Matthews, AI Profit Boardroom member review (5 stars, paying member for 6 months): While he has the capacity to do it, Julian is definitely doing the unscalable things to support his community.

Ready To Join The #1 AI Community?

Join 3,400+ entrepreneurs inside the AI Profit Boardroom. Get the Agent OS, 1,000+ plug-and-play AI agent workflows, daily Q&A with Julian and 4 live coaching calls every week.

Join The AI Profit Boardroom →

7-Day No-Questions Refund • 30-Day ROI Guarantee

← Back to all posts