> ## Documentation Index
> Fetch the complete documentation index at: https://blacklab.windmotion.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Custom Plugins

> Learn how to create your own BlackLab WAF plugin

## Write Your Own Plugin

BlackLab WAF allows you to create **custom plugins** to detect specific attack patterns or application-specific threats.

You can define your own rules, assign weights, and decide what happens when a request exceeds your threshold.

***

## Example

A custom plugin could, for instance, block requests containing certain headers or patterns unique to your app.\
The plugin would be added to your configuration like any built-in plugin:

```ruby theme={null}
BlackLab.configure do |config|
  config.plugins = [
    MyCustomPlugin.new(weight: 2)
  ]
end
```
