Model plugins are compiled Go shared libraries (Documentation 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.
.so files) that WACElib loads at startup via Init. Each plugin is assigned to a specific portion of the HTTP transaction through its plugintype, and is invoked during a call to Analyze. The results from all model plugins accumulate per transaction and are later consumed by a decision plugin when CheckTransaction is called.
Field reference
Unique identifier for this plugin instance. Used as the key in internal maps and as the argument to
Analyze and NATS subject names. Must be unique across all entries in modelplugins.Filesystem path to the compiled
.so plugin file. Must be an absolute or relative path that exists and is readable at the time Init is called. An empty or non-existent path causes Init to return an error.Declares which part of the HTTP transaction this plugin handles. WACElib enforces that a plugin is only called with a matching payload type; a mismatch is logged as an error and the plugin is skipped for that call. Must be one of the values in the table below.
Numeric weight assigned to this plugin’s result. Passed to the decision plugin in
DecisionInput.ModelWeight so that decision logic can compute weighted scores across multiple models.Attack-probability threshold stored in the plugin configuration. Available to decision plugins through the model results; not enforced by WACElib core itself.
Arbitrary key/value string map passed verbatim to the plugin’s
InitPlugin (or InitPluginAsync) function at load time. Use this to supply model-specific settings such as remote endpoint URLs or tuning parameters without modifying plugin source code.Execution mode for this plugin. Accepted values are
sync and async.sync— WACElib waits for the plugin to return a result beforeAnalyzecompletes for that call. The result is available to the decision plugin within the same request lifecycle.async— The plugin is dispatched via NATS and executes in a separate goroutine. Results may arrive afterCheckTransactionhas already been called, so they will not influence the current transaction’s decision.
When
true, the plugin is executed remotely over NATS rather than in-process. The payload is published to the NATS subject matching the plugin id, and results are received on <id>/results. Requires a running NATS server reachable at the configured natsurl.Plugin type values
Theplugintype field controls which phase of the transaction triggers the plugin. Passing a payload of the wrong type to Analyze will cause the plugin to be skipped with an error log entry.
| Value | Transaction portion |
|---|---|
RequestHeaders | HTTP request line and headers only |
RequestBody | HTTP request body only |
AllRequest | Full HTTP request (headers + body) |
ResponseHeaders | HTTP response status line and headers only |
ResponseBody | HTTP response body only |
AllResponse | Full HTTP response (headers + body) |
Everything | Any payload type; plugin is invoked for all phases |
Execution mode and remote flag
The
mode and remote fields interact. When remote: true, the plugin uses InitPluginAsync regardless of the mode value, because the payload is always dispatched over NATS. When mode: async and remote: false, the plugin also uses InitPluginAsync and dispatches via NATS internally. The only case where a plugin runs entirely in-process without NATS is mode: sync combined with remote: false (the default).Configuration examples
- Sync local
- Sync remote
- Async
Plugins execute in-process and block until results are returned. No NATS connection is required. This is the lowest-latency configuration for a single-node deployment.
All plugin types in one configuration
The following example registers one plugin perplugintype. Each plugin is called only when Analyze is invoked with the matching type string.
Plugin interface contract
WACElib loads plugins via Go’splugin package. Depending on the mode and remote settings, WACElib looks up different exported symbols.
Sync local (mode: sync, remote: false):
mode: async or remote: true):