# Creating Rules

### 1. Rule Type

At the top of the rule creation page, you choose the **rule type**:

* **Blacklist** → Block access if the visitor matches conditions.
* **Redirect** → Redirect the visitor to another URL if conditions match.
* **Whitelist** → Always allow access if conditions match.

<figure><img src="/files/woVbYdR2ATbWCKjx6zkP" alt=""><figcaption></figcaption></figure>

👉 Only one type can be selected per rule.

***

### 2. Basic Information

* **Rule name** *(required)* → Enter a clear, descriptive name (e.g., *Block US VPN traffic*).
* **Description** *(optional)* → Add a note to explain what this rule is for, useful for teams.

<figure><img src="/files/hzQVeVlhnEJGGMTI7Yz0" alt=""><figcaption></figcaption></figure>

***

### 3. Conditions

Conditions define **who the rule applies to**. You can add one or more.

* **Logic**: Choose between **AND** or **OR**:
  * **AND** → all conditions must match.
  * **OR** → only one condition needs to match.

#### Available Conditions

* **IP/CIDR** → Block or allow a single IP or an IP range (CIDR).
* **Country** → Apply rule by country.
* **Region** → Apply rule by state/province/region.
* **ISP (Internet Provider)** → Target visitors based on their ISP.
* **User Agent** → Match specific browser/device user agents.
* **Referral URL** → Block or allow traffic coming from a specific referral site.

<figure><img src="/files/TCI3R0Uxj7diqvF3AIwm" alt=""><figcaption></figcaption></figure>

👉 You can add multiple conditions by clicking **“Add Another Condition”**.

***

### 4. Scope

Define **where** the rule applies:

* **Global** → Applies to all pages across the entire website.
* **URL-specific** → Applies only to the specified page(s). Example: `/collections/automated-collection`.

<figure><img src="/files/hH3ubiHPLZ6Z93qqvVYz" alt=""><figcaption></figcaption></figure>

If you have any questions, feel free to contact us via **Crisp Chat** or email us at [support@mida-app.io](mailto:support@mida-app.io?subject=%5BMIDA%20Support%5D%20Question%20about%20Fraud%20Score\&body=Hi%20MIDA%20Team%2C%0A%0AI%20have%20a%20question%20about%20the%20Fraud%20Score%20feature.%20Please%20assist%20me%20with%20the%20following%3A%0A%0A-%20Shop%20URL%3A%20%0A-%20Issue%20details%3A%20%0A%0AThank%20you!%0A%0A%2D%20Your%20Name).


---

# 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://docs.mida-app.io/mida-fraud-filter-ip-blocker/rules-management/creating-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.
