Slack Integration Guide
This guide walks through setting up a Slack App for Svantic. The basic setup enables outbound notifications (alerts sent to a Slack channel). The optional advanced setup enables bidirectional approval workflows where users can approve or deny directly from Slack.Overview
The integration has two directions:- Outbound (required): Svantic → Slack — alert notifications and approval requests sent to a channel
- Inbound (optional): Slack → Svantic — user clicks an interactive button, Slack POSTs the action back to Svantic
Step 1: Create a Slack App
- Go to api.slack.com/apps and click Create New App
- Choose From scratch
- Name it (e.g., “Svantic Alerts”) and select your workspace
- Click Create App
Step 2: Configure Bot Scopes
Under OAuth & Permissions → Scopes → Bot Token Scopes, add:Step 3: Install to Workspace
- On the OAuth & Permissions page, scroll up and click Install to Workspace
- Click Allow on the permission prompt
- Copy the Bot User OAuth Token (
xoxb-...) — this is your bot token
If you see Request to Install instead of Install to Workspace, your workspace has app approval enabled. Ask a workspace admin to approve the app, or temporarily disable approval in Slack Admin → Manage Apps → Settings.
Step 4: Get the Channel ID and Invite the Bot
- In Slack, navigate to the channel where you want alerts delivered
- Right-click the channel name → View channel details
- Scroll to the bottom and copy the Channel ID (e.g.,
C0123456789) - In the channel, invite the bot:
Step 5: Register the Slack Channel in Svantic
Via the dashboard
- Go to Settings → Channels → click New Channel
- Select Slack as the type
- Enter a name (e.g., “Engineering Slack”)
- Enter the Bot Token (
xoxb-...) - Enter the Channel ID (
C0123456789) - Click Create
Via the API
Step 5b: Test
Trigger a real event (e.g., register and deregister an agent) with the alert subscription enabled and the Slack channel linked. A notification should appear in the Slack channel.Step 6: Enable Interactivity (Optional)
This step is only needed if you want users to approve or deny requests directly from Slack buttons. Under Interactivity & Shortcuts in your Slack App settings:- Toggle Interactivity to On
- Set Request URL to:
https://your-gateway-domain/integrations/slack/interactive - Click Save Changes
Step 7: Note Your Signing Secret (Optional)
Only needed for interactive approvals (step 6). Under Basic Information → App Credentials, copy the Signing Secret. Svantic uses this to verify that inbound requests actually come from Slack (and not an attacker spoofing Slack’s payload format).How Approval Buttons Work
Outbound (Svantic → Slack)
When a message entersinput-required, the SlackRenderer inspects the A2UI spec:
- Simple approval (1 action field with 2-3 options): renders Slack buttons inline
- Complex form (multiple fields, sensitive data): renders a summary text with a “Complete in Dashboard” button
message_id.
Inbound (Slack → Svantic)
When a user clicks a button:- Slack POSTs an interaction payload to
https://your-gateway/integrations/slack/interactive - Svantic verifies the Slack signing secret:
- Computes
v0:timestamp:body→ HMAC-SHA256 with signing secret - Compares to the
X-Slack-Signatureheader - Rejects if timestamp is stale (>5 minutes)
- Computes
- Svantic extracts the action (
approveordeny) andmessage_idfrom the payload - Svantic resolves the pending request (same logic as dashboard resolution)
- Svantic POSTs back to Slack’s
response_urlto update the original message:- Buttons are replaced with: “Approved by @john at 3:45 PM”
- This prevents other users from clicking already-resolved buttons
Race Conditions
If someone approves from the dashboard at the same moment someone clicks Approve in Slack, the first resolution wins. The second receives a409 Conflict, and Svantic updates the Slack message to reflect that it was already resolved.
Limitations
Security Considerations
- Never expose the signing secret. Store it in a secrets manager, not in source code.
- The bot token is sensitive. It allows posting to channels. Restrict it to the minimum required scopes.
- Verify every inbound request. The signing secret verification prevents attackers from forging Slack payloads.
- Svantic never sends sensitive field values to Slack. Credentials, passwords, and other sensitive A2UI fields are filtered out by the
SlackRenderer.
Troubleshooting
Further Reading
- Notification Channels — managing all channel types
- Approvals Guide — the full approval workflow
- Notifications & Approvals — the architectural model
