LLM Guard, from Protect AI, is a toolkit for securing LLM interactions. It sanitizes inputs and outputs, detects harmful language, prevents data leakage and helps resist prompt injection, with scanners you run in front of and behind your model call.
Install with pip install llm-guard (Python 3.9+); docs are at protectai.github.io/llm-guard. The repository is archived, read-only and no longer actively maintained, so evaluate it carefully for new projects and consider LlamaFirewall, NeMo Guardrails or Guardrails AI. MIT licensed.