Workflow

Gateway Mobile Command Center

A remote-control workflow that routes Telegram or WhatsApp requests into persistent Hermes sessions.

Workflow field plateGateway Mobile Command Centerhx-workflow-gateway-mobile-command-centerLoading visual preview…
View full-size visual
Operational flow

Gateway allowlist and session isolation

Telegram and WhatsApp senders pass through an explicit allowlist, authorized chats reach separate persistent sessions, and unauthorized senders stop before agent access.

Gateway allowlist and session isolationTelegram and WhatsApp senders pass through an explicit allowlist, authorized chats reach separate persistent sessions, and unauthorized senders stop before agent access.Gateway allowlist and session isolationTelegram and WhatsApp senders pass through an explicit allowlist, authorized chats reach separate persistent sessions, and unauthorized senders stop before agent access.
  1. Input: Telegram sender. Numeric user ID
  2. Input: WhatsApp sender. Explicit phone allowlist
  3. Check: Allowlist gate. Default deny
  4. Process: Hermes gateway. Route by platform + chat
  5. Stop: Access denied. No agent or tool access
  6. Process: Telegram session. Own marker and history
  7. Process: WhatsApp session. Own marker and history
  8. Result: Isolated response. Survives gateway restart

Gateway Mobile Command Center

What it is

A remote-control workflow that routes Telegram or WhatsApp requests into persistent Hermes sessions.

Operating shape

  • Difficulty: intermediate
  • Cadence: continuous
  • Category: mobile-control

Core concepts

  • Gateway
  • Telegram Gateway
  • WhatsApp Gateway
  • Sessions
  • Secret Handling

Source evidence

  • web_server — Explicit Source Map scope boundary: hermes_cli/web_server.py is outside the approved Core scope.
  • Mastering Hermes Desktop: From Local Chat App to an Always-On Agent Control Center
  • Hermes Agent 完整入門:打造安全、可持續成長的私人 AI 助理

Implementation pattern

Outcome

Connect one explicitly allowlisted Telegram account, prove its session survives a clean Gateway restart, deny an unauthorized sender, and cleanly stop the test. Treat WhatsApp as an optional second phase only after Telegram passes.

Before you start

  • Complete a normal local Hermes chat before exposing a gateway.
  • In BotFather, create a disposable test bot; separately record the authorized account’s numeric user ID. A username is not an allowlist ID.
  • Prepare a second Telegram account for the negative test. Never use * or an allow-all flag.
  • Treat the Telegram token as a credential, keep it out of shell history and screenshots, and plan to revoke the disposable token after the lab.

Input and output contract

Authorized Telegram input is Remember this session marker only: TELEGRAM-LAB-27. After a clean restart, What is this chat's marker? must return TELEGRAM-LAB-27. An unallowlisted sender must receive no agent/tool access. No external action, file mutation, or cross-chat memory is requested.

Telegram expected: TELEGRAM-LAB-27
Unauthorized expected: no agent response and no tool execution

Build it

Finish Telegram before adding another platform:

hermes gateway setup
hermes gateway

In the setup wizard select Telegram, paste the BotFather token only when prompted, and enter only the authorized numeric user ID. Start the Gateway in the foreground. From the authorized account, send the marker and ask for it; from the unlisted account, send the same request and record that no agent or tool runs. Press Ctrl-C, confirm hermes gateway status reports stopped, run hermes gateway again, and ask for the marker once more.

Only after every Telegram check passes, optionally begin Phase 2: install Node.js 18+, use a dedicated test number, run hermes whatsapp, set an explicit WHATSAPP_ALLOWED_USERS number (never *), restart the foreground Gateway, and repeat the authorized/unauthorized tests with marker WHATSAPP-LAB-84. Phase 2 is a separate acceptance gate; it is not required to complete the Telegram lab.

Verify it

  • Telegram returns only TELEGRAM-LAB-27 before and after the clean restart.
  • The unlisted Telegram user is ignored or offered only the configured pairing flow, never agent/tool access; inspect redacted logs to confirm no agent run started.
  • hermes gateway status reports the intended profile and Telegram after restart.
  • Review logs without printing tokens or WhatsApp session material.
  • End with Ctrl-C and confirm stopped status. If you accidentally installed a background service, run hermes gateway stop. Revoke the disposable bot token with BotFather /revoke, remove the test bot from chats, and remove its test-only configuration before using real accounts.

If it fails

  • For Telegram, rerun hermes gateway setup and verify the numeric user ID rather than a username.
  • Do not troubleshoot WhatsApp until Telegram passes. In optional Phase 2, rerun hermes whatsapp if pairing expired and confirm Node.js 18+ plus the documented saved-session path.
  • If an unauthorized sender reaches the agent, stop the Gateway immediately, remove allow-all settings, repair the explicit allowlist, rotate the token, and rerun the Telegram negative test.

Safety, privacy, and cost

Use default-deny access control. Telegram bot tokens—and WhatsApp session keys if you choose Phase 2—grant account access and must never enter source control, prompts, screenshots, or diagnostics. Keep destructive tools and public posting behind approval. A running Gateway consumes host resources; model charges occur when authorized messages invoke the agent, so keep tests short and leave no lab service or disposable credential active.

Official references