Skip to main content

A high-performance independent alignment guardrail engine for LLMs.

Project description

🛡️ ethical-guard

PyPI Version License: MIT Python Support

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:

  1. Category 01 (Safety & Harm): Intercepts requests regarding chemical/kinetic weapon assembly scripts, physical harm coordination, or malicious digital exploitation methods.
  2. Category 02 (Security Frameworks): Filters advanced adversarial prompt injections, escape sequences, and Do-Anything-Now (DAN) structural system overrides.
  3. Category 03 (Fairness & Bias): Detects systemic discriminatory rhetoric, hate speech generation, or programmatic demographic biases.
  4. 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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ethical_guard-2.0.0.tar.gz (13.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ethical_guard-2.0.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file ethical_guard-2.0.0.tar.gz.

File metadata

  • Download URL: ethical_guard-2.0.0.tar.gz
  • Upload date:
  • Size: 13.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ethical_guard-2.0.0.tar.gz
Algorithm Hash digest
SHA256 23cb8d4106db7d75f006f2edbbde34f0fc1a3b3984b3dbb6f3f3d39a21b5850d
MD5 3715bf8f3276626d0c51d3e5198ff952
BLAKE2b-256 3afbf2bc76fa89ce41e61709931313b486c75e83c6e3e9e4eadbff62ade5f1bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for ethical_guard-2.0.0.tar.gz:

Publisher: main.yml on Ethical-Guard-AI/EthicalGuard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ethical_guard-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: ethical_guard-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for ethical_guard-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 25cdccc55555f6567f6ac954d5aea904ca09076c6b9253e525ec05ad27c59dda
MD5 6ddd63aed1b424ac22b65092541dee25
BLAKE2b-256 0f06671af05993b183157fea9a71992350097c3fada7ff542cc5789557c36b2b

See more details on using hashes here.

Provenance

The following attestation bundles were made for ethical_guard-2.0.0-py3-none-any.whl:

Publisher: main.yml on Ethical-Guard-AI/EthicalGuard

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page