Connecting Hermes Agent to Telegram takes three steps. Create a Telegram bot with BotFather, give Hermes the bot's token, and tell Hermes which Telegram users may talk to it. The part that matters most for safety is the allowlist, because an agent that can act on your machine should only obey you. This article summarises what the official Hermes documentation and Telegram's bot pages say, as I read them in November 2026. Commands and settings can change, so follow the current docs, not this summary.
What Hermes Agent and the Telegram connection are
Nous Research describes Hermes Agent as a self-improving AI agent that keeps memory across sessions. It can run on a remote machine while you reach it from messaging apps. Its documentation has a messaging gateway section that lists Telegram among the supported platforms. In plain terms: Hermes runs somewhere, a small gateway program connects it to Telegram, and you chat with it from your phone.
That convenience has a cost. An agent can use tools and change things, so anything that can send it a message has real influence over it. Treat the Telegram link like a door into your computer. Before you start, decide where Hermes will run, who else uses that machine and what files it can reach. The bot inherits that access. If you are unsure, begin on a spare machine or a test folder with nothing private in it.
The setup, step by step
- Read the Telegram page in the Hermes docs first, under the messaging platforms section. Do not rely on a video or an old blog post.
- In Telegram, open the official BotFather account and send the command to create a new bot. You choose a display name and a username that ends in bot. BotFather replies with a token.
- Find your own numeric Telegram user ID. The Hermes docs say access is controlled by numeric user IDs, not usernames. They mention helper bots you can message to see yours.
- Configure Hermes. The docs describe an interactive route through a gateway setup command. They also describe a manual route where you add two values to a settings file: the bot token and the list of allowed user IDs.
- Start the gateway with the command the docs give, then send your bot a test message from your own account.
- Ask a friend, or use a second account, to message the bot. They should be refused. That confirms your allowlist works.
Restrict who can talk to the bot
Anyone who knows or guesses a bot's username can try to message it. That is why the allowlist is not optional. In the Hermes docs, the setting for allowed users takes a comma-separated list of numeric IDs. Put in only your own ID at first. If you later add a group, the docs describe separate group allowlists. They note that Telegram's privacy mode for bots is on by default, so read that section before changing it.
- Start with one person: you.
- Add someone else only after you understand what the agent can do for them.
- Keep the bot out of public groups.
- Re-check the allowlist whenever you change the setup.
Keep the bot token secret
Telegram's bot documentation says the token is the bot's identifier. Store it in a secure place, because anyone who has it can control your bot. The Hermes docs say the same in their own words and add that tokens should not be left in shared files or logs. Practical habits follow from that.
- Never paste the token into a chat, a screenshot, a support ticket or a public repository.
- Keep it in the settings file the docs name, and make sure that file is not synced to a shared folder.
- Do not put it into an AI assistant while asking for setup help. Use the word TOKEN as a placeholder.
- If you see it anywhere it should not be, treat it as leaked.
Stopping the bot and revoking access
The Hermes docs list commands to check the gateway status, stop it and restart it. Stopping the gateway ends the connection from your side. To cut off a leaked token, go back to BotFather. The two official sources I read name slightly different commands. The Hermes page mentions revoking. Telegram's feature page describes a token command to generate a new token, and a command to delete a bot altogether, which cannot be undone. Open BotFather's menu, use the option it shows today, then update the token in Hermes.
A short pre-flight checklist
- I read the current Hermes Telegram page.
- The allowlist contains only my numeric ID.
- The token is stored in one place and nowhere else.
- I tested that another account is refused.
- I know the command that stops the gateway.
- I know how to get a new token from BotFather.
Safety: what never goes into the bot
Good to know
Never type real customer, patient, bank, account, card, ID, password or other personal or confidential information into an AI tool unless your employer has approved that exact tool. Doing so can break workplace rules and data-protection law, and you can be held responsible. A personal Telegram bot is almost certainly not an approved workplace tool, so use made-up or anonymised examples with it.
Official pages to check
- hermes-agent.nousresearch.com/docs: the overview and the Telegram page under messaging platforms, both read.
- core.telegram.org/bots and core.telegram.org/bots/features: how bots, tokens and BotFather work, both read.
- Your employer's rules, if you plan any work use.
The agent courses below cover the ideas, limits and checks in a gentler order.
Common questions
Do I need to code to connect Hermes Agent to Telegram?
The Hermes docs describe an interactive setup command and a manual route that edits a settings file, so you mostly follow steps rather than write code. You still need to be comfortable with a terminal and a text file, and you should read the current docs first.
Who can talk to my bot?
In general, anyone on Telegram can find a bot by its username, so you should set an allowlist. The Hermes docs describe a list of numeric Telegram user IDs for this purpose. Do not run the bot until it is set.
What if my bot token leaks?
Treat it as compromised. Stop the gateway and ask BotFather for a new token. Telegram's pages describe a command for this, and the Hermes docs mention revoking, so open BotFather and use the option it currently offers.
Official pages to check
AI tools change quickly. Check the vendor's current help page before you act, and review anything an AI tool produces before you rely on it.