Summary
Add an allowed_users config option to restrict which Discord users can trigger the bot.
Motivation
Currently, anyone in an allowed_channel can @mention the bot and interact with it. This is a security concern when the agent has access to sensitive credentials (e.g. GH_TOKEN for GitHub operations) — any user in the channel could instruct the agent to push code, delete branches, etc.
Proposed Design
Config
[discord]
bot_token = "${DISCORD_BOT_TOKEN}"
allowed_channels = ["123456"]
allowed_users = [] # empty = allow all (default, backward compatible)
Behavior
| allowed_channels |
allowed_users |
Result |
| empty |
empty |
All users, all channels (current default) |
| set |
empty |
Only these channels, all users |
| empty |
set |
All channels, only these users |
| set |
set |
AND — must be in allowed channel AND allowed user |
- Thread messages: also checked against
allowed_users
- Rejected users: bot reacts with 🚫, does not reply
- Backward compatible: empty
allowed_users = no filtering (same as today)
Helm values
discord:
allowedUsers: []
⚠️ Use --set-string for user IDs to avoid float64 precision loss.
Changes Required
src/config.rs — add allowed_users: Vec<String> to DiscordConfig
src/discord.rs — add user ID check in message handler
charts/openab/values.yaml — add allowedUsers
charts/openab/templates/configmap.yaml — render allowed_users
config.toml.example — add example
Summary
Add an
allowed_usersconfig option to restrict which Discord users can trigger the bot.Motivation
Currently, anyone in an
allowed_channelcan @mention the bot and interact with it. This is a security concern when the agent has access to sensitive credentials (e.g.GH_TOKENfor GitHub operations) — any user in the channel could instruct the agent to push code, delete branches, etc.Proposed Design
Config
Behavior
allowed_usersallowed_users= no filtering (same as today)Helm values
Changes Required
src/config.rs— addallowed_users: Vec<String>toDiscordConfigsrc/discord.rs— add user ID check in message handlercharts/openab/values.yaml— addallowedUserscharts/openab/templates/configmap.yaml— renderallowed_usersconfig.toml.example— add example