Scenario: Policy Lab provides the policy restore, policy replay, variable recommendation, and variable and model customization features. You can use these features to further strengthen and improve the effect of policies.
1. Policy restore
You can use the policy restore feature to restore the computing process of historical requests. To use the policy restore feature, you must enter the request ID returned by the decision engine for the target request. The policy restore feature relies on Log Service. The decision engine delivers logs required by policy restore to the target Log Service project under the current account.
The system restores the computing process and result of the historical request with the specified request ID. After the restore, you can view details of the request, event input and output parameters, and details of policies hit by the request. You can click Detail in the Actions column of a policy that is hit by the request to view the computing process of the policy.
The system provides the execution result of each rule in the policy. You can complete case analysis and policy optimization based on the rule execution results.
2. Policy Replay
You can test optimized policies against historical request data to recur issues, including missed risks and service interruptions. You can compare the results of optimized policies with previous results to check the optimization effect.
When you create a policy replay task, select an event, specify the time range, and select a policy to replay. After the task is created, the system queues the task up and starts computing when the task starts. The computing duration is determined by the size of data to be computed. More data consumes more time. Usually, it takes at most 1 hour for a policy replay task to compute up to 10,000 event requests. If the policy replay task uses a policy that involves charged variables, your resource plans may be deducted. The system estimates the maximum resource consumption based on the event request amount. Actual consumption is always lower than the estimated value because the system only implements the computing logic specified by the rule combination in the policy.
After the policy replay task is completed, the system delivers logs that contain task results to the target Log Service project. The system generates a report to show the comparison between the new and previous results. You can also go to the Log Service console to perform log analysis based on your business requirements.
3. Policy recommendation
After you use a sample to create a variable recommendation task for a specified scenario, the system automatically learns the sample, trains a model, and selects variables to generate a policy. This feature provides recommendations on risk control policies with explainable and custom models and maintainable policies, freeing you from modeling and development.
To use the policy recommendation feature, you must upload samples first. You can go to the My Samples page to upload samples. Uploaded samples are stored in the Object Storage Service (OSS) bucket under the current account and may incur fees. For more information about OSS fees, see the OSS documentation. The quality of samples determines the effect of model training and variable recommendation. We recommend that you prepare more than 2,000 samples, with the ratio of risky samples to non-risky samples being 1:2. You can also set the proportion of risky samples based on the risk ratio of your business.
After you upload samples, you can create a variable recommendation task by selecting samples, variables, and evaluation indexes, and setting the task name. Then, the system starts the computing process of this task. Usually, it takes minutes to hours to complete a variable recommendation task. The duration is determined by the sample size and number of variables.
When a variable recommendation task is running, you can go to the details page of the task to view the staged result. You can view independent variables of the task, details, and indexes of policies recommended by the system. You can also add policies that meet your expectations as candidate policies.
You can apply a candidate policy to an event. If input parameters of variables used by the policy are missing in the event, the system automatically supplements such input parameters. When you call an operation to run the policy, you must pass in the missing parameters. By default, policies created by the system are in the Draft state and use test as the output tag to avoid risks caused by misoperations. To change the default status and output tag based on your business requirements, go to the details page of the policy.