> ## Documentation Index
> Fetch the complete documentation index at: https://docs.xpander.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Agents in Slack and Teams

> Talk to Omni, mention agents by handle, route channels to agents and relay answers in Slack and Microsoft Teams.

Once an admin connects your [Slack workspace](https://docs.xpander.ai/run/integrations/slack.md) or [Microsoft 365 tenant](https://docs.xpander.ai/run/integrations/microsoft-teams.md), you can talk to Omni and your organization's agents there. One workspace or tenant maps to one organization.

## Who answers a message

Checked in order:

| # | The message | Who answers |
| - | - | - |
| 1 | An @mention of xpander | Omni, as **"your-name's Omni"**, in the author's own conversation. It follows the thread (in Teams, the reply chain) for about five minutes. |
| 2 | `/agent <name> <prompt>` (or `/xpander`), Slack only | The named agent, if the author may use it |
| 3 | A reply to an agent's direct message (Slack) | [That agent](#reply-to-a-direct-message-from-an-agent) |
| 4 | Any other DM (a 1:1 chat in Teams) | Omni, in a standing conversation, the same history as in xpander Chat |
| 5 | An untagged message in a [routed channel](#route-a-channel-to-an-agent) | That agent, when auto-engagement is on and a rule matches |
| 6 | Nothing matches | Nobody |

In Slack, an [agent handle](#mention-an-agent-by-handle-slack) such as `@account-research` reaches that agent, under its own name and icon.

Each person has **their own** Omni conversation, context and, where systems allow, permissions, even in a shared thread. Replies are labelled per person (**"Dana's Omni"**, **"Sam's Omni"**), and neither sees the other's private data. There is no shared Omni.

## Talk to Omni

DM the xpander Slack app, or message **xpander** from your Teams app list. If your Slack or work email matches your xpander account, you're linked at once. Otherwise tap **Link account**.

The DM is a real Omni conversation: it shows in xpander Chat's sidebar, keeps context, uses skills and streams replies. `new chat` or `reset` (in Teams also `new conversation`) starts fresh.

> [accordion] Files, live surfaces and building agents from the DM
>
> * Voice notes, images and files are handled automatically.
> * Answers are the message itself. A live surface comes only when you ask for a report, dashboard, scorecard or live view, or when the agent's instructions say so. Dashboards and visual cards get a **View here** button that opens them in the browser without sign-in.
> * You can build agents from the DM. Omni asks setup questions with buttons, sends authorization links, and creates the agent when you tap **Approve & build**. Skills that need MCP setup are finished in xpander Chat, from a link Omni sends.
> * Your xpander profile must belong to the organization the workspace or tenant is connected to. If your profile lives in a different organization, you are asked to link again. This is by design.

## Route a channel to an agent

Any member can let one agent answer untagged messages in a channel. **Only one agent can auto-engage per channel.** Handle mentions still reach other agents.

**1. Let the app read the channel**

> [tab] Slack
>
> The app joins public channels when you add them. For a private channel, `/invite @xpander` first.

> [tab] Microsoft Teams
>
> A **team owner** opens **Team → ••• → Manage team → Apps → Add** and adds the xpander Teams app. It must be a **team install**, not a tab or a personal install. Accept the consent prompt about **receiving channel messages**.

**2. Add the channel**

In the agent's settings, under **Slack channels** or **Microsoft Teams channels** (**Add a channel to listen to** in the Channels pane, or the channel selector under the composer), pick the channel (in Teams, the team and channel) and click <kbd>Add</kbd>.

**3. Write engagement rules**

Under **Rules**, describe when the agent should step in. It engages when **any** rule matches. Rules apply within a minute. Write intents, not keywords: "When someone reports a bug, error, or outage" works. "bug, error, pricing" triggers on most messages.

The agent answers **in a thread**, attributed to the author, acting with their permissions where systems allow. Only **top-level messages** engage it, unless **Also engage in thread replies** is on. An @mention of the app always goes to Omni, and a handle to that agent.

> [!WARNING]
>
> In Teams, without the team install and its **receive channel messages** consent, the app still answers @mentions in that team but never sees untagged messages. Channel routing silently drops to mention-only. If routing isn't firing, check this first.

> [accordion] How engagement works and channel row settings
>
> A judge model confirms intent, and messages addressed to a person are left alone. Once engaged, the agent follows the conversation for a few minutes. The thread is shared, the five-minute follow window is per person.
>
> | Setting | What it does |
> | - | - |
> | **Rules** | Plain-language "when to step in", each with an optional instruction. Governed by **Auto-engage**. Mentions always get through. |
> | **Reply** | **Also engage in thread replies**, or **Judge every message** instead of staying engaged |
> | **Where** | This channel, more channels (finished answer only), or somewhere else. See below. |
> | **Format** | How answers look here. Overrides the agent's output format. Slack only. |

> [accordion] Send replies to another channel (Where)
>
> | Option | Where a finished answer lands |
> | - | - |
> | **This channel** | Where it was asked (default) |
> | **This channel and more** | There, and relayed to the channels you add |
> | **Somewhere else** | Only the added channels. The thread gets a short pointer. |
>
> Add up to 10 channels (`/invite` the app to private ones). A relay is a copy with a **Relayed from #channel** line, posted under the agent's name, not a conversation. These channels are also the only ones the agent may post to while it works.
>
> Only a completed answer is relayed. Errors and progress updates stay in the original channel. A direct @mention always reaches Omni in the author's own conversation rather than the routed agent, so it is never relayed.

## Mention an agent by handle (Slack)

A handle lets people pick an agent from Slack's mention picker in any channel the app is in, with no rule or channel list. It needs a one-time [administrator authorization](https://docs.xpander.ai/run/integrations/slack.md#authorize-handle-management) of the workspace. Until then the handle controls read **Not active**.

**1. Create the handle**

In the agent's **Channels → Slack** settings, under **Agent handle**, edit the suggested name (for example **Account Research → account-research**) and select <kbd>Create handle</kbd>. It works once its status is **Active**.

**2. Mention the agent**

Add the app to the channel if needed, then type the handle and select it from the mention picker. Plain text that looks like a handle selects nothing.

> [accordion] Requirements, several handles, rename and delete
>
> Handles work in any public or private channel the app is in. The agent must be published and shared with the organization. The sender must be a full workspace member in that channel. Guests, Slack Connect channels and DMs are not supported.
>
> Mention several handles for separate answers, for example `@account-research @sales-assistant prepare a briefing for Acme`. Each answers separately. Follow-ups without a mention stay with the same agents while the thread's context is active.
>
> | Action | What happens |
> | - | - |
> | **Rename** | The new name must be free in that workspace |
> | **Delete handle** | Removes the mapping at once and queues Slack cleanup, which deactivates the group and frees the name. Slack can keep a deactivated entry and old messages. [Deactivation prevents new mentions](https://docs.slack.dev/reference/methods/usergroups.disable/). |
> | **Remove mapping** | For an existing admin-managed group, removes only the agent mapping |
>
> If cleanup is pending, ask the workspace admin to restore authorization, and let it finish before reusing the name.

## Reply to a direct message from an agent

Reply in the message's thread to answer the agent itself. Its answers come back in the thread, which keeps reaching the agent for 30 days after its last turn. Anything else in the DM goes to Omni.

> [accordion] Where the message comes from and when a reply continues it
>
> An agent's direct message comes from its own Slack app when it has one in your workspace, otherwise from the xpander Slack app under the agent's name and icon.
>
> A reply continues the conversation only if you are the person it reached, from the same linked xpander account, you may use the agent, and your organization still owns the workspace. If you can't continue the original conversation (it is someone else's), your reply starts a new one that opens with the message.

## Progress while an agent works

One status line updates while the agent works, then the answer arrives. **Show detailed tool activity** on the channel row (or for every channel in the bot's settings) shows readable steps instead.

> [accordion] Step list, attachments and approvals
>
> * The step list folds repeats and shows at most twelve rows. A channel set to post no progress stays silent until you turn it on. Changes reach a channel within a minute.
> * Images and PDFs are read with OCR, voice notes transcribed and links fetched. Each is switchable under **Slack behavior**.
> * Held approvals reach approvers in Slack too.

DMs and Teams 1:1 chats appear in your xpander sidebar. Channel conversations don't, but every run is in the organization's [Session Manager](https://docs.xpander.ai/use/agents/conversations.md#the-task-record).

## Differences in Teams

| | Slack | Microsoft Teams |
| - | - | - |
| Reply identity in channels | The agent's own name and icon | The agent's name in bold, at the start of the reply |
| Reading untagged messages | The app joins the channel | Per-team consent at install |
| Streaming | Word by word only in DMs with Omni. Other replies arrive whole. | 1:1 chats only. Channels update a progress message in place. |
| Questions from Omni | Buttons | Tappable button cards |
| Long answers | The message itself | A PDF attachment with a short lead paragraph |
| After **Link account** | The code is valid for fifteen minutes | The code is single-use and valid for 15 minutes. Your first message is answered when the link completes. |
| Slash commands | Available | Not available yet |

## Troubleshooting

> [accordion] I get a link-account prompt instead of an answer
>
> Your Slack or work email doesn't match an xpander account in this organization. Tap **Link account**, or ask your admin to invite that email. A profile in another organization must link again.

> [accordion] The Teams Link account button expired or looped
>
> Link codes are single-use and valid for 15 minutes. Send any message again for a fresh button.

> [accordion] The routed agent doesn't respond in a channel
>
> Slack: the app must be in the channel (`/invite` it, always for private channels). Teams: usually the app was added personally or as a tab, not to the **team**. Re-add it via **Team → ••• → Manage team → Apps** and accept the **receive channel messages** consent. Then check that auto-engage is on and a rule matches. Thread replies need **Also engage in thread replies** or an @mention. Rule edits take up to a minute.

> [accordion] The agent responds when it shouldn't
>
> Tighten the rules. "When someone asks a question" matches almost everything. After an engagement, follow-ups may engage for a few minutes without re-checking rules.

> [accordion] The app says the organization is out of credits
>
> Runs stop with a billing notice when credits run out. An organization admin can top up under **Settings** in xpander Chat. Then send your message again.

> [accordion] My handle is Not active or does not appear in Slack
>
> Read the note beside the handle. The workspace needs a paid Slack plan with user groups and admin authorization. Wait for **Active**, then select the handle from the mention picker. If Slack rejects the name, pick another.

> [accordion] The workspace is Authorized, but creating or deleting a handle fails
>
> Consent doesn't override Slack permissions. The authorizing account must be allowed to create, edit and deactivate user groups. Ask an admin with those rights to reauthorize. Allowing everyone is not required.

> [accordion] A deleted handle still appears in Slack
>
> Check whether cleanup is pending in xpander, and restore authorization if needed. Slack may still show a deactivated entry or old messages. Removing an admin-managed mapping leaves the group unchanged on purpose.

> [accordion] The Teams app doesn't respond to my 1:1 messages
>
> Check that Microsoft Teams is on under **Platform > Agents > Channels**. If it is, confirm the app is **Allowed** in the Teams admin center and in your setup policy.

> [accordion] The Microsoft Teams settings are missing from my agent
>
> They appear only after an admin connects your tenant. Admins see a connect prompt. Other members see nothing.

> [accordion] The Teams channel list is empty or errors when I try to add a channel
>
> The picker lists only teams the app was added to. Add it to the team and reopen the picker. Still empty: the tenant may predate this permission, so an admin clicks **Reconnect** under **Platform > Agents > Channels**.

> [accordion] Answers aren't streaming in a Teams 1:1 chat
>
> Teams sometimes refuses a stream, and the reply arrives as one message updated in place. Nothing is lost. Channel replies never stream.

## Next steps

> [card] [See every way work reaches an agent](https://docs.xpander.ai/use/agents/channels.md)
>
> All channels.

> [card] [Connect the Slack workspace](https://docs.xpander.ai/run/integrations/slack.md)
>
> For administrators.

> [card] [Connect the Microsoft Teams tenant](https://docs.xpander.ai/run/integrations/microsoft-teams.md)
>
> For administrators.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.