ENยทESยทDEยทPTยทFR
โŒ˜K

Discord Approval Flow

Interactive button components for approving restricted terminal commands in Discord.

How It Works

  1. The agent requests a terminal command that isn’t in the allowed prefixes list (or contains shell operators)
  2. An approval message is sent to the Discord channel with interactive buttons
  3. The user sees three clickable buttons:

Command requires approval:

rm -rf /tmp/old-cache
Allow Once Allow Always Deny

Approval Options

OptionBehavior
Allow OnceExecute the command this time only
Allow AlwaysExecute and persist the command prefix for future auto-approval
DenyReject 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.