Local guardrail for AI companions, chatbots and kids' game chat: self-harm, grooming, sexual content, jailbreaks and more, on your own CPU in milliseconds.
pip install paxmod-guard Copy PIP instructions
Safety checks for AI companions, chatbots and kids' game chat, running on your own CPU. No API key, no network calls after the first model download, and no message ever leaves your server. The Python twin of the @paxmod/guard npm package: same model, same scores.
pip install paxmod-guard from paxmod_guard import Guard guard = Guard() # downloads the model once (about 220 MB) to ~/.cache/paxmod-guard # 1. Check what the user sent before your model sees it r = guard.check_input(user_message) if r.crisis_reply: return r.crisis_reply # self-harm risk: answer with crisis support, not the persona if "jailbreak" in r.labels: return "Let's keep things friendly." # 2. Check what your bot wrote before the user sees it reply = llm.generate(user_message) if guard.check_output(reply).flagged: return regenerate_or_refuse() Needs about 1 GB of memory: run it in a container or on a server, not in small serverless functions.
Game or community chat, with the messages before it, or a whole conversation (grooming and other patterns that no single message shows):
guard.check_chat("wanna add me on snap", context=[{"role": "player", "speaker": "B", "text": "im 12"}]) guard.check_conversation([{"role": "player", "speaker": "A", "text": "..."}, ...]) Each result has flagged, labels, scores (every label, 0 to 1) and latency_ms. Signal labels (grooming tactics, distress, swearing, age questions, romance) are always scored but only flag when enabled: Guard(enable=["secrecy", "risk_check"]). Thresholds can be overridden per label: Guard(thresholds={"sexual": 0.7}).
Licence: Apache-2.0. Model card and labels: https://huggingface.co/paxmod/guard
ai-safety chatbot child-safety companion guardrails llm moderation onnx
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
None of the files in this release were uploaded with provenance metadata.
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.




