All Products
Search
Document Center

Fraud Detection:Create a policy (default)

Last Updated:Dec 03, 2025

This topic describes how to create a default policy.

Background information

  • What is a policy: A policy is a set of orchestrated operational logic. When an event data request is received, the decision engine runs calculations based on the configured policy. If the policy is hit, the system outputs the result of the policy execution.

  • Scenarios: To perform complex logical rule judgments, you can configure a policy with combined conditions. For example, in a credit loan approval scenario, you need to screen for known high-risk objects. If a loan applicant hits a mobile phone number blacklist, an email address blacklist, or an account blacklist, the applicant is identified as high-risk. You can configure a policy to implement this logic.

Configure basic policy information

Note

Before you configure a policy, you must create an event. For more information, see Create an event.

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

  2. Configure the basic parameters for the new policy, including the policy name and description.

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

    Important

    Dependent variables are linked to the associated event. After you select and submit an associated event, you cannot change the association. This restriction prevents operational errors that could disable variables and disrupt policy calculations.

Configure calculation logic

The following list describes the terms and modules on the policy calculation logic configuration page:

  • Condition Name: This parameter is optional. To display the policy logic clearly in the visualization preview, you can enter a descriptive name.

  • Left Variable: You can select 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 displays the available operators based on the data type of the left variable. For example, if the left variable is of the string data type, operators such as greater than, less than, or equal to are not available.

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

Note
  1. Event fields support function-based calculations. For example, to convert an email address field to lowercase, you can select the email address event field and then apply the lowercase conversion function.

  2. To configure multiple calculation logic rules, click Add Calculation Logic. You can also copy an existing rule to quickly create a similar one.

Preview calculation logic

  1. Basic elements. You can orchestrate calculation logic by combining condition ordinal numbers (such as 1, 2, and 3), logical symbols such as | and &, and parentheses ().

    • | represents a logical OR.

    • & represents a logical AND.

    • ! represents a logical NOT operation.

    • Use () to set the order of operations.

  2. Visualization preview. After you orchestrate the logic, click View Rules Tree to preview the result in real time. The preview interface automatically displays the ordinal number and name of each condition. Named conditions display their names, while unnamed conditions display their ordinal numbers by default.

    Example: If the first three conditions are named, but the fourth condition is unnamed and has a NOT operation applied, the interface appears as follows:

Configure policy outputs

A policy output is the content that the decision engine returns when a policy's conditions are met. When a policy is hit, it can return several types of outputs, such as tags, scores, intermediate variables, and output variables.

  • Output tags: Use descriptive content, such as highRisk and pass. Separate multiple tags with commas (,). If multiple policies for the same event are configured with the same tag, the system deduplicates the tags in the final output.

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

  • Output intermediate variables: An intermediate variable is a temporary variable used during policy calculation. When a policy that is configured with an intermediate variable is hit, the variable is calculated or returned based on the configured logic. Intermediate variables can be used in other policies for the same event.

  • Output variables: In addition to scores and tags, you can define custom output variables, such as event request parameters and intermediate variables. When a policy is hit, the custom output variables are included in the response message.

  • Event-specific actions: When a policy is hit, the system executes a preset action, such as accumulating a variable's value. To use this action, you must configure the relevant mapping parameters. After configuration, the action automatically runs when the policy is triggered, which enables real-time risk control.

  • Output decision result: The drop-down list includes Reject (REJECT), Pending (PENDING), Pass (PASS), or empty (no selection). If you configure this field, the finalDecision output field is added to the API response.

    Note

    If you select an output decision result, the final decision is overwritten based on priority. The priority order is: Reject > Pending > Pass.

Publish and verify the policy

A policy can have several statuses, such as Draft, Trial Run, and Official Run. To reduce the risk of configuration errors, we recommend that you first set the policy to Trial Run. After you verify its operation, you can switch it to Official Run. The following table describes the different running statuses.

Policy running status

Save

Execute

Output

Draft

×

×

Trial Run

×

Official Run

After you configure the policy, you need to publish it. The steps are as follows:

  • Change status: When you first save a policy, its status is Draft by default. Click the Run or Trial Run button to change the policy status.

  • Take effect: After the policy status is successfully changed, that version of the policy takes effect within 2 minutes.