latent.guardrails.base¶
Classes¶
GuardrailBlockContext¶
GuardrailBlockContext(rule_name: str, score: float, prompt: str, message: str, metadata: dict[str, Any] = dict(), agent: Any = None)
Context passed to on_block callbacks when an active guardrail fires.
GuardrailBlockedError¶
GuardrailBlockedError(rule_name: str, score: float, message: str = 'Request blocked by guardrail.', is_context_check: bool = False)
Raised when an active rule blocks a request.
InputScanner¶
MessageInputScanner¶
Scanner that operates on the full message list instead of a single prompt string.
OutputScanner¶
ScanResult¶
Functions¶
error_result¶
ScanResult for a scanner that errored (passes to avoid false blocks).
pass_result¶
Convenience constructor for a passing (or simple failing) ScanResult.