Plugin ABI
This page is the application binary interface (ABI) reference for processor plugins that implement Bento's WebAssembly (WASM) interface directly. It defines the runtime, memory ownership, message formats, exports, and error behavior for a 32-bit WASM module.
The Go plugin development kit (PDK) implements this interface for you. Complete implementations without a PDK are available in the Rust examples. See About plugins for an overview and Manifest fields for plugin configuration.
The ABI may change between Bento releases. Plugins that implement it directly must manage the memory exchanged with Bento and match the ABI of the Bento version that loads them.
Runtime
Bento runs plugins in process using wazero. It compiles a plugin's module when a pipeline first uses it and creates instances as processing calls need them.
Each instance processes one call at a time. Concurrent calls can use separate instances, and successive calls may use different instances. Global variables belong to one instance; they are not shared state across the processor. Idle instances may be discarded, so their state is not persistent storage.
The plugin runs only while Bento calls it. Work for a call must finish before its export returns. Go goroutines do not run in the background between calls. The ABI has no teardown export; Bento closes instances directly.
Sandbox
Plugins have access to WASI preview 1, with clocks and a secure random source. Filesystem access is limited to directories mounted with runtime.wasm.mounts, although symbolic links within those directories can lead outside them. Mounts are read-only by default.
runtime.wasm.memory.max_pages limits each instance's linear memory in 64 KiB pages. Without a configured limit, each instance can allocate up to 4 GiB.