All plugins

hermes-telegram-talk

Owner-only Telegram Mini App voice surface and cryptographic initData launch-gate library for Hermes Agent: two-stage HMAC initData verification, fail-closed replay guard (fails closed on both read/parse and write errors; only ENOENT starts empty), single-active launch token, origin-locked HTTP with strict CSP, exact-owner menu-button installer, and WebRTC voice delegation to Hermes api_server with curated waveform/orb accent themes. Disclosure — runs a local Node 24+ loopback HTTP service (default 127.0.0.1:18790, behind the operator's own HTTPS reverse proxy) spawned by the hermes telegram-talk CLI command with a minimal child environment; credential-bearing outbound requests go only to https://api.openai.com (paid OpenAI Realtime voice API using VOICE_TOOLS_OPENAI_KEY/OPENAI_API_KEY kept server-side; call audio and recent call messages sent to OpenAI), https://api.telegram.org (Bot API owner-scoped menu installer and owner-chat replies using TELEGRAM_BOT_TOKEN), and the operator-configured hermes.base_url (default http://127.0.0.1:8642 using API_SERVER_KEY; plain http: rejected unless host is loopback), with non-official hosts/ports for live.base_url and telegram.api_root rejected at config load; hermes telegram-talk menu --apply also sends unauthenticated GET health-check requests (redirect: manual) to the configured mini_app_url (<mini_app_url> and <mini_app_origin>/plugins/telegram-talk/health, or loopback with --via-loopback); reads declared secrets via agent.secret_scope.get_secret; optionally reads one operator-configured plain-text brief file ([brief] enabled, off by default) and writes 0600 replay state and append-only call transcripts under the active profile's <HERMES_HOME>/plugin-data/hermes-telegram-talk; spoken requests delegate to Hermes api_server under Hermes's normal approvals (mid-call approvals notify by speech and stay in Hermes chat); no telemetry, no self-update, no core overrides.

futuredescriberVoicev0.1.2Updated 1 hour ago

About

Owner-only Telegram Mini App voice surface and cryptographic initData launch-gate library for Hermes Agent: two-stage HMAC initData verification, fail-closed replay guard (fails closed on both read/parse and write errors; only ENOENT starts empty), single-active launch token, origin-locked HTTP with strict CSP, exact-owner menu-button installer, and WebRTC voice delegation to Hermes api_server with curated waveform/orb accent themes. Disclosure — runs a local Node 24+ loopback HTTP service (default 127.0.0.1:18790, behind the operator's own HTTPS reverse proxy) spawned by the hermes telegram-talk CLI command with a minimal child environment; credential-bearing outbound requests go only to https://api.openai.com (paid OpenAI Realtime voice API using VOICE_TOOLS_OPENAI_KEY/OPENAI_API_KEY kept server-side; call audio and recent call messages sent to OpenAI), https://api.telegram.org (Bot API owner-scoped menu installer and owner-chat replies using TELEGRAM_BOT_TOKEN), and the operator-configured hermes.base_url (default http://127.0.0.1:8642 using API_SERVER_KEY; plain http: rejected unless host is loopback), with non-official hosts/ports for live.base_url and telegram.api_root rejected at config load; hermes telegram-talk menu --apply also sends unauthenticated GET health-check requests (redirect: manual) to the configured mini_app_url (<mini_app_url> and <mini_app_origin>/plugins/telegram-talk/health, or loopback with --via-loopback); reads declared secrets via agent.secret_scope.get_secret; optionally reads one operator-configured plain-text brief file ([brief] enabled, off by default) and writes 0600 replay state and append-only call transcripts under the active profile's <HERMES_HOME>/plugin-data/hermes-telegram-talk; spoken requests delegate to Hermes api_server under Hermes's normal approvals (mid-call approvals notify by speech and stay in Hermes chat); no telemetry, no self-update, no core overrides.

hermes-telegram-talk

An owner-only Telegram Mini App that lets one person talk to their Hermes agent by voice from the bot chat on their phone. A realtime voice model holds the conversation, and every real request is handed to the Hermes api_server behind a signed, single-use, owner-checked launch.

The problem

An agent that can run commands, edit files and send messages is only as safe as the door you put in front of it. Voice makes that door easier to walk through: whoever reaches the microphone is giving instructions.

The realtime voice surfaces available for Hermes run on the desktop, in the terminal, in Discord or over a phone line. None of them is a Telegram Mini App, and nothing in Hermes verified a Mini App launch: no initData signature check, no freshness window, no exact-owner match, no replay protection, no short-lived token exchange, no owner-scoped menu button. This repo adds those pieces and puts a voice call behind them.

30-second pitch

  • One owner, checked on every launch. Telegram's signed initData is verified server-side (HMAC, freshness, exact numeric user id) and accepted once, also across restarts.
  • No vendor key in the browser. The service exchanges the WebRTC offer with the voice API itself; the phone only ever holds a short-lived launch token.
  • The agent keeps its own approval gate. When Hermes asks for approval mid-call, the voice tells the owner to approve in the Hermes chat. A call cannot grant it.
  • Work is not dropped when the call ends. A slow turn moves to the background and its reply is posted to the owner's chat; a wrap-up turn after the call posts a recap.
  • An audit trail per call. One append-only Markdown transcript per call, owner-only file modes, naming the Hermes session that did the work.

Demo

npm run demo runs the real gate, HTTP service, delegation and menu-installer code against in-process fakes of Telegram, the voice vendor and the Hermes api_server. It needs no keys and no outside network. The block below is its output; tests/demo.test.ts fails if the block and the script drift apart.

hermes-telegram-talk demo: the real gate, service and menu code. Telegram, the voice vendor
and Hermes are in-process fakes. No keys, no outside network, synthetic values only.

== 1. The gate: who gets a launch token (api/exchange) ==
wrong Origin header                             -> 403 origin_rejected
launch data signed with another bot's token     -> 401 authentication_failed
valid signature, a different Telegram user      -> 401 authentication_failed
the owner's launch data, ten minutes old        -> 401 authentication_failed
next request from that client (3 failures)      -> 429 auth_rate_limited
the owner's fresh launch, from their phone      -> 200 token issued (43 chars, 120 min, memory only)
the same launch data again (replay)             -> 401 authentication_failed
api/session without the token                   -> 401 talk_token_rejected
api/session with the token, wrong Origin        -> 403 origin_rejected
service log for the above (stage and reason code only):
  exchange rejected stage=init_data reason=init_data_rejected
  exchange rejected stage=init_data reason=init_data_rejected
  exchange rejected stage=init_data reason=init_data_rejected
  exchange rejected stage=replay reason=replay_rejected

== 2. The voice session: the vendor key stays on the server (api/session) ==
SDP offer with the launch token                 -> 200
voice vendor (fake) received: POST https://api.openai.com/v1/live/sessions
  key in the Authorization header: yes; session.delegation: client; model: gpt-live-1
browser received: session.id, transport.type, transport.sdp (the vendor's other fields are dropped)

== 3. A spoken request becomes one Hermes turn (api/delegate, server-sent events) ==
Sam: "What's on my calendar tomorrow?"
page saves the line as the call goes            -> 200 stored=1
  tool       calendar_list
  delta      You have two things tomorrow:
  delta      the dentist at nine and the team sync at two.
  completed
  done
Hermes api_server (fake) received:
  POST /api/sessions  (create telegram-talk-demo-call-0001)
  POST /api/sessions/telegram-talk-demo-call-0001/chat/stream  (per-call brief as system_message)

== 4. The agent needs approval for a command ==
Sam: "Restart the staging web server."
  tool       terminal
  approval   systemctl restart web-staging
the page has the voice say (web/call-support.js):
  "Ada needs your approval for a command before it can continue. Approve it in the Hermes chat and I will carry on."
The service has no route that grants an approval. The turn keeps waiting on Hermes.

== 5. The owner hangs up while that turn is still waiting ==
page flushes the rest of the transcript         -> 200 stored=4
page signals the end of the call (api/end)      -> 200
page closes; the waiting turn is                -> moved to the background, not aborted
(had the owner stayed on the line past the wait limit, the voice would say:
  "That one's taking longer than a call allows; I'll send the answer to you in Telegram.")
... four minutes later the owner approves the command in the Hermes chat; the agent finishes ...
the owner's Telegram chat now holds:
  [1] From your Talk call: The staging web server is restarted and back up.
  [2] Talk call recap:
      Calendar checked. Staging restart done after your approval in chat. Nothing open.
service log:
  delegate backgrounded reason=client_gone
  delegate background delivered
  wrapup recap delivered
Hermes turns on session telegram-talk-demo-call-0001: 3 (two spoken, one wrap-up), same brief bytes on each

== 6. The audit trail on disk ==
transcripts/2026-11-21-150417-talk.md  (file mode 0600, directory 0700)
  | # Talk call — 2026-11-21 15:04:17 (UTC)
  |
  | call: demo-call-0001
  | source: telegram-talk
  | hermes_session: telegram-talk-demo-call-0001
  |
  | 15:04:17 Sam: What's on my calendar tomorrow?
  | 15:04:24 Ada (agent): You have two things tomorrow: the dentist at nine and the team sync at two.
  | 15:04:37 Sam: Restart the staging web server.
  | 15:04:43 Ada: Ada needs your approval for a command before it can continue. Approve it in the Hermes chat and I will carry on.
  | 15:04:50 Sam: Okay, I'll do that later. Goodbye.
  | 15:08:52 Ada (agent): [sent to Telegram] The staging web server is restarted and back up.
  | 15:08:52 Ada (agent): [recap sent to Telegram] Calendar checked. Staging restart done after your approval in chat. Nothing open.
state/init-data-replay.json  (file mode 0600): 1 used launch, stored as a SHA-256 digest

== 7. The menu-button installer (fake Bot API; health check routed to this demo's server) ==
--status                                        -> owner's chat: no Talk button; everyone else: commands
--apply                                         -> health check passed, 1 write to the owner's chat, readback matches
--apply again                                   -> no drift, 0 writes
--remove                                        -> owner's chat: default
--apply while a Talk button exists for everyone -> refused: global_talk_menu_conflict, 0 writes
Bot API writes in total: 2, all scoped to the owner's chat. The global menu was only read.

demo finished: every step checked its own result.

There is no browser, microphone or audio in the demo. The script (scripts/demo.ts) plays the page's side of each step, and the two spoken lines it quotes come from the Mini App's own helper (web/call-support.js).

What a call looks like

The steps below describe the whole flow as implemented, including the browser side that the demo does not run. Paths are relative to /plugins/telegram-talk/.

  1. The owner taps Talk in their bot chat. Telegram opens mini_app_url with signed launch data.
  2. web/app.js reads the launch data (from the Telegram SDK object if present, otherwise tgWebAppData in the URL hash, which it then strips) and sends it to api/exchange. The gate verifies it and returns a launch token, its expiry, the voice availability and the assistant's display name.
  3. If no OpenAI key is configured the page stops with "Voice is not available on the server right now". Otherwise it asks for the microphone, builds a WebRTC offer and posts it to api/session. The service sends the offer to {live.base_url}/live/sessions with the persona instructions and delegation: { type: "client" }, and returns only the session id and the SDP answer.
  4. Audio now flows between the phone and the voice API over WebRTC. The voice opens with a short greeting.
  5. The owner asks for something real. The voice model emits session.delegation.created; the page posts the request, the recent spoken context and the call id to api/delegate. The service creates the Hermes session <session_id>-<callId> if needed (POST /api/sessions), then streams POST /api/sessions/{id}/chat/stream with the per-call brief as system_message. Hermes events come back over SSE as delta, commentary, tool, approval, completed or error, and the page feeds finished sentences to the voice.
  6. If the owner asks something else before the answer lands, the new request supersedes the old one: the old stream is aborted, and the new turn is posted only after the old run has ended.
  7. If Hermes needs approval for a command, the voice says the agent is waiting and that the approval has to be given in the Hermes chat.
  8. If a turn runs past turn_timeout_ms, or the page goes away after the turn reached Hermes, the turn is not aborted. The voice says the answer will arrive in Telegram, and the reply is later posted to the owner's chat as "From your Talk call: ...".
  9. During the call the page posts finalized lines to api/transcript in batches (an empty batch every minute doubles as a heartbeat) and swaps its token at api/refresh before it expires.
  10. The owner says "goodbye" (or taps end). The page flushes the transcript and calls api/end. The service waits for any running turn of that call, then runs one unspoken wrap-up turn on the call's session; its reply is posted to the owner's chat as "Talk call recap:", unless the agent answers "Nothing to send.". If the webview is killed without api/end, the wrap-up runs after wrapup.idle_minutes with no activity.

Architecture

flowchart LR
    TG["Telegram client on the owner phone"]
    APP["Mini App: web directory"]
    PROXY["HTTPS reverse proxy, operator supplied"]
    subgraph SVC["Node service on 127.0.0.1"]
        GATE["Gate: initData check, replay guard, limiter, launch token"]
        ROUTES["Service routes: session, delegate, transcript, refresh, end"]
        FILES["Replay state and call transcripts"]
    end
    VOICE["OpenAI realtime voice API"]
    HERMES["Hermes api_server"]
    CHAT["Owner chat in Telegram"]

    TG -->|"opens with signed initData"| APP
    APP -->|"api/exchange, then bearer calls"| PROXY
    PROXY --> GATE
    GATE -->|"valid launch token"| ROUTES
    ROUTES -->|"SDP offer, key stays server side"| VOICE
    APP ---|"WebRTC audio"| VOICE
    ROUTES -->|"chat/stream on a per call session"| HERMES
    ROUTES -->|"background replies and recap"| CHAT
    ROUTES --> FILES
LayerDirectoryWhat it does
Owner gatesrc/gate/initData verification, file-backed replay guard, single active launch token, failed-auth limiter. Standalone library, node: stdlib only (src/gate/index.ts).
Menu installersrc/menu/CLI that shows, installs or removes the Talk menu button for the owner's chat only. Dry run by default.
Call service and Mini Appsrc/service/, web/Loopback HTTP service, voice session exchange, delegation to Hermes, transcripts, brief and wrap-up; the static Mini App (waveform/orb visualizers with a curated accent color selector persisted in localStorage).

The Python shim (__init__.py, plugin.yaml) registers hermes telegram-talk menu|serve|doctor and the bundled skills/telegram-talk skill. It resolves declared variables through Hermes's agent.secret_scope and spawns the Node CLI or service; it contains no service logic.

How safety works

The launch exchange (api/exchange), in the order the code checks it

  1. Route and method (src/service/http.ts): only paths under /plugins/telegram-talk/ are handled; the exchange accepts POST only (405 otherwise).
  2. Origin (http.ts): the Origin header must equal the origin of mini_app_url (403 origin_rejected).
  3. Content type (http.ts): application/json only (415).
  4. Failed-auth limiter (src/gate/failed-auth-limiter.ts): a client with auth.failed_max_attempts failures inside auth.failed_window_ms is refused with 429 before any verification work. The key is a SHA-256 hash of the client IP, never the raw address; behind a loopback proxy the first X-Forwarded-For entry is used.
  5. Body (http.ts): at most 16 KB, read within 5 seconds, a JSON object whose only key is initData.
  6. Signature, freshness, owner (src/gate/init-data.ts): at most 8192 bytes; duplicate fields rejected; hash must be 64 hex characters and match HMAC-SHA256 over the sorted fields with the key HMAC-SHA256("WebAppData", bot token), compared in constant time; auth_date no more than auth.future_skew_seconds in the future and no older than auth.max_age_seconds; user.id a positive safe integer equal to TALK_OWNER_ID.
  7. Replay (src/gate/replay-guard.ts): the SHA-256 of the launch hash is accepted once for the launch's lifetime. Seen digests live in init-data-replay.json under state_dir (mode 0600, written by atomic rename), so a restart does not reopen a used launch.
  8. Token (src/gate/launch-token.ts): 32 random bytes, valid for auth.talk_token_ttl_ms, held in memory only. Issuing a new one replaces the previous one, so only the newest launch is authorized.

Any failure from step 5 on counts toward the limiter and is logged with only the stage and a reason code. Every verification failure returns the same 401 authentication_failed (oversized or slow bodies get 413 or 408).

Every later route

api/session, api/delegate, api/transcript, api/refresh, api/end and api/interrupt require POST, the Mini App origin and Authorization: Bearer <launch token> (unexpired, constant-time compare). Routes that take a body cap it (4 KB to 256 KB) and validate its shape: call ids, delegation ids, transcript speakers and lengths, SDP prefix, voice history. Static files come from a fixed allow-list. Responses under the route carry no-store, nosniff, no-referrer, a restrictive Permissions-Policy and a CSP with default-src 'none', script-src 'self', connect-src 'self' and frame-ancestors limited to Telegram.

What fails closed

  • Startup: a missing or malformed TALK_OWNER_ID, a missing TELEGRAM_BOT_TOKEN, a mini_app_url that is not HTTPS or not at /plugins/telegram-talk/, or any out-of-range config value stops the service (src/service/config.ts, server.ts).
  • Replay state: if the state file cannot be read, parsed, validated, or written, the launch is rejected without overwriting the file (only a genuinely absent ENOENT file starts empty).
  • Keys: no OpenAI key means api/session returns 503 live_key_missing; no API_SERVER_KEY means every turn ends with hermes_key_missing.
  • The page: any startup or transport failure, or the 30-second startup deadline, runs one orderly shutdown (web/talk-state.js): close the voice session, release the microphone, drop the token, show "close and relaunch". Reloading does not re-authenticate, because launch data is single-use.
  • The menu button: --apply refuses to write if the public health check fails or if a Talk button exists at the global level, and errors if the readback does not match (src/menu/menu-service.ts).

Where secrets live

All secrets come from the environment and are read on demand (readSecret in config.ts); config.toml holds none, and TALK_OWNER_ID is env-only too.

  • TELEGRAM_BOT_TOKEN: used for the HMAC check and in the Telegram Bot API request URL (src/menu/telegram-api.ts).
  • VOICE_TOOLS_OPENAI_KEY (or OPENAI_API_KEY): only in the Authorization header of the one /live/sessions request (src/service/live-session.ts). Nothing else from the vendor response is passed to the browser.
  • API_SERVER_KEY: only in requests to the Hermes api_server (src/service/delegate.ts).

The launch token is never persisted or logged. Logs carry reason codes, not bodies, tokens or ids. The menu dry run does not print the owner id, and hermes telegram-talk doctor prints variable names with set or missing, never values.

Approval requests during a call

The service never approves anything and has no route that could. When Hermes emits approval.request on the turn's stream, delegate.ts forwards an approval event with the command preview (at most 160 characters), and the page has the voice say that the agent needs approval and that it must be given in the Hermes chat. The turn keeps waiting under the normal rules: if it outlasts turn_timeout_ms it moves to the background, capped by background_timeout_ms, and its outcome is posted to the owner's chat. The bundled skill tells the agent the same thing: a call cannot grant approval.

The transcript as an audit trail

src/service/transcript-store.ts writes one Markdown file per call (YYYY-MM-DD-HHMMSS-talk.md, named in transcripts.time_zone), created exclusively with mode 0600 in a 0700 directory and only ever appended to. The header records the call id, source: telegram-talk and the Hermes session id, so each call can be matched to the agent's own session history. Lines are the owner's speech, the voice's speech and the agent's replies, de-duplicated by item id. The service itself appends what it sent to Telegram on the owner's behalf: background replies ([sent to Telegram]) and the recap ([recap sent to Telegram] or [recap: nothing to send]).

Disclosures

  • Outbound credential-bearing requests: credentials go only to https://api.openai.com (VOICE_TOOLS_OPENAI_KEY / OPENAI_API_KEY for WebRTC session exchange; spoken audio and optional live.about context go to OpenAI, billed per minute), https://api.telegram.org (TELEGRAM_BOT_TOKEN for owner-scoped menu management and owner-chat recaps/background replies), and the operator-configured hermes.base_url (API_SERVER_KEY, default http://127.0.0.1:8642; plain http: is rejected for non-loopback hosts, requiring https:). Non-official hosts or non-default ports for live.base_url (api.openai.com) and telegram.api_root (api.telegram.org) are rejected at config load.
  • Menu installer health checks: before installing the button, hermes telegram-talk menu --apply sends two unauthenticated GET requests (redirect: "manual") to the configured mini_app_url origin (GET <mini_app_url> and GET <mini_app_origin>/plugins/telegram-talk/health), or to loopback when --via-loopback is passed.
  • Subprocess and long-running service: hermes telegram-talk menu|serve spawns Node (>= 24) with a minimal allowlisted environment (PATH, HOME, HERMES_HOME, LANG, LC_*, TZ, TMPDIR, plus declared plugin variables) to run the menu CLI or the loopback HTTP server (127.0.0.1:18790 by default).
  • File access: reads config.toml and, only when [brief] enabled = true, an operator-configured brief file; writes owner-only (0600) replay state and per-call transcripts under ${HERMES_HOME:-$HOME/.hermes}/plugin-data/hermes-telegram-talk by default.
  • Credentials: declared env vars are read through Hermes's active profile secret scope (agent.secret_scope.get_secret) in __init__.py and from the process environment in Node; none are stored in config.toml.
  • Telemetry: none.

Design decisions

  • Zero runtime dependencies. Why: nothing to audit in a dependency tree and no build step; Node 24 runs the TypeScript directly, and src/service/toml.ts is a small TOML subset parser. Trade-off: the config format is limited to what that parser supports (no arrays or inline tables), and Node 24 or newer is required.
  • Menu installer is a dry run by default. Why: writing a Mini App button is the step that exposes the surface. The default prints what would be called and makes no network calls; --apply health-checks the public URL (exact URL, no redirect, x-telegram-talk marker, no-store), writes only to the owner's chat, writes only on drift and verifies by readback. Trade-off: the public HTTPS route must be up before install; --via-loopback exists for hosts that cannot reach their own proxy.
  • One active launch token, in memory. Why: the newest launch wins and there is nothing on disk to steal. Trade-off: a second launch or a service restart ends the earlier page's authorization; the owner relaunches from Telegram.
  • File-backed replay guard. Why: single-use launches must stay single-use across a restart within the freshness window. Trade-off: one small disk write per launch, and a write failure blocks calls.
  • One Hermes session per call. Why: each call starts with a fresh system prompt and only its own history, and the brief is built once per call and re-sent byte-identical. Trade-off: calls do not share history with the owner's chat; the skill tells the agent to read the transcript when the owner refers back to a call.
  • Supersede and wait. Why: the answer spoken should be for what was asked last, and two turns must never run on one session at once. Trade-off: the service runs one foreground turn at a time.
  • Turns outlive the call. Why: aborting a turn that already reached Hermes would interrupt the agent mid-work. It moves to the background, uses a sibling session (-2) if the call keeps talking, and posts its reply to the owner's chat. Trade-off: one background turn at a time; a second slow turn is stopped instead, and read-along turns are always stopped rather than backgrounded.
  • Server-side session exchange. Why: the vendor key never reaches the phone. Trade-off: the service sits in the setup path of every call, though not in the audio path.

Limitations and non-goals

  • Single owner. One numeric TALK_OWNER_ID. No multi-user, roles or sharing.
  • You supply the HTTPS origin. The service listens on 127.0.0.1 only; a reverse proxy or tunnel at /plugins/telegram-talk/ and its TLS are your responsibility.
  • One voice vendor with paid usage. The voice session uses OpenAI's live session API (live.model, default gpt-live-1), billed to the configured key. Spoken content is processed by that vendor.
  • In-memory state is lost on restart: the launch token, limiter counts, the transcript store's call-to-file map and seen ids (a batch for a pre-restart call starts a new file), idle timers and the record of which calls need a wrap-up. Shutdown interrupts running and background turns. Only the replay guard persists.
  • The limiter trusts the proxy. Behind a loopback proxy it keys on the first X-Forwarded-For entry; a proxy that appends rather than overwrites lets a client choose that value. The examples in deploy/README.md overwrite it.
  • The origin check is a browser control. It stops cross-site requests from browsers; non-browser clients still need a valid launch token.
  • The replay guard fails closed on corrupt or unreadable state. Only a genuinely absent state file (ENOENT) starts empty; an unreadable, truncated, or malformed init-data-replay.json rejects launches without overwriting the file (a deleted file forgets earlier launches).
  • The transcript is not tamper-evident. Spoken lines are reported by the page; there is no hashing or signing. Approval prompts and tool calls are not written to it (they live in Hermes).
  • api/interrupt exists but the shipped Mini App does not call it.
  • Test coverage: the suite and the demo use injected fakes only. They do not exercise real Telegram, OpenAI or Hermes, real devices, Telegram webviews, WebRTC or the DOM code in web/app.js; browser-side tests cover the helpers in web/call-support.js, web/talk-state.js, web/accent-theme.js and web/waveform-visualizer.js.
  • Out of scope: the security of the host, the bot token, the owner's Telegram account and whatever Hermes does with a request. See SECURITY.md.

Quickstart

Prerequisites

  • Node.js 24 or newer.
  • Hermes 0.21.5 or newer with its api_server reachable (default http://127.0.0.1:8642) and its key.
  • A Telegram bot token and the owner's numeric Telegram user id.
  • An OpenAI API key with access to the configured live model.
  • An HTTPS hostname you control, proxying /plugins/telegram-talk/ to 127.0.0.1:18790 (examples for Caddy and nginx in deploy/README.md).

Install

As a Hermes plugin:

hermes plugins install futuredescriber/hermes-telegram-talk

plugin.yaml declares TALK_OWNER_ID, TELEGRAM_BOT_TOKEN, API_SERVER_KEY and VOICE_TOOLS_OPENAI_KEY as required (OPENAI_API_KEY is read as a fallback for the last one) and TALK_PORT and TALK_CONFIG as optional.

As a standalone Node service:

git clone https://github.com/futuredescriber/hermes-telegram-talk.git
cd hermes-telegram-talk

Configure

cp config.example.toml config.toml   # set mini_app_url = "https://talk.example.com/plugins/telegram-talk/"
cp .env.example .env && chmod 600 .env

Fill in .env and load it into the service's environment (systemd EnvironmentFile, or the launchd example in deploy/). config.toml sits at the repo or plugin root unless TALK_CONFIG points elsewhere. The optional brief ([brief]) and the wrap-up turn ([wrapup]) are configured there too; the brief is off by default, the wrap-up is on.

Plugin check: hermes telegram-talk doctor.

Start, check, install the button

npm start                              # or: hermes telegram-talk serve
curl -s https://talk.example.com/plugins/telegram-talk/health

npm run menu                           # dry run, no network calls
npm run menu -- --status               # read the current buttons
npm run menu -- --apply                # health-check, write for the owner only, verify
npm run menu -- --remove               # take it out again

The plugin equivalent is hermes telegram-talk menu [--status | --apply | --remove]. Add --via-loopback http://127.0.0.1:18790 if the host cannot reach its own public URL.

Test

npm test                               # node --test 'tests/*.test.ts'
npm run demo                           # the scripted call shown above
npm run check:pii                      # privacy and secret-shape scan
python3 scripts/test_plugin_shim.py    # plugin shim

CI (.github/workflows/ci.yml) runs the tests (which include the demo), the scan and the shim test on Node 24 and 26, plus gitleaks.

Repository layout

src/gate/          owner gate library (init-data, replay-guard, launch-token, failed-auth-limiter)
src/menu/          menu-button CLI and Telegram Bot API client
src/service/       HTTP service, config, delegation, voice session, transcripts, brief
web/               static Mini App (index.html, app.js, helpers, visualizers)
skills/telegram-talk/  skill telling the agent how call turns arrive
tests/             node:test suites with injected fakes
deploy/            systemd and launchd examples, proxy notes
scripts/           demo, PII scan, plugin shim test
__init__.py        Hermes plugin shim (menu | serve | doctor)
plugin.yaml        Hermes plugin manifest

Security

See SECURITY.md for what the gate protects, what it does not, and how to report a vulnerability privately.

License

MIT. See LICENSE.

Designed, specified and operated by Justin Thompson; built with Claude Code and Codex under his direction.

README from the reviewed commit af652e5; it updates when the author re-pins.

More by futuredescriber

2 plugins by futuredescriber in the catalog.

futuredescriberapproved-sendOwner-approved outbound messaging for agents: the model drafts an iMessage/SMS or email, a Telegram card in the owner's private chat shows the recipient, service and exact body (visible by default; opt-in spoiler shielding per draft or via APPROVED_SEND_SHIELD_BODY) with Send / Cancel, and nothing is transmitted until the owner taps Send; one-use grants, durable sent / not_sent / unknown receipts, never a retry on unknown, read-only status lookup. Disclosure — tools work only in the private Telegram chat of APPROVED_SEND_OWNER_TELEGRAM_ID and never in cron runs; reads Hermes' per-message session context via get_session_env to enforce that; reads APPROVED_SEND_* settings and secrets via agent.secret_scope.get_secret; posts and edits cards through the gateway's existing Telegram bot and registers a Telegram callback handler scoped to ^apsd: via register_platform_handler; writes a SQLite store 0600 under the active profile's hermes_constants.get_hermes_home()/approved-send (0700) that keeps message bodies only until the verdict and digests after it; the outbox transport (default) appends approved messages, bodies included, to outbox.jsonl (0600) in the same directory, the command transport spawns only the configured absolute executable with no shell and an environment limited to PATH, HOME, LANG and the APPROVED_SEND_COMMAND_ENV allowlist, and the smtp transport connects only to the configured SMTP host with APPROVED_SEND_SMTP_PASSWORD (never logged; cleartext login under APPROVED_SEND_SMTP_SECURITY=none is refused); no other network calls, no telemetry, no self-update.Communityautomation

Developer Mode

Explore built-in Hermes toolsets and actions.

HermesAgent

Developer?

Create a Hermes extension for Desktop or agent workflows.

Developer Section