Rule Type Reference & Configuration Guide — Ayzal AI FRM
A complete guide to every rule type in Ayzal AI FRM, with configuration examples, use cases, and best practices for building composite detection logic.
Rule Type Reference & Configuration Guide
This guide explains every rule type available in Ayzal AI FRM, how it works in the backend, and how to configure it for real-world fraud detection.
1. Single Row Checks
These rules evaluate each transaction on its own. No history or cross-entity lookups are required.
field_compare
Compares a field in the transaction to a constant value.
- Configuration:
- Field: The column to check (e.g.,
amount,status). - Operator:
=,>,<,>=,<=,!=. - Value: The constant to compare against.
- Field: The column to check (e.g.,
- Example:
amount >= 5000 - Use case: Flag any transaction over $5,000.
field_in_range
Checks if a field falls between two values.
- Configuration:
- Field: The column to check.
- Min / Max: The range bounds.
- Example:
amount between 9000 and 9999 - Use case: Catch structuring just below the $10,000 reporting threshold.
field_in_list
Checks if a field matches any entry in a Fraud List.
- Configuration:
- Field: The column to check (e.g.,
ip_address,email). - List Type: The type of list (
ip,email,card,country,device,customer). - List Purpose:
blockorallow.
- Field: The column to check (e.g.,
- Example:
ip_address in block_ip - Use case: Instantly alert any transaction from an IP address you have manually added to the Block IP list.
time_of_day
Checks if the transaction occurred within a specific hour range.
- Configuration:
- Hour Min / Max: The range (0-23).
- Timezone: Which timezone to use for the evaluation.
- Example:
hour between 0 and 5 - Use case: Flag activity during off-hours when legitimate users are unlikely to transact.
2. Two-Column Checks
These rules compare two fields within the same transaction.
field_equals
Checks if Field A equals Field B.
- Example:
source_account = dest_account - Use case: Detect self-transfers that are often used for circular money flow.
field_mismatch
Checks if Field A does not equal Field B.
- Example:
card_issue_country != ip_country - Use case: Flag cases where the card is from one country but the IP is from another (a strong VPN evasion signal).
name_email_match
Uses fuzzy matching to see if a customer's name matches their email address.
- Configuration:
- Name Field: The customer name column.
- Email Field: The customer email column.
- Threshold: A score from 0.0 to 1.0 (0.4 is a good starting point).
- Example: If
name = "John Smith"andemail = "random123@gmail.com", the score will be low, triggering the rule. - Use case: Detect stolen credentials or synthetic identities where the email doesn't match the name.
fuzzy_match
Generic string similarity between two fields (same as name_email_match but for any fields).
- Example:
card_namevsstatement_descriptor. - Use case: Detect card cloning where the physical card name differs from the billing statement.
3. Entity Counts
These rules require looking at historical data and grouping by an entity (e.g., customer_id, card_fingerprint).
count_total
Counts the total number of transactions for an entity within a time window.
- Configuration:
- Entity: The column to group by.
- Threshold: The minimum number of transactions.
- Time Window: The lookback period (e.g., 24h).
- Example:
customer_id has >= 10 transactions in 1h - Use case: Flag accounts with unusually high transaction velocity.
count_events
Counts the number of transactions matching a specific status for an entity.
- Configuration:
- Entity: The column to group by.
- Status Field: The column containing the status.
- Status Values: Which values to count (e.g.,
Failed). - Threshold: The minimum count.
- Example:
customer_id has >= 3 Failed transactions in 1h - Use case: Detect card testing or brute-force login attempts.
count_distinct
Counts the number of distinct values for a target entity, grouped by a source entity.
- Configuration:
- Source Entity: The column to group by (e.g.,
device_id). - Target Entity: The column to count unique values for (e.g.,
customer_id).
- Source Entity: The column to group by (e.g.,
- Example:
device_id has >= 5 distinct customer_ids in 24h - Use case: Detect a single device being used to access multiple accounts (account takeover).
4. Relationships
These rules traverse the Entity Graph to find relationships between entities.
shared_entity
Checks if an entity (e.g., a card) is used by multiple subjects (e.g., customers).
- Configuration:
- Entity: The entity to check (e.g.,
card_fingerprint). - Threshold: The minimum number of subjects.
- Entity: The entity to check (e.g.,
- Example:
card_fingerprint shared by >= 3 customer_ids - Use case: Detect fraud rings where one stolen card is being used across multiple accounts.
entity_chain
Traverses a multi-hop path between entities (A -> B -> C) and counts distinct endpoints.
- Configuration:
- Path: Select entities in order (e.g.,
card_fingerprint->email->card_fingerprint). - Threshold Endpoints: Minimum distinct entities at the end of the chain.
- Path: Select entities in order (e.g.,
- Example:
card_fingerprint->email->card_fingerprintwith threshold2. - Use case: Detect circular fraud rings. If a card shares an email with 2 other distinct cards, it is part of a ring.
5. Aggregations
These rules aggregate numeric values across transactions for an entity.
sum_amount
Sums a numeric field for an entity within a time window.
- Configuration:
- Entity: The column to group by.
- Amount Field: The numeric column to sum.
- Threshold: The minimum sum.
- Example:
customer_id sum(amount) >= 100,000 in 7d - Use case: Detect high-volume money movement (mule activity).
average
Averages a numeric field for an entity.
- Example:
customer_id avg(amount) < 500 - Use case: Identify low-value accounts that are being used for card testing.
ratio
Calculates the ratio between two event counts.
- Configuration:
- Numerator Status: e.g.,
disputed. - Denominator Status: e.g.,
paid. - Threshold: The ratio limit.
- Numerator Status: e.g.,
- Example:
disputed / paid > 0.3 - Use case: Detect chargeback farms (customers who dispute more than 30% of their transactions).
amount_spike
Compares the current transaction amount to the customer's historical average.
- Configuration:
- Entity: The column to group by.
- Multiplier: The factor that the current amount must exceed.
- Lookback: The historical window (7d, 30d, 90d).
- Example:
amount >= 5x customer_id 90d average - Use case: Detect account takeover where a fraudster suddenly drains the account with a large transfer.
