Skip to content

The Hermes Plugin Model

Before reading the hook logic, understand the constraint space that was discovered by auditing the Hermes Agent source:

Mechanism Effect
pre_tool_call returning {"action":"block","message":...} Aborts the tool call. Returns error to model instead. The current in-flight model response is already complete and will be billed.
cron.jobs.pause_job(job_id, reason) Prevents the cron job from running again. Does not stop the current run.
pre_llm_call returning {"context": "..."} Injects text into the conversation context before the API call. Used for soft budget alerts.
Any read from the DB Fully available in any hook via db.py.
Attempted action Why it doesn’t work
Abort an in-flight model API call No hook fires after the call starts and before it ends. pre_api_request and pre_llm_call both fire BEFORE; their return value cannot abort.
Get token data from pre_llm_call This hook fires once per turn but before any API call. No token data is available here.
Get token data from post_llm_call This hook fires after the tool loop. No token data. Wrong hook for cost capture.

Source references (verified against hermes-agent source):

  • pre_llm_call return: agent/conversation_loop.py:687-722 (context injection only)
  • pre_api_request return: agent/conversation_loop.py:1235-1255 (return discarded)
  • pre_tool_call block: hermes_cli/plugins.py:1666-1707 ✅
  • cron.jobs.pause_job: cron/scheduler.py ✅

hermes-telemetry is an independent community plugin for Hermes Agent. It is not affiliated with or endorsed by Nous Research.