Drive the agent from Telegram
Atomic Agent can be driven from your phone over Telegram. It’s the same agent and the same local model — the model still runs on your machine; Telegram is just a remote control. The channel is deliberately single-user: once paired, only the owner’s messages are accepted and everyone else is dropped.
What you need
- A Telegram account.
- A bot token from Telegram’s @BotFather (create a bot, and it hands you a token that looks like
123456:ABC-...). - Node.js 25.7.0 or newer.
- Atomic Agent installed and a local model running.
Set it up
The easiest path is the TUI. Open it and go to the Telegram panel:
atomic-agent tuiIn the setup (Manage tab → Telegram, or the /telegram panel) you can pair an owner, set the token, and toggle the remote-control channel.
If you’d rather configure the rest by hand:
-
Enable the channel in
config.json:{"telegram": { "enabled": true }} -
Add your bot token to the secrets file at
<stateDir>/.env(by default~/.atomic-agent/.env) — never inconfig.json, because the token belongs in the secrets file, which is written with mode0600:Terminal window TELEGRAM_BOT_TOKEN=123456:ABC-your-bot-token -
Restart the agent. A secret written to
.envis picked up on the next start, not mid-session. -
Open a pairing window. In the running TUI, type:
/telegram pairThis opens a 60-second window. It is not optional: until a window is open, the channel has no owner and drops every DM it receives.
-
DM the bot within those 60 seconds. Send it any message —
/startworks fine. The first eligible direct message that lands inside the window becomes the owner; the agent saves that account totelegram.ownerUserIdand restarts the channel. From then on, only your account is accepted.If the window expires before you send anything, nothing is paired — run
/telegram pairagain. To hand the bot to a different account later, use/telegram clear-ownerand pair again.
Using it
Once paired, just chat with the bot to send the agent a request — the same way you’d type in the TUI. When the agent wants to run a dangerous tool, execution pauses and an approval request arrives as inline approve / deny buttons; the tool only runs if you approve.
A few built-in commands:
/start, /help show commands and setup/status active session, turn count, last error/new start a fresh session/cancel abort the running turnTelegram has its own session
The channel keeps a separate session lineage from the TUI. Chatting from your phone doesn’t continue the conversation open on your desktop, and /new rotates only the Telegram side — the current session is archived and a fresh one starts, leaving the TUI untouched.
Approvals expire
An approval request sent to Telegram auto-denies after 8 minutes if you don’t tap anything. That’s the away-from-keyboard policy: a pending tool call can’t wait indefinitely for a phone you left on a table. The window isn’t configurable.
Two config keys worth knowing
Both live under telegram in config.json and both have sensible defaults, so you only touch them if something misbehaves:
| Key | Default | Effect |
|---|---|---|
parseMode | "html" | How agent replies are formatted. "html" converts the model’s markdown into Telegram’s HTML subset; "plain" disables formatting entirely — the escape hatch if the formatter mangles something |
progressIndicator | true | The live “Thinking…” bubble that mirrors the turn’s activity and deletes itself when the reply lands. Set false to switch it off |
{ "telegram": { "enabled": true, "parseMode": "plain", "progressIndicator": false }}parseMode governs agent replies only. Command output (/help, /status, the cancellation acks) and approval prompts are always sent as plain text, so switching to "html" won’t add formatting there.
The /telegram commands
/telegram commandsBare /telegram opens the Telegram panel. Each verb below drives one step of the channel’s lifecycle from the editor:
| Command | What it does |
|---|---|
/telegram enable | Turn the channel on |
/telegram disable | Turn it off |
/telegram start | Start the bridge |
/telegram stop | Stop the bridge |
/telegram restart | Restart it — the usual fix after changing the token |
/telegram pair | Open the 60-second owner-pairing window |
/telegram token | Open the masked token prompt |
/telegram clear-token | Delete the stored bot token |
/telegram clear-owner | Forget the paired owner |
clear-token and clear-owner are the revoke path. Use clear-token when a token may have leaked (revoke it in BotFather too, then set the new one), and clear-owner to hand the bot to a different account — after which you pair again.
Privacy and safety
- Single-user by design. Pairing binds the channel to one owner; messages from anyone else are dropped (it fails closed when no owner is set).
- The token never leaks. It lives only in
.env(0600) and is scrubbed from error messages before they reach logs. - Approvals still apply. Remote-driving doesn’t bypass the approval gate — risky tool calls wait for your explicit yes, from your phone.
Related
- Local models — the model Telegram drives.
- Configuration — the
.envsecrets file and precedence rules. - Tools — the approval gate behind those inline buttons.