Telegram Bot Setup
Receive instant permission approval requests on Telegram. Approve or deny agent actions from anywhere.
Overview
The Agent OTP Telegram bot sends you notifications when your AI agents request permissions that need human approval. You can approve or deny requests directly from Telegram.
Setup Instructions
Step 1: Start the Bot
- Open Telegram and search for
@AgentOTPBot - Click Start to begin the conversation
- The bot will greet you with a welcome message
Step 2: Link Your Account
- Generate a link code using the CLI:
docker compose exec api bun run cli telegram:link-code- Copy the link code shown
- Send the code to the Telegram bot:
/link YOUR_CODE
Once linked, you'll see a confirmation message in Telegram.
Step 3: Test the Connection
- Send a test notification using the CLI:
docker compose exec api bun run cli telegram:test- You should receive a test message in Telegram within seconds
Receiving Approval Requests
When an agent requests a permission that needs approval, you'll receive a message like this:
š Permission Request
Agent: invoice-bot
Action: email.send
To: client@example.com
Subject: Invoice #12345
Reason: Sending monthly invoice to client
Requested scope:
⢠Max emails: 1
⢠Attachment: Yes (invoice.pdf)
Expires in: 4:32
[ā
Approve] [ā Deny] [ā¹ļø Details]Available Actions
- Approve - Grant the permission and issue a token
- Deny - Reject the request with an optional reason
- Details - See full request context and scope
Bot Commands
| Command | Description |
|---|---|
| /start | Start the bot and see welcome message |
| /link CODE | Link your Agent OTP account |
| /unlink | Unlink your account |
| /pending | List pending approval requests |
| /agents | List your registered agents |
| /stats | View approval statistics |
| /settings | Configure notification preferences |
| /help | Show help message |
Notification Settings
Configure which notifications you receive:
/settings
š± Notification Settings
⢠All requests: ā
Enabled
⢠Auto-approved: ā Disabled
⢠Denied by policy: ā Disabled
⢠Token used: ā Disabled
⢠Token expired: ā
Enabled
⢠Quiet hours: 10 PM - 7 AM
⢠Timezone: America/New_York
[Edit Settings]Quiet Hours
During quiet hours, notifications are batched and delivered when quiet hours end. Urgent requests (expiring soon) will still notify immediately.
Quick Replies
Use quick replies for faster decisions:
/approve PERM_ID- Approve a specific request/deny PERM_ID reason- Deny with a reason/approve-all AGENT- Approve all pending for an agent
Group Notifications
For team settings, add the bot to a Telegram group:
- Add
@AgentOTPBotto your team group - Link the group using the CLI:
docker compose exec api bun run cli telegram:link-group - Configure which team members can approve requests
Note: In groups, only team members with approval permissions can use the approve/deny buttons.
Troubleshooting
Not Receiving Notifications
- Check that your account is linked:
/status - Verify Telegram bot token is configured in your
.envfile - Check quiet hours settings
- Ensure Telegram notifications are not muted
Link Code Not Working
- Link codes expire after 5 minutes - generate a new one
- Make sure you're typing the exact code shown
- Check for extra spaces before/after the code
Buttons Not Responding
- The request may have expired - check the expiry time
- Someone else may have already responded (in groups)
- Try using the command:
/approve PERM_ID
Security Considerations
- Keep your Telegram account secure - Enable two-factor authentication
- Don't share screenshots - They may contain sensitive request details
- Review requests carefully - Check the scope and context before approving
- Use groups wisely - Only add trusted team members
Alternative Notification Channels
Besides Telegram, you can also receive notifications via:
- Email - Good for async approval workflows
- Slack - For team-based approvals
- Web Dashboard - Real-time in-browser notifications
- Webhooks - For custom integrations