---
title: "Alert rules"
description: "Describe in plain words what should trigger an alert, and get a push notification or email when Guardian sees or hears it."
url: https://vigiora.com/docs/ai/alert-rules
updated: 2026-12-03T22:23:48.000Z
---

# Alert rules

> Describe in plain words what should trigger an alert, and get a push notification or email when Guardian sees or hears it.

Alert rules tell Guardian when to notify you. You write each rule in plain language, such as *"Alert if a package is left unattended at the door"*. Guardian checks your rules every time it describes the scene.

![The Alerts tab on the Guardian page listing alert rules for several cameras](https://vigiora.com/docs/img/ai/alert-rules-1-all-rules.png)

*Guardian → Alerts shows the rules on every camera.*

## What you need

- **AI for this camera (Core AI)** and **Motion Detection** on the camera. Alert rules are included with Core AI, also on the 2 AI cameras that are free during the promotion.
- For audio rules, also **Voice detection (STT)** (the Voice detection add-on).

See [How AI works](https://vigiora.com/docs/ai/how-ai-works).

## Create a rule

1. **Open the camera's alert rules**

   Open the camera, click its **AI Guardian** tab, then **Alerts**.

2. **Start a new rule**

   Click **New rule**.

3. **Name it**

   Type a short **Name**, for example *package at door*.

4. **Describe the situation**

   In **Video rule**, describe what the camera should see. In **Audio rule**, describe what should be heard. You can fill in one or both.

5. **Choose severity and notifications**

   Pick a **Severity**. Tick **Send email notification** and add recipients if you want an email too.

6. **Create it**

   Click **Create rule**.

![A camera's AI Guardian tab on Alerts, with two rules and their severity, cooldown and enabled settings](https://vigiora.com/docs/img/ai/alert-rules-2-camera-rules.png)

*You can change a rule in place. Changes save automatically.*

From Vigiora Server 1.14.0, you can also ask the assistant to set up an alert by naming a place, such as "the street", and it proposes which cameras to use. See [Name a place, not a camera](https://vigiora.com/docs/ai/guardian-chat#name-a-place-not-a-camera).

## Rule options

| Option | What it does | Default |
| --- | --- | --- |
| Name | Shown in the alert and on the Alerts page. |  |
| Video rule | When to alert, based on what the camera sees. Example: "Alert if a package is left unattended at the door". |  |
| Audio rule | When to alert, based on what is heard. Example: "Alert if someone shouts for help or a glass breaks". |  |
| Severity | low waits 30 minutes before the rule can fire again, normal waits 10 minutes, high never waits. | normal |
| Custom cooldown (s) | Overrides the severity cooldown with your own number of seconds. |  |
| Only alert when the object detector also sees a person | From version 1.6.11, for rules about people on a camera with a person detector. See below. | On |
| check the minutes before | From version 1.17.2, beta. Shown only while an admin has turned on Second look (beta). Whether a match is checked against the two minutes of recording before it, before the alert goes out: Auto, Always or Never. See The second look (beta) below. In the New rule dialog it is under Advanced, as Check the minutes before alerting. | Auto |
| Send email notification | Also emails the alert to the recipients you list, separated by commas. | Off |
| enabled | Turn a rule off without deleting it. | On |

> **Video and audio together**
>
> When a rule has both a video rule and an audio rule, both must match for the alert to fire.

Each rule also shows **last fired**, so you can see whether it is working.

## Only alert when the object detector also sees a person

From version 1.6.11, a rule about people can wait for a second opinion. When a camera also runs an object detector that can see people, such as [object recognition](https://vigiora.com/docs/ai/hal-services#object-recognition-any-object), and the detector watched the whole clip and saw nobody, the rule doesn't alert. Moving shadows, sunlight and swaying plants then no longer send you alerts about people.

- **Which rules.** A rule counts as about people when its name or video rule mentions a person: *person*, *someone*, *man*, *woman*, *child*, *intruder*, *visitor* and similar words. *"A car arrives, ignore people"* doesn't count.
- **Where you see it.** The checkbox shows on such a rule, in the rule list and in the **New rule** dialog, only when the camera has a person detector. It is on by default.
- **What happens instead.** The Guardian entry is kept, with the AI's description, and shows **Not alerted: the object detector saw no person** with the rule's name. No push notification, email or alert is sent, and the rule's **last fired** doesn't change.
- **When it doesn't apply.** Without a person detector, or when the detector wasn't running during the clip (stopped, or its camera stream was reconnecting), the rule alerts as before.
- **Presence.** An object recognition service that reports who is in view (every 10 seconds, even for someone standing still) gives the best answer. With an older service, a person the detector reported shortly before the clip (within its **Repeat after** time, 2 minutes by default) still counts, so that a real person isn't missed.

Untick it on a rule when you want every match to alert, for example when people at the back of a large room are too small for the detector to see.

## The second look (beta)

> **Beta, off by default**
>
> The second look is a beta. In our own tests on staged footage it still gets some cases wrong: it can clear a real event, and it can confirm an innocent one, such as staff restocking. It is offered for people who want to try it and compare, not as something to rely on. While it is off, no second look runs. One thing is new for everyone from 1.17.2: when the AI's own first answer says it is not certain that the rule matched, you get a **To review** notice one severity lower, with no siren, sound, device action or automation, instead of a full alert.

From version 1.17.2, Vigiora can look again at the two minutes of recording before the moment that matched, and check them against the rule's own text, before an alert goes out. One check of a few seconds of video cannot judge a rule such as *"someone puts an item in a bag instead of taking it to the counter"*, because the counter visit happened before. The second look can try.

### Turn it on

An admin turns it on with the **Second look (beta)** switch at the top of the Guardian alert rules, under the heading and above the list of rules: **Assistant** → **Alert rules**, or the alert rules of a camera. Only admins see the switch. It is off by default, for the whole server.

While it is off:

- no rule is checked, whatever its setting: a match the AI is certain of alerts as before, and a match its first answer says it is not certain of arrives as a **To review** notice (an answer that does not say counts as certain);
- the per-rule choice **check the minutes before** (and **Check the minutes before alerting** under **Advanced** in the **New rule** dialog) is not shown;
- **Test on a past alert** is not shown, no new match is cleared, and the **Cleared by the second look** list gets no new entries. Its choice in **Recordings** is shown only while the beta is on, or when there are matches it cleared earlier.

### What it does

When it is on and a rule is checked, there are three outcomes:

| Outcome | What happens |
| --- | --- |
| **Confirmed** | The alert goes out as usual, and its text says what happened before. |
| **Not sure** | You get a **To review** notice instead of an alert. It starts with **To review:**, has one severity level lower than the rule, and never sounds a siren, plays a sound, runs a device action or starts an automation. |
| **Cleared** | No alert. The match is cleared only when the rule's own exception, for example *"instead of taking it to the counter"*, is actually seen in the earlier footage. The Guardian history keeps the entry with **Matched, then cleared** and the reason. |

When the second look cannot tell, the match is **To review**. Any error, such as no recording to look at, a failed check, a check that takes longer than 30 seconds, or an AI allowance that is used up, never clears an alert: the match arrives as **To review**.

### Choose which rules are checked

With the switch on, each rule has a setting named **check the minutes before** next to its cooldown. In the **New rule** dialog it is under **Advanced**, as **Check the minutes before alerting**.

| Option | What it does | Default |
| --- | --- | --- |
| Auto | Checks only rules with severity high, and rules that play a siren or a sound or run a device action. | On |
| Always | Checks every match of this rule. |  |
| Never | Does not check. A match the AI was not certain of is still sent as a To review notice. |  |

Under the video rule, a line tells you whether the rule is checked: when it is, a condition about what happened earlier, such as *"instead of taking it to the counter"*, can be judged; when it is not, the AI sees only those few seconds.

### Limits

- **It can be wrong, in both directions.** It can clear a real event, and it can confirm an innocent one. A cleared match raises no alert, so a real event it explained away does not reach you. What the AI says is a prompt to look, not proof. Keep important cameras on recording and look at what Guardian shows.
- **Look at what it cleared.** In **Recordings** → **Events**, under **Show**, choose **Cleared by the second look** to list the matches that did not alert, each with the AI's reason and a link to the recording, and check that nothing real was dropped. This choice is shown only while the beta is on, or when there are matches it cleared earlier. These are not alerts: they are never pushed and run nothing.
- **Test it on a past alert.** An admin can open **Test on a past alert** in a rule, pick one of the rule's recent alerts and press **Test** to see what the second look would decide. Nothing is raised or sent. A test uses your AI allowance like a real check.
- **It costs a little.** It uses a stronger AI model for the check: a fraction of a cent for each alert it checks, at most one check per analysed clip. It is counted against your AI allowance like an analysis. See [AI usage](https://vigiora.com/docs/account/ai-usage).

### Who changed a rule

From version 1.17.2, every change to an alert rule is recorded in the server's audit log: who made it (a person, an API key or the assistant), when, and the old and new video rule text. It covers rules edited in the web app, through API v1, in a room's rules, and by the assistant in chat.

## How alerts reach you

When a rule matches:

1. An alert named `guardian:<rule name>` appears on the **Alerts** page, with a snapshot and the scene description.
2. A push notification goes to every browser and phone that turned notifications on.
3. If the rule sends email, the recipients get an email.

![The AI Alerts page filtered to Guardian alerts, grouped by day](https://vigiora.com/docs/img/ai/alert-rules-3-alerts-page.png)

*Use the Guardian filter on the Alerts page to see only rule alerts.*

### Turn on push notifications

1. **Open Alerts**

   Open **Recordings** and turn on **Needs attention**.

2. **Enable notifications**

   Click **Notifications** and allow notifications when your browser asks.

Do this on every browser or phone that should get alerts. Vigiora may also show an **Enable Notifications** prompt the first time you sign in.

### Email needs an outgoing mail server

Your server sends email through an SMTP server you configure. Push notifications work without any setup, but email doesn't. On a self-hosted server, an admin fills in these values in the server's settings file (`/etc/vigiora.env` on Linux, where the installer leaves them commented out) and restarts the server with `sudo systemctl restart vigiora`:

| Setting | What it is | Default |
| --- | --- | --- |
| `SMTP_HOST` | Your mail server's host name | — |
| `SMTP_PORT` | Its port | `587` |
| `SMTP_USER` | Sign-in user | — |
| `SMTP_PASS` | Sign-in password | — |
| `SMTP_FROM` | The sender address, e.g. `alerts@example.com` | — |

## Timing

- Guardian describes each camera at most once every 5 minutes, after motion. A rule can fire only when a description is made.
- Alert rules are not instant triggers. For instant detection of people or vehicles, use a detection service with **Alert on detections** (below).

## Alerts from detection services

Detection services connected to your server, such as people, face, weapon or licence-plate detectors, have their own alert switches. In the camera's **AI Guardian** tab, expand the service and use **Alert on detections** to choose which labels alert you (for example *person*, *vehicle* or *knife*) and at which severity. Admins and operators of the camera can change these.

From Server 1.7.4, a [community add-on](https://vigiora.com/docs/ai/hal-services#community-add-ons) that was given the permission to raise alerts can report a detection under its own label prefix, on the cameras you assign to it. Its labels appear in the same **Alert on detections** list, and you switch them on as for any other. The alert says which add-on raised it. A label that can never alert, because the add-on cannot raise alerts, shows as **results only** with no switch: the add-on still reports it as a result on the camera.

## Edit or delete a rule

- To change a rule, edit its fields in the list. It saves automatically. From version 1.17.2, each change is recorded: see [Who changed a rule](#who-changed-a-rule).
- To delete a rule, click **Delete rule** and confirm.
- To see the rules on every camera at once, open **Assistant** → **Alert rules** (also under **Settings** → **AI and add-ons** → **Assistant alert rules**).

---

Source: https://vigiora.com/docs/ai/alert-rules · Last updated 3 Dec 2026, 22:23 UTC
