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§
- Guardrail
Finding - A guardrail finding: the category and a short, content-free reason label.
Enums§
- Guardrail
Category - Category of a guardrail finding.
Functions§
- screen_
input - Screen chat input. Returns the first finding (injection takes precedence over
PII), or
Nonewhen screening is disabled or the input is clean.