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

# Work incidents from Slack

> Connect Slack, link your account, route alerts to channels and run SRE Agent from slash commands and buttons.

export const Plan = ({tier}) => <Badge color="blue">{tier} plan</Badge>;

Slack gets every alert as a message you can act on. You can acknowledge, resolve, investigate, mute and file work without leaving the thread.

<Plan tier="Free" />

## Connect your workspace

<Steps>
  <Step title="Install the app">
    An organization admin goes to **Settings**, **Notifications**, scrolls to **Slack** and clicks
    **Add to Slack**. Slack asks you to approve the app for your workspace. If you run your own
    Slack app instead, click **Add manually** and enter its details.
  </Step>

  <Step title="Choose the default channels">
    Set the **Critical Channel**, **Warning Channel** and **Info Channel** for alerts by severity.
    The optional **Remediation Channel** receives outcomes of fix requests that did not start from a
    channel. When it is blank, those go to the Info channel.
  </Step>

  <Step title="Invite the bot to private channels">
    A public channel needs nothing. For a private channel, run `/invite @SRE Agent` in it first.
  </Step>
</Steps>

If the Slack card tells you to re-authorize, click **Add to Slack** again. Slack grants a new permission only when the app is installed again, and everything else keeps working until you do.

### Route a service to its own channel

Under **Per-Service Alert Channels**, type a **Service**, a **Slack channel** such as `#checkout-alerts`, and optionally **Mention on call (optional)** to mention whoever is on call for a schedule in each new thread. Click **Save route**. Alerts for that service open there instead of the severity channel. A route applies to alerts that open a new thread, so an alert that already has a thread keeps it. The service is read from the alert's `service`, `job`, `app` or `namespace` label, and an alert with none of them uses the severity channels.

## Link your Slack account

Commands that change things need to know which SRE Agent account is acting. Most people are linked automatically the first time they run a command, using the email address on their Slack profile. If your Slack email differs from your SRE Agent email:

* Run `/sre-link <your email>`. SRE Agent emails that address a confirmation link.
* An organization admin can also match every member by email at once with **Admin**, **Users**, **Sync Slack IDs**.

**Unlink** on the Slack card removes the link.

## Slash commands

Your role in the organization decides which commands work. Viewers can read and members can act. If your role is too low, the command tells you which role it needs.

| Command | What it does | Role |
| - | - | - |
| `/sre-status` | Posts worker usage out of your limit, queue depth, alerts in the last hour and the number of active investigations. | Anyone in the workspace |
| `/sre-alerts` | Lists active alerts. | Anyone in the workspace |
| `/sre-investigate <alert-id>` | Starts an investigation for an alert. | Member |
| `/sre-mute <pattern> <duration> [reason]` | Mutes alerts that match a pattern. Durations use `m`, `h` or `d`, for example `/sre-mute HighCPU 2h known outage`. | Member |
| `/sre-alert [severity:] <title>` | Files an alert, for example `/sre-alert critical: checkout is down`. | Member |
| `/sre-ticket <title>` | Opens an ops board card in Triage. | Member |
| `/sre-fix [service or repo] <what to fix> [files: a.tf, b.tf]` | Asks for a remediation pull request in plain words. The target is optional. `files:` is a starting hint only. | Organization admin, and needs the GitHub App on the Business plan |
| `/sre-invite <email> [role] [name]` | Invites a teammate as member, viewer or support. | Organization admin |
| `/sre-link <your email>` | Links your Slack account. | Anyone |
| `/sre-help` | Lists these commands. | Anyone |

You can also mention the bot in a channel, or message it directly, to ask about your organization's data. Those questions need a linked account.

## Buttons and reactions

| Where | Button or reaction | What it does |
| - | - | - |
| Alert message | **View Alert** | Opens the alert in SRE Agent. |
| Alert message | **Acknowledge** | Acknowledges the alert as you. The message updates in place. |
| Alert message | **Improve this alert** | Replies in the thread with a proposal to improve the alert rule, or says why it cannot make one. |
| Alert message | **Related alerts** | Replies in the thread with correlated alerts. |
| Alert message | **Auto-remediate** | Asks for a fix pull request for the alert. |
| Alert message | **View Investigation**, **Generate report** | Shown once an investigation exists. |
| Investigation result | **View Full Investigation** | Opens the investigation. |
| Investigation result | **Acknowledge Alert**, **Resolve Alert** | Act on the alert from the thread. |
| Investigation result | **Create Ticket** | Opens a board card drafted from the alert's recent investigations. |
| Any message | **Create board ticket** (message menu) | Opens a card whose description is the message. |
| Alert message | :eyes: reaction | Acknowledges the alert, as the person who reacted. |
| Alert message | :rotating\_light: reaction | Starts an investigation. |

Acknowledge, resolve, investigate and the reactions need a linked account with the same role the web page needs. A reaction on any other message does nothing.

## What happens in the thread

A resolved alert gets an "Alert Resolved" reply, and a quiet re-fire adds one reply that is edited in place (see [Triage alerts](/guides/respond/alerts)). When a board card raised for an alert changes column, one line says so in the thread, and replies in the thread become comments on that card.

To change a fix request, mention the bot under its outcome with what you want changed. Organization admins confirm with a button, and the open pull request is superseded. Nothing is merged automatically.

## Related

* [Run and read an investigation](/guides/respond/investigations): what an investigation posts to the thread.
* [Track work on the ops board](/guides/respond/ops-board): what a card from Slack becomes.
* [Request a fix as a pull request](/guides/fix/fix-requests): how `/sre-fix` works.
* [Set up on-call](/guides/respond/on-call): mention the person on call in a thread.


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