All Products
Search
Document Center

Fraud Detection:Create a default policy

Last Updated:Jun 20, 2026

This topic describes how to create a default policy.

Background

  • What a policy is: A policy is a set of orchestrated business logic. When the decision engine receives an event data request, it evaluates the request based on the policies you configure. If a policy is matched, the system returns the policy's results.

  • Use cases: You can configure a policy with complex conditional logic for rule-based decisions. For example, in a credit loan approval scenario, you may need to screen for known high-risk applicants. If an applicant's phone number, email address, or account ID is on a blocklist, the applicant is flagged as high-risk. You can implement this logic by using a policy.

Basic information

Note

You must create an event before configuring a policy. For more information, see Create an event.

  1. Go to the Policy Management page and click Create Policy.

  2. Configure the basic information for the policy.

  3. Select an Associated Event, and enter a Policy Name and Policy Description.

    Important

    Variables depend on the associated event. You cannot change the associated event after submitting the policy. This restriction prevents misconfigurations that could disable variables and affect policy evaluation.

Calculation logic

The calculation logic configuration page contains the following settings:

  • Condition Name: Optional. To make the policy logic easier to understand in the visualization preview, we recommend entering a descriptive name.

  • Left Variable: The left variable can be an event field, device variable, custom variable, system variable, or intermediate variable. For event fields, you can also select a function to perform calculations.

  • Operator: Select an operator to evaluate the left variable. The system provides a list of available operators based on the data type of the left variable. For example, if the left variable is of type string, numeric operators such as "greater than" or "less than" are unavailable.

  • Right Variable: After you select the left variable and operator, you can enter a constant or select another variable for the right variable.

Note
  1. Event fields support function calculations. For example, to convert an email address to lowercase, you can apply a function to the event field.

  2. To add more conditions, click Add Calculation Logic. You can also copy an existing condition to quickly create a similar one.

Logic preview

  1. Basic elements. You can build the calculation logic expression by combining condition numbers (for example, 1, 2, and 3) with logical operators and parentheses.

    • "|" represents logical OR.

    • "&" represents logical AND.

    • "!" represents the logical NOT operation.

    • Use "( )" to define precedence.

  2. Visualization preview. After you define the logic expression, click View Rules Tree to preview the structure in real time. The system automatically displays the name for each named condition and the number for each unnamed one.

    For example, if the first three conditions are named but the fourth is unnamed and uses a NOT operation, the interface shows the following:

    The calculation path is displayed as 1|2|3|!4, where condition numbers are separated by | and ! indicates a NOT operation. In the visualization preview, the first three named conditions are displayed as Mobile blocklist, Email blocklist, and Device blocklist. The fourth, unnamed condition shows only its number and a red error icon indicating that the node configuration is invalid.

Policy outputs

Policy outputs are what the decision engine returns when a policy is matched. The system supports multiple output types, including tags, scores, intermediate variables, and output variables.

  • Output tags: You can use easy-to-understand labels, such as highRisk or pass. Separate multiple tags with commas (,). If multiple policies that are associated with the same event have the same tag, the system removes duplicate tags from the final output.

  • Output score: The score must be an integer from -1000 to 1000. When a policy is matched, its score is added to the total event score. The final event score is the sum of scores from all matched policies for that event.

  • Output intermediate variables: Intermediate variables are temporary variables used during policy evaluation. When a policy that defines an intermediate variable is matched, the variable is calculated or output based on the configured logic. You can use these variables in other policies that are associated with the same event.

  • Output variables: In addition to scores and tags, you can define custom output variables, such as event input parameters or intermediate variables. When a policy is matched, the system includes these custom output variables in the response message.

  • Event-specific actions: When a policy is matched, the system executes a predefined action, such as updating a cumulative variable. To use this feature, you must configure the relevant mapping parameters. The action then runs automatically when the policy is triggered. This process enables real-time risk control.

  • Output decision result: From the drop-down list, you can select Reject (REJECT), Pending (PENDING), Pass (PASS), or leave the selection blank. If you configure this field, the API response includes a finalDecision field.

    Note

    If multiple policies are matched, the final decision result is determined by priority: Reject > Pending > Pass.

    The policy outputs form also includes the following settings. For Policy output tags, you can enter a constant tag value of up to 32 characters. For Policy output score, you can output a numeric score from -1000 to 1000 and optionally select the Output as the final event score checkbox. For intermediate variables and output variables, you must specify keys and their corresponding values. For event-specific actions, click + Add to configure an action, such as deWriteVelocity (write cumulative variable), and configure the event code and cumulative variable.

Publish and verify

A policy can have several statuses, such as Draft, Trial Run, and Official Run. To minimize the risk of misconfiguration, we recommend first setting the policy to the Trial Run status. After you verify its behavior, you can switch it to Official Run. The following table describes the different run statuses.

Status

Saved

Executed

Output

Draft

Yes

No

No

Trial Run

Yes

Yes

No

Official Run

Yes

Yes

Yes

After you configure a policy, you must publish it. Follow these steps:

  • Change the status: By default, a new policy is in the Draft status. You must change its status to Trial Run or Official Run.

    In the policy list, find the target policy, open the drop-down menu in the Actions column, and select Trial Run or Official Run to change the policy's status.

  • Activation: After you change the status, the new policy version takes effect within two minutes. In the Policy Management list, you can verify the status change in the Status column. Example statuses include Inactive and Official Run.