Slack Integration¶
Connect Ag2Trust to your Slack workspace so agents can respond to messages in channels and DMs.
Overview¶
The Slack integration provides:
- Channel-to-agent mapping — Route messages from specific Slack channels to specific agent types
- DM bot — Users can message the bot directly for 1:1 agent interactions
- OAuth installation — Secure, scoped access to your Slack workspace
Prerequisites¶
- An Ag2Trust account with at least one running agent type
- Slack workspace admin permissions (for app installation)
Installation¶
Step 1: Start OAuth Flow¶
- Go to Settings > Integrations > Slack
- Click Connect Slack
- You'll be redirected to Slack's authorization page
- Select your workspace and click Allow
- You'll be redirected back to Ag2Trust with the installation confirmed
Step 2: Configure Default Agent Type¶
After installation, set the default agent type that handles unmatched messages:
- Go to Settings > Integrations > Slack
- Select the installation
- Set the Default Agent Type
- Click Save
Step 3: Set Up Channel Mappings¶
Map specific Slack channels to specific agent types:
- Go to Settings > Integrations > Slack
- Select the installation
- Navigate to Channel Mappings
- Click Add Mapping
- Select a Slack channel and the agent type that should handle its messages
- Repeat for each channel you want to route
- Click Save
How It Works¶
Slack Message → Ag2Trust Bot → Channel Mapping Lookup
│
┌──────────┴──────────┐
│ │
Mapped Channel Unmapped Channel
│ │
Specific Agent Default Agent
Type Type
│ │
└──────────┬──────────┘
│
Agent Response
│
Slack Reply
- A user mentions the bot or sends a DM
- Ag2Trust checks channel mappings
- The message is routed to the matched agent type (or default)
- The agent processes the message and responds
- The response is posted back to the Slack thread
Managing Installations¶
View Installations¶
- Go to Settings > Integrations > Slack
- View all connected Slack workspaces and their status
Disconnect¶
To revoke access and disconnect a Slack workspace:
- Go to Settings > Integrations > Slack
- Select the installation
- Click Disconnect
- Confirm the action
This revokes OAuth tokens and marks the installation as disconnected.
Best Practices¶
- Use channel mappings — Route specialized channels (e.g.,
#engineering-support) to domain-specific agent types - Set a default agent type — Ensures unmapped channels still get responses
- Scope to a team — When installing, scope the Slack integration to an Ag2Trust team for better organization
- Monitor bot responses — Review agent responses in the Ag2Trust dashboard to tune system prompts
Troubleshooting¶
Bot not responding in channel¶
- Ensure the bot is invited to the channel (
/invite @ag2trust) - Check that agents of the mapped agent type are running
- Verify the installation status is
active
Bot responding with wrong agent¶
- Review channel mappings — the channel may not have a specific mapping, falling back to the default
- Check that the correct agent type ID is set
OAuth authorization fails¶
- Ensure you have Slack workspace admin permissions
- Check that the Ag2Trust Slack app is approved in your workspace's app management settings
Next Steps¶
- Event Sources — Receive events from other platforms
- Agent Types — Configure agent behavior
- Teams — Organize agents into teams