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

# AI Incident Investigator

> Get AI-powered root cause analysis for incidents with one click.

## Overview

When an incident fires, click **Investigate** to get a root-cause analysis with concrete remediation steps — generated from live evidence collected directly from your cluster.

<Note>
  The investigator is **advisory only** — it never mutates your cluster. It reads logs, events, and state to surface what likely went wrong and what to do about it.
</Note>

## What the investigator returns

<CardGroup cols={2}>
  <Card title="Root cause" icon="magnifying-glass">
    A concise diagnosis of what likely caused the incident.
  </Card>

  <Card title="Confidence" icon="chart-bar">
    High / medium / low — how certain the model is about the analysis.
  </Card>

  <Card title="Suggested fix" icon="wrench">
    Concrete remediation steps (e.g. "increase memory limit from 128Mi to 512Mi").
  </Card>

  <Card title="Recommended actions" icon="list-check">
    Additional steps to prevent recurrence (e.g. "add a liveness probe").
  </Card>
</CardGroup>

## Evidence gathered

The investigator collects evidence at the time of the investigation:

<AccordionGroup>
  <Accordion title="Cluster state" icon="server">
    * Affected pod's current phase, restart count, and conditions
    * Node status and resource usage
    * Recent Kubernetes Warning events for the affected workload
  </Accordion>

  <Accordion title="Pod logs" icon="terminal">
    * Current container logs (recent output)
    * **Previous container logs** — the logs from before the last crash

    Previous logs are often the most valuable signal — they capture exactly what the container output before it exited.
  </Accordion>

  <Accordion title="Deployment context" icon="rocket">
    * The manifests that were applied (for Niro-managed deployments)
    * Recent apply history and status
  </Accordion>
</AccordionGroup>

## Running an investigation

### Manual

<Steps>
  <Step title="Open the incident">
    Go to **Alerts** → click the incident you want to investigate.
  </Step>

  <Step title="Click Investigate">
    Click the **Investigate** button in the incident detail panel.
  </Step>

  <Step title="Review the analysis">
    The investigation completes in 10–30 seconds. Results are stored — you can re-run at any time to refresh with current evidence.
  </Step>
</Steps>

### Automatic

Niro can trigger investigations automatically when incidents change state. Configure in **Settings** → **Auto-investigation**:

| Mode       | When investigation runs   |
| ---------- | ------------------------- |
| `off`      | Never run automatically   |
| `firing`   | When an incident opens    |
| `resolved` | When an incident resolves |
| `both`     | On both open and close    |

<Tip>
  `firing` mode is the most useful — you get root-cause analysis the moment something breaks, before you've opened the dashboard.
</Tip>

Auto-investigations are best-effort. If the AI provider is unavailable, the auto-investigation is skipped (not retried). Manual investigation is always available.

## Availability

Available on <Badge>Pro</Badge> and above. The **Investigate** button is visible on Free but disabled with an upgrade prompt.

## Limitations

<Warning>
  The analysis is probabilistic, not authoritative. **Low-confidence** findings should be treated as suggestions. Always verify before acting on a suggested fix.
</Warning>

* If logs have been rotated or the pod deleted before investigation, evidence may be incomplete
* Long log tails are truncated to fit the model's context window — most recent logs are always prioritized
* Auto-investigations are best-effort: failures are logged but never affect the incident itself

## Related

<CardGroup cols={2}>
  <Card title="Alerts & Incidents" icon="bell" href="/features/alerts">
    Incident detection, lifecycle, and notification channels.
  </Card>

  <Card title="Stream Pod Logs" icon="terminal" href="/guides/pod-logs">
    View live logs directly in the dashboard.
  </Card>

  <Card title="Plans" icon="credit-card" href="/reference/plans">
    AI investigation availability by plan.
  </Card>

  <Card title="Auto-investigation" icon="brain" href="/features/alerts#auto-investigation">
    Trigger investigations automatically when incidents fire.
  </Card>
</CardGroup>
