> For the complete documentation index, see [llms.txt](https://wiki.lucysecurity.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://wiki.lucysecurity.com/application-reference/settings/submitted-email-settings/custom-rules-and-score-factors.md).

# Custom Rules & Score Factors

{% hint style="info" %}
Navigate to **Settings > Submitted Email Settings > Custom Rules**
{% endhint %}

### Custom Rules

Custom Rules enable the creation and storage of regular expressions (regex) to search through the bodies of reported emails. When an email matches a rule, it is assigned a predefined number of points.

**How It Works**

1. **Define Regex Patterns**: Create regex patterns that identify specific text within email bodies.
2. **Set Points**: Assign a point value to each regex pattern.
3. **Scan Emails**: LUCY scans reported emails for text matching the stored regex patterns.
4. **Assign Points**: Emails that match a regex pattern are assigned the corresponding points.

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2Fqy3ETpjuWTfsxrMSNMwX%2Fimage.png?alt=media&amp;token=31d277a3-f5b2-4e9a-8374-887ce950c8e3" alt=""><figcaption><p>You can use an online tool like <a href="https://regexr.com/">https://regexr.com/</a> to help you build regular expressions.</p></figcaption></figure>

***

### Score Factors

{% hint style="info" %}
Navigate to **Settings > Submitted Email Settings > Score Factors**
{% endhint %}

These score factors are a multiplier that applies to each type of score. You can apply more or less weight to each type in order to fine-tune your results based on your organization's specific needs.

<figure><img src="https://3536856424-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FVYPsDfg76rUuy4DWfSsJ%2Fuploads%2FKFXhq58NACiTtRUa36Gj%2Fimage.png?alt=media&amp;token=0ed4c61f-658d-4c01-b958-4c29cd6999b5" alt=""><figcaption><p>A value of 1 is neutral because the score will be multiplied by 1.</p></figcaption></figure>


---

# 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://wiki.lucysecurity.com/application-reference/settings/submitted-email-settings/custom-rules-and-score-factors.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.
