Muster

Telegram AI · bot gateway

Put a governed agent behind Telegram.

Muster's Telegram adapter supports webhook handling, optional secret-token checks, long-poll operation, sender pairing, draft-style replies, scoped memory, and token-ledger receipts.

Telegram path

Bot token first; agent access only after pairing.

$ muster gateway init
$ muster channels setup telegram
$ muster gateway start --port 7460
$ muster pairing approve <code>
webhook

Webhook adapter

Telegram updates become the same SurfaceMessage envelope as every other channel.

long poll

No public URL mode

The gateway also includes long-poll support for development or private setups.

governance

Pairing and memory scope

Unknown chat IDs are challenged; accepted chats get scoped session continuity.

ledger

Token receipts

Telegram conversations remain accountable through the same run ledger.

In practice

Telegram is a public front door. Treat it like one.

Telegram is the fastest way to put an agent in front of people and the fastest way to put it in front of the wrong people. A bot token is one message to BotFather, and from that moment any chat ID on the network can message your bot. There is no workspace boundary to hide behind, so the boundary has to be in the adapter.

Webhook or long-poll, same envelope

Muster's Telegram adapter runs either way. Webhook mode is the production path, with an optional secret-token check so that only Telegram's own delivery is accepted. Long-poll mode exists for development and for private deployments with no public URL — useful when the machine running the agent sits inside a network you are not going to expose. Either way, the update becomes the same SurfaceMessage envelope as a terminal turn, a Slack message, or a Google Chat event, so the governance path does not fork per channel.

Unknown chat IDs get a challenge, not a conversation

An unrecognised sender receives a pairing challenge and an operator approves the code before the agent responds to anything substantive. This is the single most important control on a Telegram deployment, because without it your bot's tool access and token budget are available to anyone who guesses the handle. Once a chat is accepted, it gets scoped session continuity: the conversation persists, and it persists inside a lane rather than in a global history shared with every other chat.

Memory scoping matters more in DMs than in channels

Direct messages are where people volunteer things they would not post in a shared room — account numbers, internal deadlines, complaints about colleagues. If the agent's memory is one pool, that content is retrievable from the next conversation with someone else. Muster's lanes are tenant, workspace, user, role, and session, and recall is filtered by entitlement at retrieval time rather than trusted at write time, with leakage tests that specifically try to break the boundary.

The ledger keeps a chat bot honest

Chat threads grow, and a harness that replays the entire thread every turn gets expensive in a way nobody notices until the bill. Every Telegram turn records usage, estimated cost, and a replay-waste flag locally. Muster's deterministic benchmark measures the general shape of this: 875.8k naive tokens against 355.2k across five scenarios and 170 turns, with the widest gap — 62.7% — on the longest thread. Reproduce it with muster benchmark; no model is called.

Draft-style replies let a long answer appear progressively rather than arriving as one delayed wall of text, which in a chat interface is the difference between a bot that feels alive and one that feels broken.