# Documentation Page **Page:** kit/agent/chat-apps/security [Download Raw Markdown](./kit/agent/chat-apps/security.md) --- # Limits and secrets A chat app lets people reach your Bot from Telegram, Discord or Slack. This page covers the limits on what they can send, answers that look like a secret, and what `hide_secrets` keeps the bot token away from. Each limit is a setting with a default, changed on the Bot, a chat app or one chat; the [settings reference](/kit/agent/chat-apps/settings/) says how and lists every value. ## Message limits Every chat app counts messages. When someone goes over a limit, the bot answers "Slow down: too many messages. Try again in a moment." once, and drops the rest until the window passes. Over the Bot-wide daily limit, a sender who keeps writing gets the notice again after an hour while that limit stays used up. | Setting | Default | Counts | |---|---|---| | `rate_user_per_min` | `10` | Messages from one person per minute. | | `rate_user_per_hour` | `20` | Messages from one person per hour. | | `rate_user_per_day` | `100` | Messages from one person per day. | | `rate_chat_per_min` | `20` | Messages from one chat per minute, all senders together. | | `rate_bot_per_day` | `2000` | Messages all chat apps of the Bot together may deliver per day. | `0` turns a limit off. Set the per-person and per-chat limits on a chat app or on one chat. `rate_bot_per_day` is set on the Bot. ## Size, people and pairing limits | Limit | Setting | Default | What happens | |---|---|---|---| | Message size | `max_text_bytes` | `65536` bytes | A longer message is refused with "Message too long". A character outside basic Latin takes 2 to 4 bytes. | | Answer size | `max_parts` | `8` parts | A longer answer is cut, and its last line says the rest is in the session (`overflow_note`). | | People | `max_principals` | `8`, at most `32` | The most people a chat app keeps. Pairing one more is refused. | | Chat apps | `max_channels` | `8`, at most `8` | The most chat apps a Bot has. | | Pairing code lifetime | `pairing_ttl_minutes` | `15` minutes | An older code no longer works. | | Wrong codes from one person | `pairing_user_burn_tries`, `pairing_user_burn_minutes` | `5` codes, `60` minutes | After 5 wrong codes a person is refused for 60 minutes. | | Wrong codes in total | `pairing_code_burn_tries` | `20` codes | After 20 wrong codes in total the code stops working. | ## What if an answer looks like a secret? Before an answer leaves your computers, the chat app scans the whole text for things that look like keys, tokens or passwords, and removes them. If the text still looks like it holds a secret after that, nothing of it is sent. The chat gets "I held back a reply because it looked like it contained a secret, such as a key or password. Nothing was sent." Read the full answer in the session instead. This catches mistakes. It does not catch a secret that does not look like one. ## Keep the bot token out of the agent's reach Each chat app saves its bot token on the computer that runs the agent, in the agent's own storage, readable only by the agent's user. The token is never shown again, over the API or in the agent's TUI. The Bot's agents run tools and shells on that same computer. `hide_secrets` (on by default) keeps the saved tokens away from the agent's file tools, and from its shells where the sandbox can hide them. Set it on the Bot or on one chat app. | Where the agent runs | File tools (`read_file`, `grep` and the rest) | Shells the agent starts | |---|---|---| | Linux without Landlock, with bubblewrap installed; or macOS | Refused | Token folder hidden | | Linux with Landlock (used whenever the kernel has it) | Refused | **Not hidden.** A shell can read the token. | | No sandbox, or a Hoody computer whose user has passwordless sudo | Refused | **Not hidden.** A shell can read the token. | On a Hoody computer, shells the agent starts can read the token: `hide_secrets` keeps it from the file tools only, and each chat app shows the note below. When `hide_secrets` is on and a shell can still read the token, the chat app says so: its `effective.notes` holds `hide_secrets_partial`, with the reason `landlock` or `unsandboxed`. The Hub (**Bots**, the Bot, **Chat apps**, **Manage**, **Settings**) and the TUI show the same note. The Hub shows `hide_secrets` as **Hide the stored token from the agent** but cannot change it: change it in the TUI or over the API. A shell that is already running keeps what it had when it started. Turning `hide_secrets` on or off applies to shells started afterwards. It prevents accidents: an agent that reads a file or prints a folder by mistake. It does not stop anyone determined to read the token. - Anyone with root or sudo on that computer can read the token. - A program of the same user that runs outside the sandbox can read it. - It only works while the sandbox works. The table above shows where it does not. ## Replace a leaked token If a token leaks, revoke it at the platform (Telegram's @BotFather, the Discord Developer Portal, your Slack app's settings) and connect the new one: [replace the chat app's credentials](/api/agent/bots/channels/#credentials). Deleting the chat app does not revoke the token. In the Hub, open **Bots**, select the Bot and open **Chat apps**. Choose **Manage** on the chat app and press **Replace…** next to **Bot token**. If sign-in has failed, choose **Replace the token** on the chat app instead. Paste the new token (a Slack app also needs the **App token**) and press **Replace the token**. ## Who can read what the Bot says? - **The conversation is shared.** Everyone you pair talks to the same Bot, in the same conversation. They can see what the Bot says to them, including what it learned from others. Pair only people you would let read your Bot. - **Groups are read by everyone in them.** Approve a group only when every member may read the Bot's answers. - **Cards show details.** An approval card can show file paths and commands. See [Approvals from chat](/kit/agent/chat-apps/approvals/). ## Run each bot from one place Run each Telegram, Discord or Slack bot from one Hoody home only. Stop its existing runner before starting another. A duplicate runner in another home or on another computer may connect without showing `standby` or `conflict`, so those states do not prove that only one runner is active. ## What happens when you delete a Bot? Deleting a Bot deletes its chat apps. They stop, the platform bots are released so they can be connected to another Bot, and the chat apps' data and saved tokens are deleted with the Bot. The bot accounts on the platforms stay as they are: revoke a token there if you want it dead. Signing the agent out is different: it suspends the Bot and keeps everything (see [The Bot is gone from the list](/kit/agent/chat-apps/troubleshooting/#the-bot-is-gone-from-the-list)). ## Does a chat app keep the agent running? While a chat app is on, it keeps the agent running so messages are answered (`channel_lease`). Turn the chat app off, or set `channel_lease: false`, to let the agent stop when idle. With `channel_lease: false`, an open Bot session still keeps the agent running. ## What's next - [Settings](/kit/agent/chat-apps/settings/): every limit and its range. - [Approvals from chat](/kit/agent/chat-apps/approvals/) - [Troubleshooting](/kit/agent/chat-apps/troubleshooting/): `standby`, `conflict` and other states.