> ## Documentation Index
> Fetch the complete documentation index at: https://qovery-docs-new-messaging-and-agent-tasks.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Incident Analyser

> Ready-made Agent Task that correlates a firing incident with recent changes, logs, and metrics

<Warning>
  **Alpha.** Agent Tasks is in early development and not yet generally available. Capabilities and setup will change before release.
</Warning>

## Overview

Correlate a firing incident with recent changes, logs and metrics, then report and open a PR. When an incident fires, the agent investigates it and hands a clear summary back to the human on-call, it never merges a fix on its own.

## How It Works

When an incident fires, the agent:

1. Reads the incident details (id, title, severity, affected services) from the trigger, fetching any missing details from your incident management tool.
2. Correlates the incident with recent change context: the latest deployments, config changes, and merged PRs for the affected services around the incident start time.
3. Pulls the relevant signals: application logs, metrics, and any runbooks for the affected services.
4. Determines the most likely root cause and the blast radius, and is explicit about its confidence and what it could not verify.
5. Reports its findings to the on-call human in chat: a short summary, the suspected root cause, and a recommended next step.
6. If the fix is small and well-understood, opens a PR with the proposed change and links it in the message. It never merges, the human always stays the gate.

## Setting It Up

* **Credentials**: add your incident management tool's API key and a chat webhook URL (a [Slack Incoming Webhook](https://api.slack.com/messaging/webhooks), for example) as secrets, then reference them by name in the agent's instructions.
* **Domain allowlist**: add the hostnames the agent needs to reach, your incident management tool's API and your chat webhook's domain.
* **Resources**: this agent mainly makes API calls and reads logs and metrics, a small allocation is enough to start. See [Configuration](/configuration/agent-tasks/overview#configuration) for how resources are set.

## Triggering It from incident.io

The template is meant to be triggered by incident.io itself:

<Steps>
  <Step title="Create a Workflow in incident.io">
    In incident.io, go to **Workflows** and create a new one.
  </Step>

  <Step title="Set the trigger">
    Set the trigger to **Incident created**, or **Incident updated** filtered to severity changes.
  </Step>

  <Step title="Add a Send a webhook step">
    Point it to this agent task's webhook URL (shown on its overview page). incident.io includes the incident payload, id, title, severity, and affected services, in that request, which is what the agent reads in step 1 above.
  </Step>
</Steps>

See [Automations](/configuration/agent-tasks/overview#automations) for how triggers and outputs work in general.
