> ## Documentation Index
> Fetch the complete documentation index at: https://docs.lerian.studio/llms.txt
> Use this file to discover all available pages before exploring further.

# Managing Rules

> Create fraud detection rules with CEL expressions that allow, deny, or flag transactions for review based on your business policies.

Use the **Rules** page in the Tracer module to create and manage fraud detection rules. Each rule contains a CEL expression that is evaluated against transaction data to determine if the transaction should be allowed, denied, or flagged for review.

## Accessing the Rules page

***

Select **Rules** in the left sidebar to open the **Fraud Detection Rules** page. Expand the **What is a Rule?** panel at the top for a quick refresher on how rules evaluate transactions.

## Filtering rules

***

Use the filter bar at the top of the list to narrow results:

| Filter               | Options                                           |
| -------------------- | ------------------------------------------------- |
| **Search**           | Search by name                                    |
| **Status**           | All, Active, Inactive, Draft                      |
| **Decision**         | All, Allow, Deny, Review                          |
| **Transaction Type** | All Types, Card, PIX, Wire, Crypto, ACH, Internal |

A page-size selector alongside the filters controls how many items are loaded per page.

## Rule cards

***

Rules are displayed as a grid of cards. Each card shows:

* The rule **name**.
* A **status** badge (Active, Inactive, or Draft).
* An **action** badge indicating the configured decision (Allow, Deny, or Review).
* The **description**, if one was provided.
* The **CEL expression** in a code block.
* The **last updated** date.

### Rule statuses

| Status       | Description                                               |
| ------------ | --------------------------------------------------------- |
| **Active**   | The rule is being evaluated against incoming transactions |
| **Inactive** | The rule exists but is not currently being evaluated      |
| **Draft**    | The rule is being configured and is not yet active        |

## Rule actions

***

Use the actions menu on each card to perform the following operations:

| Action            | Description                                                                                                                  |
| ----------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| **Details**       | Open the rule detail sheet. The sheet is editable only when the rule is in Draft status                                      |
| **Delete**        | Permanently delete the rule (requires confirmation)                                                                          |
| **Activate**      | Move the rule to active status                                                                                               |
| **Deactivate**    | Move the rule to inactive status                                                                                             |
| **Move to Draft** | Return the rule to draft status for editing. Only available when the rule is **Inactive** — deactivate an active rule first. |

<Warning>
  Deleting a rule is permanent and cannot be undone. The confirmation dialog reads: "You are about to permanently delete this rule. This action cannot be undone. Do you wish to continue?"
</Warning>

## Creating a new rule

***

<Steps>
  <Step>
    Click the **New Rule** button on the Rules page.
  </Step>

  <Step>
    Fill in the rule fields in the **Create Rule** sheet:

    | Field           | Required | Description                                                                                                                                                                                     |
    | --------------- | -------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
    | **Name**        | Yes      | A descriptive name for the rule (e.g., "High Value Block")                                                                                                                                      |
    | **Description** | No       | A text description of the rule's purpose                                                                                                                                                        |
    | **Expression**  | Yes      | A CEL expression that defines the rule logic (e.g., `amount > 1000000`). The editor provides real-time validation with green "Valid expression" feedback or red error messages with suggestions |
    | **Action**      | No       | The decision when the rule matches: Allow, Deny (default), or Review                                                                                                                            |
    | **Scopes**      | No       | Optional scope restrictions (see [Scope builder](#scope-builder) below)                                                                                                                         |
  </Step>

  <Step>
    Click **Create** to save the new rule.
  </Step>
</Steps>

The rule is created in **Draft** status. You must activate it before it starts evaluating transactions.

## Editing a rule

***

<Steps>
  <Step>
    Locate the rule card and select **Details** from the actions menu.
  </Step>

  <Step>
    Update the fields in the **Edit Rule** sheet.
  </Step>

  <Step>
    Click **Save** to apply your changes.
  </Step>
</Steps>

Selecting **Details** opens the rule sheet. To make changes, the rule must be in **Draft** status — use **Move to Draft** first.

## Scope builder

***

In the console, this section is labeled **Scope** and each entry is called a **condition**. The scope builder lets you restrict a rule to specific accounts, merchants, segments, or transaction types. You can add multiple conditions to a single rule.

| Scope                | Input type      | Validation                             |
| -------------------- | --------------- | -------------------------------------- |
| **Account**          | UUID text input | Must be a valid UUID                   |
| **Merchant**         | UUID text input | Must be a valid UUID                   |
| **Segment**          | UUID text input | Must be a valid UUID                   |
| **Portfolio**        | UUID text input | Must be a valid UUID                   |
| **Transaction Type** | Select dropdown | Card, PIX, Wire, Crypto, ACH, Internal |
| **Sub Type**         | Free text input | Maximum 50 characters                  |

To add a condition, click **Add Condition**, select the scope type, and enter the value. Remove a condition by clicking the remove button next to it.

## Related

***

* [Rule engine](/en/tracer/rule-engine) — How rules evaluate transactions
* [What is Tracer](/en/tracer/what-is-tracer) — Conceptual overview
* [Create rule](/en/reference/tracer/create-rule) — API reference
* [Update rule](/en/reference/tracer/update-rule) — API reference
