Agents and automation

Hermes Agent bot mode: calling your agent from Telegram and Discord

The bot has shell access, so the gateway starts by admitting nobody.

Bot mode in Hermes Agent is the messaging gateway1. One background process receives Telegram, Discord, Slack and more, and also runs sessions and cron jobs. The default admits no one, so an allowlist2 or DM pairing comes first.

Requirements and key details
  • hermes gateway setup configures channels; start turns the gateway on.
  • By default every user outside the allowlist is denied.
  • The bot has terminal access, so avoid GATEWAY_ALLOW_ALL_USERS.

Bot mode is a program called the gateway

In a terminal, Hermes Agent starts with just hermes. Bot mode moves that conversation into a chat app, and a gateway process receives the channel and carries the session forward.

The same process checks cron jobs every 60 seconds, so scheduled work such as a morning digest can run through the bot.

A robot inside a clear enclosure sits beside a router, storage box, and documents
The gateway handles channels, sessions and cron in one process.

Connecting a channel and installing the service

hermes gateway setup is an arrow-key wizard. It marks channels already configured and offers to start the gateway when it finishes.

Closing the terminal stops the bot, so install it as a service to keep it running: a user systemd service on Linux, launchd on macOS, with status to check it.

Configure and run the gateway
hermes gateway setup     # 채널을 고르는 대화형 설정
hermes gateway install   # 재부팅 후에도 돌도록 서비스 등록
hermes gateway start
hermes gateway status
Credentials saved by setup persist across restarts.

Admitting nobody is the default

The gateway denies every user who is neither on the allowlist nor paired by DM. For a bot with terminal access that is the right default.

Allowlisting needs the exact numeric ID: TELEGRAM_ALLOWED_USERS=123456789 for Telegram, DISCORD_ALLOWED_USERS for Discord — the variable name differs per channel.

You do not need the ID in advance: an unknown sender who DMs the bot receives a one-time code, and hermes pairing approve telegram CODE admits them.

Two metal devices sit on a desk and shelf beside a laptop, with cables connected to a switch box in front
With an empty allowlist nobody receives a reply.

Requests from chat run with the same permissions

Tools do not get weaker because the request came from chat. A file deletion or shell command from a message runs exactly as it would from the terminal.

So pin a single working folder and leave paths outside it closed. Check group chats separately: there is a setting that keeps the bot from answering group messages not addressed to it.

One direct message is enough for a first check

After allowlisting and restarting, send a read-only request such as 'count the files' from your own account. A reply means it is wired; silence points back to the allowlist or channel name.

Send a longer job to the background and check that the result returns to the same conversation. If it stalls, start with hermes gateway status and the logs to see whether the session survived.

A person at a laptop is surrounded by connected document, spreadsheet, folder, image, settings, and robot panels
Make the first check a read-only request from your own account.

Terminology notes

  1. Gateway — A program that receives requests across clients, channels, models, or tools and routes them to the appropriate path.

    Back to the text
  2. Allowlist — A policy that permits only pre-approved targets, such as tools, commands, users, or network destinations.

    Back to the text

Frequently asked questions

What should you check first in this article?
Bot mode in Hermes Agent is the messaging gateway. One background process receives Telegram, Discord, Slack and more, and also runs sessions and cron jobs. The default admits no one, so an allowlist or DM pairing comes first.