🛡️ ethical-guard
ethical-guard is a hyper-performant, open-source, entirely independent AI safety guardrail package built ab initio (from scratch). Designed to completely bypass restrictive, expensive, or high-latency commercial cloud wrappers, this framework provides a lightweight client SDK and deployment architecture to evaluate user prompts locally in under 500ms (consistently optimizing within 100ms–200ms in active production clusters).
⚡ Core Engineering Highlights
- Sub-500ms Overhead: Enforces strict context-free grammar validation constraints on token paths, eliminating heavy sequence length text generation over arbitrary response windows.
- Response-Only SFT Layer: Built around specialized token boundary gradient masks (masking prompts with target PyTorch cross-entropy labels of
-100) to isolate safety mechanics directly onto categorical JSON responses. - Secure Fail-Closed Design: Native structural design guarantees that if an upstream connection or inference cluster experiences hardware anomalies or timeouts, the client SDK overrides the crash gracefully and defaults to a highly restrictive fallback state to maintain maximum application boundary safety.
🛡️ Target Ethical Taxonomies
The engine classifies incoming payloads into four immutable alignment and corporate compliance pillars:
- Category 01 (Safety & Harm): Intercepts requests regarding chemical/kinetic weapon assembly scripts, physical harm coordination, or malicious digital exploitation methods.
- Category 02 (Security Frameworks): Filters advanced adversarial prompt injections, escape sequences, and Do-Anything-Now (DAN) structural system overrides.
- Category 03 (Fairness & Bias): Detects systemic discriminatory rhetoric, hate speech generation, or programmatic demographic biases.
- Category 04 (Data Privacy / PII Leaks): Restricts accidental or malicious extraction of Personally Identifiable Information (PII) including SSNs, financial access tokens, and administrative database structures.
📦 Installation
Install the production package directly from the Python Package Index (PyPI) via pip:
pip install ethical-guard
Metadata
Release files for ethical-guard 2.0.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ethical_guard-2.0.2.tar.gz | 21.7 kB | With provenance | Details for ethical_guard-2.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ethical_guard-2.0.2-py3-none-any.whl | Python 3 | none | any | Details for ethical_guard-2.0.2-py3-none-any.whl |
Total release size: 43.4 kB
Release files / ethical_guard-2.0.2.tar.gz
| Download URL | ethical_guard-2.0.2.tar.gz |
|---|---|
| Size | 21.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f23821975b77e442af849fa28775f079e3a4118d8d22c915649e0041e216869e
|
|
BLAKE2b-256 checksum How to use checksums |
da3adf4e8b5c83e7a6fccde6db7d1cd6a562a114dc973268f2c2fb9ce99cebe7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logRelease files / ethical_guard-2.0.2-py3-none-any.whl
| Download URL | ethical_guard-2.0.2-py3-none-any.whl |
|---|---|
| Size | 21.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
11ee32738e92dc9ee16579a09271fc1bdebf08db04b76e9f5cbc128bbf25a787
|
|
BLAKE2b-256 checksum How to use checksums |
b4d3b934b8392f498b5986c5700308be52e3a035b0fc14e80ebf12bd80d5095f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logSecurity for ethical-guard 2.0.2
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for ethical_guard-2.0.2.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 9, 2026.
Transparency logA 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.