Skip to content

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

  1. Go to Settings > Integrations > Slack
  2. Click Connect Slack
  3. You'll be redirected to Slack's authorization page
  4. Select your workspace and click Allow
  5. 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:

  1. Go to Settings > Integrations > Slack
  2. Select the installation
  3. Set the Default Agent Type
  4. Click Save

Step 3: Set Up Channel Mappings

Map specific Slack channels to specific agent types:

  1. Go to Settings > Integrations > Slack
  2. Select the installation
  3. Navigate to Channel Mappings
  4. Click Add Mapping
  5. Select a Slack channel and the agent type that should handle its messages
  6. Repeat for each channel you want to route
  7. 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
  1. A user mentions the bot or sends a DM
  2. Ag2Trust checks channel mappings
  3. The message is routed to the matched agent type (or default)
  4. The agent processes the message and responds
  5. The response is posted back to the Slack thread

Managing Installations

View Installations

  1. Go to Settings > Integrations > Slack
  2. View all connected Slack workspaces and their status

Disconnect

To revoke access and disconnect a Slack workspace:

  1. Go to Settings > Integrations > Slack
  2. Select the installation
  3. Click Disconnect
  4. Confirm the action

This revokes OAuth tokens and marks the installation as disconnected.

Best Practices

  1. Use channel mappings — Route specialized channels (e.g., #engineering-support) to domain-specific agent types
  2. Set a default agent type — Ensures unmapped channels still get responses
  3. Scope to a team — When installing, scope the Slack integration to an Ag2Trust team for better organization
  4. 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