Safety Filter
The safety filter is a post-hook that scans LLM responses against pattern-based rules across 5 categories.Categories
Severity Weights
Configuration
block— throwsSafetyViolationErrorwarn— adds findings to response metadata, does not throwlog— logs findings, no metadata or throw
SafetyFinding
Human-in-the-Loop Gate
The HITL gate is a post-hook that pauses execution when LLM output matches critical action patterns. A human operator must approve or deny before the response is returned.Built-in Rules
4 default rules cover the most critical action categories:Configuration
Custom Rules
Override built-in rules withhitlGateRules:
Types
Timeout Behavior
- Default timeout: 5 minutes (
300000ms) - On timeout: throws
HumanGateDeniedErrorwithreason: 'timeout' - On denial: throws
HumanGateDeniedErrorwithreason: 'denied' - On approval: response passes through with
hitlGateTriggered: truein metadata
Error Handling
SafetyViolationError and HumanGateDeniedError reference.Agent Mode
Circuit breaker for cascading agent failures.