Discord Approval Flow
Interactive button components for approving restricted terminal commands in Discord.
How It Works
- The agent requests a terminal command that isn’t in the allowed prefixes list (or contains shell operators)
- An approval message is sent to the Discord channel with interactive buttons
- The user sees three clickable buttons:
Command requires approval:
rm -rf /tmp/old-cache
Allow Once
Allow Always
Deny
Approval Options
| Option | Behavior |
|---|---|
| Allow Once | Execute the command this time only |
| Allow Always | Execute and persist the command prefix for future auto-approval |
| Deny | Reject the command — agent receives denial message |
The approval flow in Discord uses serenity’s ComponentInteraction API. “Allow Always” persists the prefix to SQLite so it survives daemon restarts.
Button Expiry
Discord interaction tokens expire after 15 minutes. If no response is received within that window, the approval request times out and the command is denied.