Skip to main content

Module guard

Module guard 

Source
Expand description

Configurable input guardrails backed by llm-guard. Per-route policy selection with fallback to a default policy.

Re-exports§

pub use engine::GuardEngine;
pub use policy::GuardrailsConfig;

Modules§

engine
The guard engine: compiles one llm-guard pipeline per policy and runs a request’s input text through the route’s selected policy.
policy
Guardrails config: named policies parsed from guardrails.toml.
scanners
Name→scanner registry. Turns a ScannerSpec into one or more llm-guard scanners. A bundle alias (e.g. prompt_injection) yields several. There is no global registry in llm-guard, so this is ours.