Safety Filter
The safety-filter policy is a keyword-based safety control. It does not use a large classifier or a built-in moderation service. Instead, it checks configured terms, optional fuzzy matching, and a simple age-gate keyword list.
Phase and verdicts
- Input phase: full input check with
block_if, optional fuzzy matching, and optionalmax_age - Output phase: keyword blocking/escalation in the proxy response path
- Verdicts:
allow,block,escalate
Configuration
pack:
name: safety-filter-example-1
version: "1.0.0"
enabled: true
policies:
chain:
- safety-filter
policy:
safety-filter:
mode: critical_infrastructure
block_if:
- override safety interlock
- disable emergency shutdown
action: block
fuzzy_matching: true
max_distance: 1
max_age: 0
Supported fields
| Field | Type | Default | Notes |
|---|---|---|---|
mode | string | critical_infrastructure | critical_infrastructure, automotive, education, law_enforcement, government, military, hr, justice, healthcare, finance, legal, or defense. |
block_if | string[] | [] | When non-empty, this is the active match list. Built-in defaults are used only when block_if is empty. |
action | string | block | block or escalate. |
fuzzy_matching | boolean | false | Used by the input phase only. |
max_distance | integer | 1 | Edit-distance threshold for input fuzzy matching. |
max_age | integer | 0 | Used by the input phase only. Ages 1..17 activate a simple adult-term keyword check. |
Built-in default keywords when block_if is empty
| Mode | Default terms |
|---|---|
critical_infrastructure | explosive, weapon, attack |
automotive | disable airbags, bypass brakes, tamper |
education | self-harm, suicide |
law_enforcement | doxx, target |
The remaining accepted modes use the generic critical_infrastructure default terms unless you provide block_if explicitly.
Important behavior notes
- Custom
block_ifvalues replace the default terms; they are not merged. - The input phase supports fuzzy matching and
max_agechecks. - The output path currently checks keyword matches and
action, but does not apply the input phase's fuzzy-matching or age-gate logic. max_ageuses a simple keyword list (alcohol,tobacco,gambling,explicit,pornograph,drug use,substance abuse,violence,gore,profanity) rather than a classifier.
Minimal valid example
policy:
safety-filter:
action: block