You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 45cce7e
Browse filesBrowse the repository at this point in the historyBrowse files
@@ -597,6 +598,23 @@ From an MCP client configuration, pass the same roots after `main.py`:
597
598
}
598
599
```
599
600
601
+
## Chat Access Privacy (Allowlist)
602
+
603
+
To restrict AI agents or MCP clients to specific chats only (preventing access to all private or corporate conversations), configure `TELEGRAM_ALLOWED_CHAT_IDS`:
604
+
605
+
```env
606
+
# Comma-separated list of allowed chat IDs, supergroup IDs, or usernames
-**`list_chats` / `get_chats`:** Only chats matching the allowlist are returned; all other conversations remain completely invisible to the agent.
612
+
-**Messaging & Chat Tools (`send_message`, `get_messages`, `get_chat`, `create_poll`, etc.):** Any attempt to interact with a chat outside the allowlist is rejected with a structured error message: `Access to chat '<chat_id>' is restricted by privacy policy (TELEGRAM_ALLOWED_CHAT_IDS)`.
613
+
-**Search & Drafts (`search_global`, `get_drafts`):** Global searches and draft listings omit unallowed conversations.
614
+
-**Incoming Events:** Notifications and debounce feeds only process events from allowed chats.
615
+
616
+
If `TELEGRAM_ALLOWED_CHAT_IDS` is unset or empty, the server operates in unrestricted mode (default), preserving 100% backward compatibility.
0 commit comments