Hi.
The scan policies can be created with the following API calls:
name = "MyScanPolicy"
zap.ascan.add_scan_policy(name)
# Configure which scanners are enabled and its properties:
zap.ascan.disable_all_scanners (name)
zap.ascan.enable_scanners("6, 40012", name)
zap.ascan.set_scanner_alert_threshold("6", "LOW", name)
zap.ascan.set_scanner_attack_strength("40012", "HIGH", name)
To find out the IDs of the scanners it can be used the following script:
https://github.com/zaproxy/community-scripts/blob/master/standalone/Active%20scan%20rule%20list.js
The scan policies can also be created/exported with GUI, and then
imported into new ZAP instances:
zap.ascan.import_scan_policy("/path/to/MyScanPolicy.policy")
Best regards.