Skip to content

Building Plugins

Bulwark’s plugins target the WebAssembly (WASM) instruction format and use the WebAssembly System Interface (WASI) API to communicate with their host environment. Currently, Bulwark only offers support for a Rust SDK, however other language support is planned.

The Rust SDK requires a Cargo.toml file in the plugin directory. This declares a plugin’s dependencies and includes useful metadata like the plugin name and author information.

name = "example-plugin"
version = "0.1.0"
edition = "2021"
publish = false
bulwark-wasm-sdk = "0.3.0"
crate-type = ["cdylib"]
# These settings may help optimize file size for release builds
lto = true
opt-level = 3
codegen-units = 1
panic = "abort"
strip = "debuginfo"

Plugin logic will be written in a src/ file.

use bulwark_sdk::*;
struct ExamplePlugin;
impl Handlers for ExamplePlugin {
fn on_request_decision() -> Result {
// Plugin logic goes here

A build subcommand is included in the bulwark-cli binary and should generally be used to compile Bulwark plugins.

Terminal window
bulwark-cli build

The default location for build output is the dist/ directory.