Skip to main content

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 optional max_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

FieldTypeDefaultNotes
modestringcritical_infrastructurecritical_infrastructure, automotive, education, law_enforcement, government, military, hr, justice, healthcare, finance, legal, or defense.
block_ifstring[][]When non-empty, this is the active match list. Built-in defaults are used only when block_if is empty.
actionstringblockblock or escalate.
fuzzy_matchingbooleanfalseUsed by the input phase only.
max_distanceinteger1Edit-distance threshold for input fuzzy matching.
max_ageinteger0Used by the input phase only. Ages 1..17 activate a simple adult-term keyword check.

Built-in default keywords when block_if is empty

ModeDefault terms
critical_infrastructureexplosive, weapon, attack
automotivedisable airbags, bypass brakes, tamper
educationself-harm, suicide
law_enforcementdoxx, target

The remaining accepted modes use the generic critical_infrastructure default terms unless you provide block_if explicitly.

Important behavior notes

  • Custom block_if values replace the default terms; they are not merged.
  • The input phase supports fuzzy matching and max_age checks.
  • The output path currently checks keyword matches and action, but does not apply the input phase's fuzzy-matching or age-gate logic.
  • max_age uses 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

Next steps