org.llm4s.agent.guardrails.GuardrailAction
See theGuardrailAction companion object
Actions to take when a guardrail detects a violation.
Guardrails can be configured to respond to violations in different ways depending on the use case and severity of the detected issue.
Example usage:
// Block on prompt injection (security critical)
val injectionGuard = PromptInjectionDetector(onFail = GuardrailAction.Block)
// Fix PII by masking (privacy preserving)
val piiGuard = PIIDetector(onFail = GuardrailAction.Fix)
// Warn on low-severity issues (monitoring)
val lengthGuard = LengthCheck(1, 10000, onFail = GuardrailAction.Warn)
Attributes
- Companion
- object
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
In this article