Skip to main content

paxmod-guard

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

Metadata

Release files for paxmod-guard 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for paxmod-guard 0.1.0
File Size Uploaded Provenance
paxmod_guard-0.1.0.tar.gz 5.8 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for paxmod-guard 0.1.0
File Interpreter ABI Platform
paxmod_guard-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.1 kB

Release files / paxmod_guard-0.1.0.tar.gz

Download URL paxmod_guard-0.1.0.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
0c6a489b14b0a28419567426b1dfe8b556f3a96ce7b44f96775fb0c49802cc0d
BLAKE2b-256 checksum
How to use checksums
f39d96a642a656facba8d9a6e38dedcd34d999cd496058966b68cd75748cb403
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / paxmod_guard-0.1.0-py3-none-any.whl

Download URL paxmod_guard-0.1.0-py3-none-any.whl
Size 6.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a3f5293956823125278de776b610e74adb83d3522a41af245da47d45ae0781f1
BLAKE2b-256 checksum
How to use checksums
79e6152e9ea247bffd91762740d9bba0bd9d95652cc201afadfa783ea8a4a4bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.32 {"installer":{"name":"uv","version":"0.11.32","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for paxmod-guard 0.1.0

Provenance

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page