
Configuration
Option 1: Using the HumanLayer Slack App

- Head to the HumanLayer dashboard
- Navigate to “Integrations”
- Click “HumanLayer App” under the Slack section
- Follow the Slack Approval Workflow
- Congrats - your HumanLayer agents will now contact you in Slack for approvals
Option 2: Using Your Own Slack App

- Customizing the bot’s display name, icon, and branding
- Using a consistent bot identity across multiple integrations
- Managing app distribution and permissions at an organizational level
- Custom approval UI with your brand’s look and feel
- Enterprise policy compliance
- Create a Slack App - Create a new Slack app in your workspace with the following manifest:

-
Configure Your App in HumanLayer:
- In the HumanLayer dashboard, navigate to your project’s settings
- Navigate to “Integrations”. Select “Use Your Own” under the Slack section.
- Enter your Slack app’s Signing Secret and App ID
- Save the configuration
-
Get Your OAuth Token:
- For testing, you can use the Bot User OAuth Token from your Slack app settings
- For production, implement a proper OAuth flow following Slack’s documentation
-
Use Your Bot Token with HumanLayer SDK:
- When initializing HumanLayer, provide your bot token in the contact channel configuration:
examples
directory. Be sure you have a Slack application setup before attempting to run the script.
Troubleshooting
If you encounter issues with your custom Slack app integration:- Verify Scopes - Ensure your app has all the required scopes listed in the manifest
- Check Request URLs - The event subscription and interactivity URLs must point to the HumanLayer API
- Verify Signing Secret - Double-check the signing secret entered in the HumanLayer dashboard
- Update/Reauthorize Slack Apps - If you’re updating an existing Slack app and have added new scopes, you’ll need to reauthorize the app via the OAuth flow you’ve built. Be sure to take a look at the embedded markup Slack provides in the “Manage Distribution” section of your app’s settings as these links and markup can change once you’ve updated scopes.
Customizing Channels
The Slack contact channel allows agents to send messages and collect responses through Slack channels or direct messages. Configure a Slack channel using theSlackContactChannel
model:
Allowed Responders
You can restrict which Slack users are allowed to respond to a message usingallowed_responder_ids
:
allowed_responder_ids
must be Slack user IDs (starting with U
). Messages from other users will be ignored.
See 01-math-example-allowed-repliers.py for a complete example.
Thread Messages
You can specify a thread to post messages in using thethread_ts
parameter:
thread_ts
parameter accepts a Slack message timestamp (e.g. “1234567890.123456”) which identifies the parent message of the thread. When specified, all messages will be posted as replies in that thread instead of as new messages in the channel.
This is useful for organizing related approvals or keeping discussions contained within specific threads.
Channel/User ID
Thechannel_or_user_id
must be a Slack ID:
- Channel IDs start with
C
(e.g.C123456
) - User IDs start with
U
(e.g.U123456
) - Do not use channel names (
#general
) or usernames (@user
)
Context
The optionalcontext_about_channel_or_user
field helps the LLM understand who it’s talking to: