A decision plugin is a Go shared object that receives the aggregated results from all model plugins and produces a final allow/block verdict for the transaction. TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/tilsor/ModSecIntl_wace_lib/llms.txt
Use this file to discover all available pages before exploring further.
PluginManager loads decision plugins at startup using Go’s plugin package, calls InitPlugin once to configure the plugin, and then calls CheckResults once per transaction when wace.CheckTransaction is invoked. Decision plugins are always synchronous and do not use NATS.
Required exports
Every decision plugin.so file must export both of the following symbols with exactly these function signatures.
InitPlugin
wace.Init. Use it to read plugin-specific configuration from params, initialise any state, and register custom metrics.
| Parameter | Type | Description |
|---|---|---|
params | map[string]string | Key-value pairs from the params block in the plugin’s configuration YAML. |
meter | metric.Meter | OpenTelemetry meter for recording decision-level metrics. |
PluginManager logs a warning and excludes the plugin from the decision registry.
CheckResults
wace.CheckTransaction after all pending Analyze calls have completed. The plugin examines model scores and WAF data and returns true to block the transaction or false to allow it.
| Parameter | Type | Description |
|---|---|---|
input | pluginmanager.DecisionInput | Aggregated model results, weights, and WAF anomaly scores. See below. |
(true, nil) to block, (false, nil) to allow, or (false, error) if the plugin cannot evaluate the input.
DecisionInput contents
Identifier of the transaction being evaluated.
Map of model plugin ID to its results. Each
ModelResults contains
ProbAttack float64 (attack probability in [0.0, 1.0]) and Data map[string]interface{} for any additional metadata the model produced.Map of model plugin ID to the weight declared in the configuration. Use this
to implement weighted-average scoring across multiple models.
Key-value pairs forwarded directly from the
wafParams argument of
wace.CheckTransaction. In ModSecurity-based deployments, these keys
typically include:| Key | Example value | Description |
|---|---|---|
COMBINED_SCORE | "0" | Total ModSecurity anomaly score |
inbound_blocking | "20" | Inbound blocking score |
inbound_threshold | "5" | Inbound threshold for blocking |
outbound_blocking | "0" | Outbound blocking score |
outbound_threshold | "4" | Outbound threshold for blocking |
phase | "2" | ModSecurity processing phase |
XSS | "0" | XSS-specific score |
SQLI | "0" | SQL injection-specific score |
LFI | "0" | Local file inclusion score |
RCE | "0" | Remote code execution score |
Example decision plugin
The following example mirrors the logic expected of thesimple decision plugin used in WACElib tests. It blocks a transaction when either the weighted ML score exceeds a threshold or the WAF’s inbound_blocking score is above inbound_threshold.
Calling sequence
The following diagram shows whenCheckResults is called relative to the transaction lifecycle:
Decision plugins share the same ABI constraints as model plugins: they must be
compiled against identical versions of
pluginmanager and
go.opentelemetry.io/otel/metric as the host WACElib binary.