Skip to content

AI Generated Rules


AI detection rules periodically analyze data based on detection prompts. When a rule matches, it generates a security signal.

For example, when investigating a login anomaly, you can have the rule identify cases where the same account fails to log in multiple times and then succeeds, and list the records that support the determination. If you need to count failures against a fixed threshold, you can also use regular detection rules.

Before You Configure

First, in Security Logs, select the time range you plan to inspect and find a few records by source. Then open the log details and verify the fields and values for account, operation type, and operation result.

If the account or result is still in the raw log, you can first extract fields using integration parsing rules. To detect "failure followed by success," confirm that the logs record both failed and successful operations and that they can be correlated using the same account field.

Detection Frequency determines how often the rule runs, and the time range in the prompt determines which data is analyzed in each run.

For example, to run once per hour, write "Analyze logs from the last 1 hour" in the prompt.

Create

  1. Go to Security Monitoring > Detection Rules, open the Create drop-down menu, and select AI Generated.
  2. Enter a Rule Name, set the Detection Frequency, and confirm that the Analysis Category is Security.
  3. Enter the Detection Prompt directly, or select a Prompt Template first and then adjust the source, time, and conditions to match your actual data.
  4. Optionally click Add Data Object and select the relevant data. The default type is Security Logs.
  5. Optionally associate an alert policy, and then click Save. Return to the AI Generated Rules tab and verify the rule name and enabled status. If you need scheduled detection, enable the rule.

Rule operation permissions and log query permissions are configured separately. The log query scope depends on the workspace's data access policy.

Write a Detection Prompt

Specify the data source, analysis period, conditions, and the evidence to return. When a rule involves counts or sequence, state clearly which record starts the time window and when a match is considered.

Example: Detect Successful Login After Multiple Failures

This example uses login logs from the audit.demo source. Adjust the fields and values based on the logs you have ingested, and confirm that actor, ip, action, and status are queryable. The logs used for validation should include both failed and successful login records.

Check security logs from the last 1 hour where source is audit.demo, and identify cases where the same account fails multiple times and then logs in successfully.

Analyze only records where action is login, grouped by actor. If the same account has at least 5 logins with status failure within any consecutive 10 minutes, and a login with status success occurs within 5 minutes after the last failure, list it as a risk that requires review.

Use ip to determine whether the failed and successful logins come from the same address. List the account, source IP, number of failures, failure period, and the time of the subsequent successful login, and provide log evidence supporting the determination.

If there is no data that meets the conditions, state that no risk meeting the above conditions was found. If fields are missing or data is insufficient, describe the conditions that cannot be verified and indicate which conclusions still require manual confirmation.

When reviewing the results, first verify the time and account against the actual logs, and then use business context to determine whether action is needed. Repeated incorrect password entries followed by a successful login for the same account may also be normal behavior.

Test a Saved Rule

  1. Save the prompt and data objects to be tested. The test runs the saved configuration; if it matches, it may generate a signal and send notifications. Before running the test, verify the recipients and channels of the alert policy.
  2. Open the rule, click Test Prompt in Test Detection, and check the progress of this run. To verify the execution status and duration, open Execution Logs.
  3. Validate the results using logs that are known to meet and not meet the conditions. In this example, if the same account has 5 failures within 10 minutes and a successful login within 5 minutes after the last failure, it should be detected. Under the same conditions, if there are only 4 failures, it should not match.

Verify that the account, count, and time in the results meet the conditions, and confirm that the listed evidence maps to the original records. If there is no match, first query Security Logs using the same source and time range, and verify the fields and values required by the rule.

If the test reports an error, check the configuration and data access permissions based on the error message. After making changes, save and test again. For more methods, see Execution Log Troubleshooting.

View Detection Results

After a scheduled rule is enabled, you can verify its enabled status and alert policy on the AI Generated Rules tab. To validate a specific detection run, first confirm from Execution Logs whether it ran, and then view the match results in Signals.

For example, when you see a login anomaly signal, use the account and time involved to query Security Logs, and confirm whether the failed and successful records belong to the same account and whether the operations came from the same IP. If a signal exists but no notification was received, check the associated alert policy and notification channels.

For operations such as editing, cloning, enabling, and disabling rules, see Manage Detection Rules.

Billing and Deployment Plan Models

For the Commercial Plan, each execution of an AI security detection is counted as 1 Trigger, and credits are calculated separately based on the actual consumption of that detection. For details, see AI Security Detection Billing.

For the Deployment Plan, you can select a model service for each environment, including connecting your own model. For details, see Deployment Plan AI Model Configuration.

Feedback

Is this page helpful?