> For the complete documentation index, see [llms.txt](https://docs.autopilotmonitor.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.autopilotmonitor.com/rules/overview.md). Agents can also search and read this documentation through its [MCP server](https://docs.autopilotmonitor.com/~gitbook/mcp).

# How Rules Work Together

The three rule families — IME Log Patterns, Gather Rules and Analyze Rules — how they interlock into one detection pipeline, and which rule type you need when.

Rules are what turn Autopilot Monitor from a log viewer into an analysis engine. There are three rule families, each answering a different question:

| Family                                                                              | Question it answers                                        | Runs                  | Managed on            |
| ----------------------------------------------------------------------------------- | ---------------------------------------------------------- | --------------------- | --------------------- |
| [**IME Log Patterns**](https://docs.autopilotmonitor.com/rules/ime-log-patterns.md) | *How do we turn raw IME log lines into structured events?* | On the device (agent) | IME Log Patterns page |
| [**Gather Rules**](https://docs.autopilotmonitor.com/rules/gather-rules.md)         | *What extra evidence should the agent collect?*            | On the device (agent) | Gather Rules page     |
| [**Analyze Rules**](https://docs.autopilotmonitor.com/rules/analyze-rules.md)       | *What do all these events mean — is something wrong?*      | In the backend        | Analyze Rules page    |

## The pipeline

```mermaid
flowchart LR
    subgraph Device
        IME[IME log file] -->|regex + capture groups| P[IME Log Patterns]
        SYS[Registry, WMI, files,<br/>event logs, commands] -->|collectors| G[Gather Rules]
        A[Agent built-in signals<br/>ESP, Hello, perf, security]
    end
    P --> EV[(Structured events<br/>session timeline)]
    G --> EV
    A --> EV
    subgraph Backend
        EV --> AR[Analyze Rules<br/>conditions + confidence]
        AR --> F[Findings<br/>severity, explanation,<br/>remediation]
    end
    F --> UI[Session detail<br/>rule cards]
```

1. **Events come first.** Most timeline events come from the agent's built-in signals and from **IME Log Patterns**, which parse the Intune Management Extension log in real time — app downloads, installs, ESP phases, errors. If the built-in events don't cover something specific to your environment, **Gather Rules** collect it: a registry value your imaging process writes, a vendor log file, a WMI query, an allow-listed command.
2. **Analyze Rules read the events.** After events arrive, the backend evaluates every enabled analyze rule against the session's full event stream. A rule that matches produces a **finding**: a card on the session with severity, a confidence score, an explanation of what was detected, and concrete remediation steps.
3. **Findings drive everything downstream** — the session's analysis summary, severity statistics, fleet-level rule telemetry, and (if configured on the rule) even marking the whole session as failed.

## Which rule type do I need?

* *"The timeline is missing information that exists somewhere on the device"* → a **Gather Rule** to collect it.
* *"I want to be alerted automatically when condition X is true in a session"* → an **Analyze Rule**.
* *"Both — I need custom data **and** an automatic verdict on it"* → a Gather Rule feeding an Analyze Rule. This combination is the most powerful pattern in the product; see [Cookbook recipe 7](https://docs.autopilotmonitor.com/rules/analyze-rules/cookbook.md#recipe-7-collect-your-own-data-and-grade-it-end-to-end).
* *"A known IME log line isn't being recognized anymore"* → an **IME Log Pattern** fix (these are community-maintained; see [contributing](https://docs.autopilotmonitor.com/rules/ime-log-patterns.md#contributing-patterns)).

## Built-in, community, template, custom

All three families ship with maintained built-in rules, so you get full value with zero configuration. On top of that:

* **Community** rules were submitted by other organizations from their portal and accepted after review — same quality bar as built-ins, shown with a *Community* badge. You can [contribute your own](https://docs.autopilotmonitor.com/rules/contribute-a-rule.md).
* **Template** rules ship as configurable blueprints (e.g. an allow-list you fill in). Enabling one creates your own editable copy. See [Template Rules](https://docs.autopilotmonitor.com/rules/analyze-rules/template-rules.md).
* **Custom** rules are yours alone — created in the portal, scoped to your tenant. The [Cookbook](https://docs.autopilotmonitor.com/rules/analyze-rules/cookbook.md) walks you through building them.


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.autopilotmonitor.com/rules/overview.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
