Slack app setup
kube-agents talks to Slack through one Slack app that you create in your workspace. The app connects over Socket Mode (an outbound websocket), so nothing on the cluster needs an inbound endpoint. The A2A gateway (the platform-agent-a2a-gateway Deployment) holds the connection, with or without Google Chat.
The gateway serves one workspace: an install whose Slack bot token is a list for several workspaces installs one workspace’s token, or turns Slack off. An app made for the Hermes listener of an earlier release keeps answering after the upgrade; Moving an app made for the Hermes listener has the edits that give it the gateway’s Home tab and Stop button.
Before you start
Section titled “Before you start”- A Slack workspace where you may install apps. Many workspaces require a workspace admin to approve a new app; if yours does, ask before you start, or the install waits on the approval.
- One workspace per install: the A2A gateway takes a single bot token. It refuses members of other workspaces, such as Slack Connect guests, unless the allowlist names each one (below).
Create the app
Section titled “Create the app”For the A2A gateway
Section titled “For the A2A gateway”-
Open https://api.slack.com/apps, choose Create New App → From a manifest, and pick your workspace.
-
Paste this manifest (YAML), changing only
nameanddisplay_name:display_information:name: kube-agentsfeatures:app_home:home_tab_enabled: truemessages_tab_enabled: truemessages_tab_read_only_enabled: falsebot_user:display_name: kube-agentsalways_online: trueassistant_view:assistant_description: Ask kube-agents about your clusters.shortcuts:- name: Ask about thistype: messagecallback_id: ask_about_messagedescription: kube-agents looks into this message and answers in its threadoauth_config:scopes:bot:- assistant:write- channels:history- channels:read- chat:write- commands- groups:history- groups:read- im:history- im:read- mpim:history- mpim:read- reactions:write- users:readsettings:event_subscriptions:bot_events:- agent_session_stopped- app_home_opened- assistant_thread_started- message.channels- message.groups- message.im- message.mpiminteractivity:is_enabled: truesocket_mode_enabled: truetoken_rotation_enabled: false -
Choose Create.
What the manifest covers, so you can check an existing app instead:
- Events. The gateway reads messages only:
message.imfor DMs, andmessage.channels,message.groupsandmessage.mpimfor public, private and group channels. Each event needs its history scope (im:history,channels:history,groups:history,mpim:history); without it the app connects normally and is never sent the message. In a channel the gateway answers only a message that mentions the app, or a reply in a thread it is already answering; it finds mentions in the message text, soapp_mentionis not needed. - Scopes.
chat:writecovers every post and edit the gateway makes.channels:read,groups:read,im:readandmpim:readread who is in a conversation. A reply goes into the conversation or thread the message came from, so no other scope is needed for it, in a DM either.reactions:writeputs the reactions on your message,users:readnames who answered a question, who used the message shortcut and who wrote the message it quotes (without it they read as Someone), andassistant:writeshows Working… on a thread, titles it and sets the suggested prompts; without them the answers still arrive and only those go missing (ChatOps). - Interactivity, the assistant view and
assistant_thread_started. The gateway answers a click on a question’s buttons, on an answer’s 👍 or 👎, and the message shortcut, which all arrive as interactions, so interactivity is on, and it offers suggested prompts when a member opens a new assistant thread. On an app using agent view the gateway also answersapp_home_openedon the Messages tab with the prompts. agent_session_stopped. Slack offers a Stop button on a thread’s Working… line to an app that subscribes it, and sends the event when someone presses it; the gateway treats it asstopin that thread (ChatOps). Without it there is no Stop button and typedstopstill works. Adding it adds no scope; reinstall the app if Slack asks.- Messages tab. Without it, members cannot DM the app.
- Home tab and
app_home_opened. The gateway draws the fleet dashboard and the home channel picker (the Slack Home tab) when a member opens the tab. Without either, the tab is absent or blank and nothing else changes; neither needs a scope. WithallowedUsersleft empty, the gateway checks each member’s workspace withusers.info, so the tab also needsusers:read; without it the tab stays blank. - The message shortcut and
commands. Theshortcutsentry puts Ask about this in every message’s ⋯ menu, with the app’s name beside it, and Slack offers shortcuts only to an app with thecommandsscope. The gateway knows the shortcut by itscallback_id, so keepask_about_messageand rename onlynameanddescription; Slack refuses anameof 25 characters or more. The shortcut also needs interactivity on. Without the entry or the scope, everything else works and the menu entry is missing (ChatOps). - No slash commands. The gateway does not acknowledge them, so a member who used one would see Slack’s timeout error.
Moving an app made for the Hermes listener
Section titled “Moving an app made for the Hermes listener”Slack moves from the Hermes listener to the gateway on the upgrade that adds the A2A stack to an install that ran without it (Upgrade → Moving to the A2A stack). An app made for the listener from the hermes slack manifest output already has every scope and event the gateway needs to answer messages (the Home tab needs the two settings in step 3, and the Stop button needs agent_session_stopped), unless it was generated with --no-assistant, so it keeps its tokens and needs no new install.
A --no-assistant app lacks assistant:write, the assistant view and assistant_thread_started: add them as in the manifest above and reinstall, or Working…, the thread titles and the suggested prompts do not appear. Edit it rather than pasting the manifest above, which would rename the app:
- After the move, open the app’s App Manifest page.
- Delete the
features.slash_commandsblock. Leave interactivity on: the gateway answers button clicks. - Turn the Home tab on: set
features.app_home.home_tab_enabledtotrueand addapp_home_openedtosettings.event_subscriptions.bot_events. Required when Slack is on the gateway: the tab carries the fleet dashboard and the home channel picker. - For the Stop button, add
agent_session_stoppedtosettings.event_subscriptions.bot_events. - Save. The edit changes no scopes; if Slack still asks you to reinstall, do so.
Do it after the move rather than before, because the Hermes listener answers slash commands until then. Until you do, a slash command on the gateway shows the member Slack’s timeout error.
For the message shortcut, add the features.shortcuts entry from the manifest above in the same edit. The app already has the commands scope, since its slash commands need it; if Slack still asks you to reinstall, do so.
Get the tokens
Section titled “Get the tokens”- App-level token (
xapp-…): Basic Information → App-Level Tokens → Generate Token and Scopes, add the scopeconnections:write, and generate it. Socket Mode needs this scope. - Bot token (
xoxb-…): OAuth & Permissions → Install to Workspace (or Request to Install where an admin approves apps), then copy Bot User OAuth Token. Reinstall the app whenever you change its scopes; Slack only grants new scopes on install.
Pass them to the installer as --slack-bot-token and --slack-app-token. Give exactly one bot token: the gateway cannot use a comma-separated list.
Once the app is installed, invite it to any channel it should answer in, using the bot’s display name from the manifest (/invite @kube-agents for the manifest above). It receives a channel’s messages only once it is a member; DMs need no invite.
Home channel
Section titled “Home channel”The home channel is where the agent posts unprompted: alerts, scheduled reports, and the fleet audit’s report card. Set one, pick one on the app’s Home tab, or, under homeChannelPolicy auto (the default), mention the agent in the channel you want it to be. Until a home channel exists, every one of those posts is refused while conversations keep working, unless Google Chat on the same gateway has a home channel. Then they go to Chat’s home channel until Slack has its own. The gateway keeps the refused posts, up to fifty for thirty days, and once the channel is set it posts one digest of them there (ChatOps).
The home channel is the resource field, spec.integration.slack.homeChannel, which the installer sets from SLACK_HOME_CHANNEL (--slack-home-channel), or the channel the gateway learns from a mention while the field is empty and homeChannelPolicy is auto (the default). It must be a channel ID (C0123ABCD, or G… for a private channel), not a name: open the channel’s details and copy the Channel ID at the bottom. Invite the app to that channel, or its posts are refused. With the field unset and spec.integration.slack.homeChannelPolicy auto (the default), the first top-level mention of the agent in a channel makes that channel the home channel. The gateway checks it, records it, and answers with one line in the thread; the agent’s own posts follow within about a minute, with no pod restart. An allowed member moves it later from the app’s Home tab: the Home channel picker checks the channel the same way and records it (Home channel has the detail; manual turns this off). With allowedUsers empty, every full member of the workspace may move it, and a non-empty list narrows that. A guest account (single-channel or multi-channel) never moves it, listed or not: the pick checks the account with users.info, which needs the users:read scope the manifest already grants, and a check that cannot run refuses. Until a home channel exists, the agent posts nothing to Slack unprompted, though a delegated task’s report still reaches the conversation that asked for it. The installer warns before it applies that (and install.sh’s setup interview asks you to confirm), the gateway logs a warning at start, and the PlatformAgent carries the HomeChannelUnset condition. Set to something that is not a channel ID, it turns off both. /sethome does not reach it.
A home channel set with /sethome on an earlier release’s Hermes listener does not carry over to the gateway. Before the upgrade, set SLACK_HOME_CHANNEL in install.env to that channel’s ID and re-run the installer, or pick the channel on the app’s Home tab after it.
Allowed users
Section titled “Allowed users”The allowlist decides who may talk to the agent. It takes Slack member IDs, not emails or display names, and matches them exactly:
- Find a member ID: in Slack, open the person’s profile, choose the ⋮ (more) menu, then Copy member ID. It looks like
U0123ABCD. - Set it: pass
--slack-allowed-users=U0123ABCD,U0456EFGHon the first installer run. To change it later, editSLACK_ALLOWED_USERSininstall.envand re-run the installer: a re-run refuses a--slack-allowed-usersthat disagrees withinstall.env, and an upgrade renders thePlatformAgentresource frominstall.env, so a hand edit of the resource does not last. - An email never matches. An entry like
alice@example.comadmits nobody; if every entry is an email, everyone is refused. - An empty list admits every member of the workspace. In a shared or company workspace that means anyone there can drive an agent with access to your clusters, so set a list unless the workspace is yours alone.
- A member of another workspace: a Slack Connect guest is admitted only by an entry with their workspace ID, a colon and their member ID, for example
T0123WXYZ:U0123ABCD. The bot’s refusal notice gives the guest this exact entry, and the gateway’s refusal log line names both IDs. A plain member ID always means a member of your own workspace, so it never admits a guest, and an empty list admits no guest either. A list with guest entries is not empty, so list your own members too. A listed guest gets the same access as your own members: they can ask the agent to act on your clusters, and the Home tab shows them the fleet. So list only people the outside organization’s access should extend to. With guest entries on the list, the Home tab checks each member’s workspace withusers.info(theusers:readscope), so a guest listed only by a plain member ID is not shown the fleet either. On the Hermes listener a guest entry admits nobody.
A member who is not on the list gets one answer per member: a notice that it cannot verify them, naming their member ID, so an admin can add them. A member of another workspace in a Slack Connect channel is not served, even with an empty list, unless a T…:U… entry names them. The first time they mention the bot, send it a direct message, or click one of its buttons, the bot replies once, in that thread, that it answers only its own workspace. The reply names their member ID and the T…:U… entry to ask an admin to add. The reply is a public post in the thread, so in a Slack Connect channel members of both organizations can read it. A member who uses the message shortcut gets the notice that it cannot verify them every time, visible only to them. A member of another workspace can use it when a T…:U… entry names them; one that no entry names gets no reply.
The A2A gateway has no pairing: a kube-agents install configures the allowlist instead.
Principal map (gateway, optional)
Section titled “Principal map (gateway, optional)”The gateway attributes each admitted member by their member ID (slack:U0123ABCD) in the request it sends the agent. To attribute members by an identity from your identity provider instead, create the optional Secret a2a-slack-principal-map in the install’s namespace: one key per member ID, whose value is that member’s principal.
kubectl create secret generic a2a-slack-principal-map -n kubeagents-system \ --from-literal=U0123ABCD=alice@example.com \ --from-literal=U0456EFGH=bob@example.comkubectl rollout restart deployment/platform-agent-a2a-gateway -n kubeagents-systemA Slack Connect guest cannot be mapped: a Secret key cannot hold the : of a T…:U… entry, so a guest is always attributed by that entry (slack:T…:U…). The gateway reads the map when it starts, so restart it after every change. The map changes attribution only: it admits no one, and a member the allowlist refuses is refused whatever the map says. A value that starts with slack: locks that member out, even when the allowlist admits them, until the entry is corrected. The spec.integration reference has the rest of the map’s behaviour.
Verify
Section titled “Verify”-
Check that the app connected:
Terminal window kubectl logs deploy/platform-agent-a2a-gateway -c gateway -n kubeagents-system | grep 'slack connected'A line with
"msg":"slack connected"names the bot user and the workspace (team). -
DM the app (Apps, then the app’s name, then Messages) with a question such as
what clusters can you see?. The answer comes back in the DM, in a thread under your question (an older release answers it top-level in the DM). -
If nothing comes back, check the gateway log for these lines:
Log line ( msg)Cause Fix none at all for your message A missing history scope or event subscription, or the messages tab is off Compare the app with the manifest above, then reinstall it dropping message from unverified senderYour member ID is not on the allowlist Add the member ID, not an email slack allowlist is empty and allow-all is off; every inbound message will be dropped at verificationThe list has only blank entries Set real member IDs, or remove the list to admit everyone slack: ignoring a message from another workspace's memberThe sender ( user) is in another workspace (userTeamormessageTeam)Use the workspace the app is installed in, or admit the sender with a userTeam:userentry (messageTeam:userwhenuserTeamis empty)chat backend stopped; restarting it, the console stays upThe tokens were refused, for example a comma-separated bot token Pass one xoxb-bot token and onexapp-app token