> For the complete documentation index, see [llms.txt](https://missiveapp.com/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://missiveapp.com/docs/advanced-features/rules/ai-rules.md).

# AI Rules

AI rules let you analyze message content beyond simple keywords. Instead of matching text patterns, AI can understand what a message is actually about.

{% hint style="info" %}
AI Rules require the **Productive** or **Business** plan, plus an [AI integration](/docs/ai/setup.md) (OpenAI, Anthropic Claude, or Google Gemini).
{% endhint %}

## How AI rules work

1. Create a rule with a **Prompt** condition
2. Write a simple instruction for the AI
3. The AI reads the message and responds
4. Your rule acts based on that response

## Standard rules vs AI rules

**Standard rules** match patterns:

* Sender contains a domain
* Subject includes keywords
* Message was sent to a specific address

**AI rules** understand meaning:

* Detect sentiment (urgent, angry, positive)
* Identify request types (refund, support, sales)
* Extract information (deadlines, action items)
* Understand context that keywords can't capture

Combine both: use standard conditions to filter first, then apply AI only to relevant messages. This keeps costs down.

## Setup

1. Go to **Settings** > **Integrations** > **Add integration** > choose your AI provider (OpenAI, Anthropic, or Gemini)
2. Connect your account and enter your API key
3. Create rules with AI conditions or actions

{% hint style="info" %}
AI costs are billed to your provider account based on usage. Missive doesn't charge extra for AI features. See [Setting up AI](/docs/ai/setup.md) for detailed setup instructions.
{% endhint %}

## Model selection

When creating AI conditions or actions, you can pick a model from any AI integration shared with you. The available models come from the integration itself, so the list updates as providers add or retire models. See [Setting up AI](/docs/ai/setup.md) for the models each provider exposes.

AI actions group models into two categories:

* **Fast (synchronous)** models run inline as the rule fires. They're less capable, but labels they apply can trigger other rules.
* **Powerful (asynchronous)** models run in the background and produce better results, but labels they apply won't trigger other rules.

If you need another rule to react to a label set by an AI action, pick a Fast model. **Prompt** conditions only support Fast models, since the rule has to wait on the response.

## Debugging AI rules

Enable **Log prompt result in conversations** to see what the AI returns for each message. This adds a conversation event showing the AI's response, which helps you:

* Verify your prompt produces the expected output
* Debug rules that aren't firing correctly
* Fine-tune prompt wording

Enable this option on each rule that uses the prompt you're debugging.

{% hint style="info" %}
**Log prompt result in conversations** is only available for the **Prompt** condition. It is not available for AI actions like **Add label(s) with AI**, **Add AI note**, or **Create draft with AI**.
{% endhint %}

## AI actions

| Action               | What it does                                                  |
| -------------------- | ------------------------------------------------------------- |
| Add AI note          | Posts an AI-generated summary or analysis to the conversation |
| Create draft with AI | Generates a reply draft you can review before sending         |
| Add tasks with AI    | Extracts action items and creates tasks                       |
| Add label(s) with AI | Categorizes the message and applies labels                    |

## Use cases

**Customer service**

* Escalate upset customers to senior agents
* Identify support request types
* Summarize complex issues

**Sales**

* Distinguish leads from general inquiries
* Categorize prospects by need
* Draft responses to common questions

**Legal**

* Detect deadlines and time-sensitive requests
* Extract important dates as tasks
* Identify specific legal issues

**General**

* Summarize long threads
* Translate messages
* Extract action items

## Privacy

* You connect your own AI provider account
* You control which messages get processed
* Content is sent to your provider only during rule processing
* Providers don't store data beyond the immediate request

For example prompts and configurations, see [AI Rules templates](/docs/advanced-features/rules/ai-rules/ai-rules-templates.md).


---

# 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:

```
GET https://missiveapp.com/docs/advanced-features/rules/ai-rules.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
