Set up channel verification for phone, Telegram, or Slack channels via outbound verification flow
assistant skills install guardian-verify-setupYou are helping your user set up channel verification for a messaging channel (phone, Telegram, or Slack). This links their identity for verified message delivery on the chosen channel. Use the assistant channel-verification-sessions CLI for all verification operations.
bash.Ask the user which channel they want to verify:
If the user's intent already specifies a channel (e.g. "verify my phone number for voice calls", "verify me on Slack"), skip the prompt and proceed.
Based on the chosen channel, ask for the required destination:
Phone: Ask for their phone number. Accept any common format (e.g. +15551234567, (555) 123-4567, 555-123-4567). The API normalizes it to E.164.
Telegram: Ask for their Telegram chat ID (numeric) or @handle. Explain:
Slack: Offer to look up the user's Slack member ID automatically to reduce friction:
Auto-lookup (preferred): Ask the user for their Slack display name or @handle, then look up their member ID using the Slack API:
# Get the bot token from the credential store
BOT_TOKEN=$(assistant credentials reveal --service slack_channel --field bot_token 2>/dev/null)
# Search for matching users (paginate through all workspace members)
CURSOR=""
MATCHES="[]"
while true; do
RESPONSE=$(curl -s -H "Authorization: Bearer $BOT_TOKEN" \
"https://slack.com/api/users.list?limit=200${CURSOR:+&cursor=$CURSOR}")
PAGE_MATCHES=$(echo "$RESPONSE" | jq --arg name "<name>" --arg handle "<handle>" '[.members[] | select(.deleted == false) | select(.profile.display_name == $name or .name == $handle or .profile.display_name_normalized == $name or .real_name == $name) | {id: .id, name: .name, display_name: .profile.display_name, real_name: .real_name}]')
MATCHES=$(echo "$MATCHES $PAGE_MATCHES" | jq -s 'add')
CURSOR=$(echo "$RESPONSE" | jq -r '.response_metadata.next_cursor // empty')
[ -z "$CURSOR" ] && break
done
echo "$MATCHES" | jq '.[]'
Replace <name> and <handle> with the value the user provided (try matching against all fields).
id value as the destination for Step 3.id as the destination.Fallback to manual entry if any of the following occur:
BOT_TOKEN retrieval fails (credential store returns an error or empty)users.list API call fails or returns an errorFor manual entry: ask for their Slack user ID. Explain that this is their Slack member ID (e.g. U01ABCDEF), not their display name or email. They can find it in their Slack profile under "More" > "Copy member ID".
The bot will send a verification code via Slack DM once the member ID is resolved.
Execute the outbound start request:
assistant channel-verification-sessions create --channel <channel> --destination "<destination>" --json
Replace <channel> with phone, telegram, or slack, and <destination> with the phone number, Telegram destination, or Slack user ID.
success: true)Report the exact next action based on the channel:
secret field with the verification code. Tell the user the code BEFORE the call connects: "I'm calling [number] now. Your verification code is [secret]. When you answer the call, enter this code using your phone's keypad." The create command already initiates the voice call. Do NOT place a separate call_start call. After delivering the code, immediately begin the voice auto-check polling loop (see Voice Auto-Check Polling below).telegramBootstrapUrl in response): The response includes a secret field. Show it in the current chat: "Your verification code is [secret]. I've also sent it to your Telegram. Open the Telegram bot chat and reply with that 6-digit code to complete verification." If the response does not contain a secret field, treat this as a control-plane error: tell the user something went wrong and ask them to retry from Step 3 or resend (Step 4).telegramBootstrapUrl present in response): "Tap this deep-link first: [telegramBootstrapUrl]. After Telegram binds your identity, I'll send your verification code."secret field with the verification code. Show it in the current chat: "Your verification code is [secret]. I've also sent it to you as a Slack DM. Open the DM from the Vellum bot in Slack and reply with that 6-digit code to complete verification." The DM channel ID is captured automatically during this process for future message delivery. If the response does not contain a secret field, treat this as a control-plane error: tell the user something went wrong and ask them to retry from Step 3 or resend (Step 4). After delivering the code, immediately begin the Slack auto-check polling loop (see Slack Auto-Check Polling below).After reporting the bootstrap URL for Telegram handle flows, wait for the user to confirm they clicked the link. Then check verification status (Step 6) to see if the bootstrap completed and a code was sent.
success: false)Handle each error code:
| Error code | Action |
|---|---|
missing_destination | Ask the user to provide their phone number, Telegram destination, or Slack user ID. |
invalid_destination | Tell the user the format is invalid. For phone: suggest E.164 format (+15551234567). For Telegram: explain that group chat IDs (negative numbers) are not supported. For Slack: explain that the value must be a Slack member ID (e.g. U01ABCDEF). |
already_bound | Tell the user a verified identity is already bound for this channel. Ask if they want to replace it. If yes, re-run the create command with --rebind added. |
rate_limited | Tell the user they have sent too many verification attempts to this destination. Ask them to wait and try again later. |
unsupported_channel | Tell the user the channel is not supported. Only phone, telegram, and slack are valid. |
no_bot_username | Telegram bot is not configured. Load and run the telegram-setup skill first. |
If the user says they did not receive the code or asks to resend:
assistant channel-verification-sessions resend --channel <channel> --json
On success, report the next action based on the channel:
secret field with a new verification code. Tell the user the new code BEFORE the call connects - just like the initial start flow: "I'm calling [number] again. Your new verification code is [secret]. When you answer the call, enter this code using your phone's keypad." The resend command already initiates the voice call. Do NOT place a separate call_start call. After delivering the code, immediately begin the voice auto-check polling loop (see Voice Auto-Check Polling below).secret field. Show the new code in the current chat: "Your new verification code is [secret]. I've also sent it to your Telegram. Open the Telegram bot chat and reply with that 6-digit code to complete verification." If the response does not contain a secret field, treat this as a control-plane error: tell the user something went wrong and ask them to retry from Step 3.secret field. Show the new code in the current chat: "Your new verification code is [secret]. I've also sent it to you as a Slack DM. Reply to the DM with that 6-digit code to complete verification. (resent)" If the response does not contain a secret field, treat this as a control-plane error: tell the user something went wrong and ask them to retry from Step 3. After delivering the code, immediately begin the Slack auto-check polling loop (see Slack Auto-Check Polling below).Handle each error code from the resend endpoint:
| Error code | Action |
|---|---|
rate_limited | Tell the user to wait before trying again (the cooldown is 15 seconds between resends). |
max_sends_exceeded | Tell the user they have reached the maximum number of resends for this session (5 sends per session). Suggest canceling the current session (Step 5) and starting a new verification from Step 3. |
no_destination | This should not normally occur during resend. Tell the user to cancel (Step 5) and restart verification from scratch at Step 3. |
pending_bootstrap | Remind the user to click the Telegram deep-link first before a code can be sent. |
no_active_session | No session is active. Start a new one from Step 3. |
If the user wants to cancel the verification:
assistant channel-verification-sessions cancel --channel <channel> --json
Confirm cancellation to the user. On no_active_session, tell them there is nothing to cancel.
For voice verification only: after telling the user their code and instructing keypad entry (in Step 3 or Step 4), do NOT wait for the user to report back. Instead, proactively poll for completion so the user gets instant confirmation without having to ask "did it work?"
Polling procedure:
assistant channel-verification-sessions status --channel phone --json
bound: true: immediately send a proactive success message in the current chat - "Voice verification complete! Your phone number is now verified." Stop polling.bound: true: proactively tell the user - "I've been checking for about 2 minutes but verification hasn't completed yet. The code may have expired or wasn't entered. Would you like me to resend a new code (Step 4) or start a new session (Step 3)?"Rebind guard:
When in a rebind flow (i.e., the session creation request included "rebind": true because a binding already existed), do NOT treat bound: true alone as success. The pre-existing binding will show bound: true before the user has entered the new code, which would be a false positive. To guard against this:
bound: true AND verificationSessionId is absent from the status response. The verificationSessionId field is present while a verification session is still active (pending). When the user enters the correct code, the session is consumed and verificationSessionId disappears from subsequent status responses. This proves the new outbound session was consumed and the binding is fresh.bound: true but verificationSessionId is still present, the old binding is still active and the new code has not yet been consumed - continue polling.bound: true is trustworthy because there was no prior binding to confuse the result.Important polling rules:
For Slack verification: after telling the user their code and instructing them to reply in the Slack DM (in Step 3 or Step 4), proactively poll for completion so the user gets instant confirmation.
Polling procedure:
assistant channel-verification-sessions status --channel slack --json
bound: true: immediately send a proactive success message in the current chat - "Slack verification complete! Your Slack account is now verified. The DM channel has been captured for future message delivery." Stop polling.bound: true: proactively tell the user - "I've been checking for about 2 minutes but verification hasn't completed yet. The code may have expired or wasn't entered. Would you like me to resend a new code (Step 4) or start a new session (Step 3)?"Rebind guard:
When in a rebind flow (i.e., the session creation request included "rebind": true because a binding already existed), do NOT treat bound: true alone as success. The pre-existing binding will show bound: true before the user has entered the new code, which would be a false positive. To guard against this:
bound: true AND verificationSessionId is absent from the status response. The verificationSessionId field is present while a verification session is still active (pending). When the user enters the correct code, the session is consumed and verificationSessionId disappears from subsequent status responses. This proves the new outbound session was consumed and the binding is fresh.bound: true but verificationSessionId is still present, the old binding is still active and the new code has not yet been consumed - continue polling.bound: true is trustworthy because there was no prior binding to confuse the result.Important polling rules:
After the user reports entering the code, verify the binding was created:
CHANNEL="<channel>"
assistant channel-verification-sessions status --channel "$CHANNEL" --json
If the response shows the channel is bound, confirm success: "Verification complete! Your [channel] identity is now verified."
If not yet bound, offer to resend (Step 4) or generate a new session (Step 3).
If the user wants to remove themselves (or the current verified identity) from a channel, use the revoke endpoint:
assistant channel-verification-sessions revoke --channel <channel> --json
Replace <channel> with the channel to unbind from (e.g. phone, telegram, slack).
success: true)The response includes bound: false after the operation completes. Check the previous binding state to tailor the message:
bound: false and there was nothing to revoke): "There is no active verification for [channel] - nothing to revoke. Any pending verification challenges have been cleared."secret guardrail: For voice, Telegram chat-ID, and Slack flows, the API response MUST include a secret field. If secret is unexpectedly absent from a start or resend response that otherwise indicates success, treat this as a control-plane error. Do NOT fabricate a code or tell the user to proceed without one. Instead, tell the user something went wrong and ask them to retry the start (Step 3) or resend (Step 4).