# Auto-label potential leads with AI

**Auto-label potential leads with AI** is a Missive rule template designed for those who are looking to track new incoming leads and potentially use Missive as a lightweight CRM.

#### When enabled:

* The rule allows you to automatically add a label to any incoming emails from new leads.

#### Here’s how it works:

* You need to include your inbound sales email address.
* You need to add your existing leads and customers to your contact book.
* You need an [**AI integration**](/docs/ai/setup.md) (OpenAI, Anthropic, or Gemini).
* You need to select **Prompt Result = yes**.
* You need a [prompt](/docs/ai/using-ai/prompts.md) that captures the emails that indicate possible new business.
* You need to create a **potential leads** label.

***

### Incoming email rule: Auto-label potential leads with AI

This rule is meant to help you identify and label potential new business, without any additional manual steps or another piece of software.

<a href="https://mail.missiveapp.com/?importRule=auto-label-emails-from-new-potential-sellers_incoming-message" class="button primary" data-icon="plus">Add to Missive</a>

#### There are four conditions and one action to make this rule work:

{% stepper %}
{% step %}
**These 4 conditions must match:**

Each time an email is sent to your sales@ team, the sender’s email address **is not in your contact book**, the **number of messages in the thread is less than 2**, and it matches your prompt
{% endstep %}

{% step %}
**The AI prompt template:**

You can test and edit as needed, originally designed for a real estate firm:

> Analyze the email content and determine whether the sender is a potential real estate seller (e.g., expressing intent to sell a property, asking about listing, valuation, or selling options). If yes, respond only with 'Yes'

{% hint style="info" %}
As always with AI-powered rules, [test a few emails](https://missiveapp.com/docs/advanced-features/rules/ai-rules#debugging-ai-rules) to ensure you’re happy with the accuracy of the results. If not, keep tweaking and making the prompt more specific.
{% endhint %}
{% endstep %}

{% step %}
**Action: Add label(s)**

When all conditions match, this rule will automatically add a potential leads label.
{% endstep %}
{% endstepper %}

<div data-with-frame="true"><figure><img src="/files/0tcPB7qSd2DaD8zMIDD1" alt=""><figcaption></figcaption></figure></div>

<table><thead><tr><th width="220.484375">Component</th><th>Value</th></tr></thead><tbody><tr><td>Condition 1</td><td><strong>To is</strong> → {...}</td></tr><tr><td>Condition 2</td><td><strong>From</strong> → Not in contacts</td></tr><tr><td>Condition 3</td><td><strong>Number of messages in conversation</strong> → is lower than 2</td></tr><tr><td>Condition 4</td><td><strong>Prompt result is</strong> → Yes</td></tr><tr><td>Action 1</td><td><strong>Assign user(s)</strong> → {...}</td></tr></tbody></table>


---

# Agent Instructions: 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/templates/auto-label-potential-leads-with-ai.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.
