Skip to main content

Module guardrails

Module guardrails 

Source
Expand description

Input guardrails: local heuristic screening of chat input for prompt-injection / jailbreak patterns and obvious secrets/PII, run before the LLM call.

This is a first-line, dependency-free signal — substring matching for injection phrases and shaped scans for secrets/PII. It is intentionally conservative (accepts false negatives) and never echoes the matched value; findings carry only a category and a short label.

Structs§

GuardrailFinding
A guardrail finding: the category and a short, content-free reason label.

Enums§

GuardrailCategory
Category of a guardrail finding.

Functions§

screen_input
Screen chat input. Returns the first finding (injection takes precedence over PII), or None when screening is disabled or the input is clean.