> For the complete documentation index, see [llms.txt](https://seekspeed.gitbook.io/seekspeed-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://seekspeed.gitbook.io/seekspeed-docs/regression-guard/alerts.md).

# Alerts: email & webhooks

When a scheduled tick breaches a threshold, Guard creates a row in `guard_alerts` and, if the schedule has notify targets configured, fans out to them.

## Delivery targets

| Channel     | Config field        | Payload                                                                                                            |
| ----------- | ------------------- | ------------------------------------------------------------------------------------------------------------------ |
| **In-app**  | always on           | Alert appears in the Guard feed with a badge count in the sidebar.                                                 |
| **Webhook** | `notify.webhookUrl` | `POST` with a JSON body (see below). Works with Slack incoming webhooks, Discord webhooks, and any generic ingest. |
| **Email**   | `notify.email`      | Sent via the auth provider's transactional mailer to the workspace owner. Batched per tick.                        |

## Webhook payload

```json
{
  "type": "seekspeed.guard.alert",
  "severity": "warn",
  "scheduleId": "sch_...",
  "scheduleName": "checkout-agent p95",
  "benchmarkSetId": "set_...",
  "baseline": {
    "p95Ms": 812, "meanMs": 640, "tokS": 42.1, "costUsd": 0.0021, "errorRate": 0
  },
  "observed": {
    "p95Ms": 1010, "meanMs": 780, "tokS": 34.6, "costUsd": 0.0024, "errorRate": 0
  },
  "breaches": [
    {
      "metric": "p95_ms",
      "op": "pct_increase",
      "threshold": 15,
      "delta": 198,
      "pctChange": 24.4,
      "pValue": 0.011,
      "severity": "warn"
    }
  ],
  "runUrl": "https://.../app/benchmarks/set_...",
  "at": "2025-11-14T09:15:00.000Z"
}
```

### Slack / Discord

Both accept incoming webhook URLs directly. Guard auto-formats a fallback `text` field so the message is readable even if you don't build a Block Kit / embed on top:

```
:rotating_light: [warn] checkout-agent p95
p95_ms +24.4% (812 → 1010ms, p=0.011)
```

## Ack lifecycle

Alerts start `acknowledged=false` and count toward the sidebar badge. Acknowledging is a manual action — Guard will *not* auto-ack on the next healthy tick, because "one green tick after a breach" is rarely the whole story. You can ack single alerts inline or use **Ack all** from the Guard header.

## Rate limiting

To keep Slack sane during a real incident, Guard collapses repeated breaches of the **same threshold on the same schedule** into one open alert until you ack it. Subsequent ticks update the `observed` snapshot on that row instead of creating new rows or firing new webhooks.

## Testing without waiting for a tick

The Guard UI has a **Run now** button on every schedule. It executes the same code path as `runDueGuards` but for that single schedule, so you can trigger a fake regression (e.g. temporarily lower the threshold) and confirm your webhook works before trusting it in production.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://seekspeed.gitbook.io/seekspeed-docs/regression-guard/alerts.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
