Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

Hermes Agent Plugin Development and Production Practices

Hermes Agent Plugin Development and Production Practices

This chapter is for advanced users: how to extend Hermes through the plugin system, how to migrate from OpenClaw, and security and cost best practices for deploying Hermes to production.


Getting started with plugin development

Hermes supports three types of plugins: general plugins (tools + Hooks), memory providers, and context engines.

Example

Interactively manage installed plugins

hermes plugins

Command-line management

hermes plugins list

hermes plugins

install

<

path

hermes plugins

enable

<

name

hermes plugins disable

<

name

You can manage plugins in the dashboard; use the following command to start the Dashboard:



hermes dashboard

Open the dashboard in a browser, open the plugin list on the left, and you can see the installed plugins:

Hook system

The most commonly used plugin capability is Hooks - injecting custom logic at key points in the Agent lifecycle:

Example

File path: plugin directory/logging_plugin.py

Simple plugin example: log all LLM calls

from

hermes.

plugins

import

Plugin

,

hook

class

LoggingPlugin

(

Plugin

)

:

    name

=

"logging-plugin"

   

@

hook

(

"pre_llm_call"

)

    async

def

before_call

(

self

,

ctx

)

:

       

Triggered before each LLM call

       

print

(

f

"[LOG] About to call LLM, current context length: {len(ctx.messages)}"

)

   

@

hook

(

"post_llm_call"

)

    async

def

after_call

(

self

,

ctx

,

response

)

:

       

Triggered after each LLM call

       

print

(

f

"[LOG] LLM call finished, reply length: {len(response.content)}"

)

Available Hook points

Hook Trigger Timing Typical use
pre_llm_call Before an LLM call Log context, modify the Prompt
post_llm_call After an LLM call Log responses, statistical analysis
pre_tool_call Before a tool call (can intercept/modify) Permission checks, parameter filtering
post_tool_call After a tool call Result auditing, logging
on_message_received When a user message is received Message preprocessing, sensitive-word filtering
on_session_start When a session starts Initialize resources, inject context
on_session_end When a session ends Clean up resources, generate a summary

Register custom tools

Add entirely new tool capabilities to the Agent through plugins:

Example

File path: plugin directory/my_tools.py

Register a custom tool - the Agent can use it just like a built-in tool

from

hermes.

plugins

import

Plugin

class

MyPlugin

(

Plugin

)

:

    name

=

"my-tools"

   

def

register_tools

(

self

,

ctx

)

:

       

Register a custom tool so the Agent can see it in the system prompt

        ctx.

register_tool

(

            name

=

"my_custom_tool"

,

            description

=

"This tool does something; use it when the user needs X"

,

            parameters

=

{

               

"type"

:

"object"

,

               

"properties"

:

{

                   

"input"

:

{

                       

"type"

:

"string"

,

                       

"description"

:

"Input parameter description"

                   

}

               

}

,

               

"required"

:

[

"input"

]

           

}

,

            handler

=

self

.

my_tool_handler

       

)

    async

def

my_tool_handler

(

self

,

**kwargs

)

:

       

The tool's actual execution logic

        input_text

=

kwargs.

get

(

"input"

,

""

)

       

... processing logic ...

       

return

{

"result"

:

"done"

}


Migrating from OpenClaw

If you are using OpenClaw, the official zero-downtime migration plan is available:

Example

Export the OpenClaw configuration

openclaw

export

--format

hermes

openclaw-config.json

Import into Hermes

hermes import

--from

openclaw openclaw-config.json

Verify the migration result

hermes doctor

Key concept mapping

Concept OpenClaw Hermes
Agent definition JSON Agent configuration SOUL.md + config.yaml
Workflow Manually written YAML workflows Skills (SKILL.md)
Memory backend External database Built-in SQLite + pluggable
Skills/tools Code plugins Markdown skill files
Multiple instances Multi-process configuration Profile system

Production best practices

Security checklist

Recommended security configuration for production deployment:

Example

File path: ~/.hermes/config.yaml

Recommended security configuration for production

terminal

:

  backend

:

docker          

Required: isolate the Agent's command execution environment

approvals

:

  mode

:

smart              

Dangerous commands require approval (or manual for stricter control)

  cron_mode

:

deny          

Scheduled tasks deny dangerous commands by default

security

:

  redact_secrets

:

true    

Automatically redact sensitive information in logs (enabled by default)

Access control in environment variables:

Example

File path: ~/.hermes/.env

Production access control configuration

GATEWAY_ALLOW_ALL_USERS

=

false

         

Never allow all users

TELEGRAM_ALLOWED_USERS

= your user ID      

Explicit whitelist

Token cost control

Use cheaper models for auxiliary tasks to greatly reduce operating costs:

Example

File path: ~/.hermes/config.yaml

Use a separate model for auxiliary tasks to lower Token costs

auxiliary

:

  background_review

:

    provider

:

openrouter

    model

:

google/gemini-

3

-flash-preview    

No need to use the main model

  vision

:

    provider

:

openrouter

    model

:

google/gemini-

2.5

-flash-preview

  session_search

:

    provider

:

openrouter

    model

:

google/gemini-

3

-flash-preview

Multi-Profile gateway monitoring

Example

View the gateway status of all Profiles at once

hermes profile list

Restart all gateways in bulk

for

profile

in

coder assistant researcher;

do

 

$profile

gateway restart

done

Update strategy

One command updates both the code and the built-in skills of all Profiles:

Example

Update the code once + sync new built-in skills for all Profiles

hermes update

-> Code update (12 commits)

-> Skill sync:

   default (already up to date)

   coder (+2 new skills)

   assistant (+2 new skills)

Skills modified by the user are never overwritten. Updates only sync new and changed parts of the built-in skills.