Token Hygiene Card for Bot Owners
Cheat sheets · 2026-11-06 · 18+ readers
Your token controls your bot. Print this card, or pin it for your team.
Do
- Keep it in a secret manager or environment variable.
- Use a different bot for development.
- Scrub tokens from logs and error reports.
- Add a secret scanner to your repository.
- Know who has production access.
Do not
- Paste it in chats, tickets or screenshots.
- Put it in a Mini App or any browser code.
- Commit it, even to a private repository you might open later.
- Share it with a vendor who does not need it.
If it leaks: five minutes
- Send
/revoketo BotFather and pick the bot. - Deploy the new token.
- Reset the webhook and its secret.
- Skim recent activity for anything you did not send.
- Remove the leak source and tell users if they were affected.
Frequently asked questions
Is the number before the colon secret?
No, it is the public bot id.
Does revoking break chats?
No. Only the old token stops working.
How often should I rotate?
When someone leaves, when you move hosts, or after any doubt.