guardrails-ai/guardrails-hub-monorepo

2

stars

13

commits

Python

primary language

Aug 5, 2026

updated

README

Guardrails Hub Monorepo

Monorepo for Guardrails-AI-owned validators, published to public PyPI as guardrails-ai-<name> and importable from the PEP 420 guardrails_ai namespace.

pip install guardrails-ai-detect-pii
from guardrails import Guard
from guardrails_ai.detect_pii import DetectPII

guard = Guard().use(DetectPII)

No account, API key, or hub login is needed — every validator is a plain PyPI package.

The full catalog is All Hub Validators below. It is generated from each package's pyproject.toml by scripts/generate_validators_index.py and is consumed programmatically by the validator hub UI, so its format is a contract — see the script's docstring before changing it. Regenerate after adding a validator or editing its description/tags:

python scripts/generate_validators_index.py

All Hub Validators

65 validators. Each is a standalone PyPI package — install it with pip install <package>; no account, API key, or hub login is required.

  • Ban List: Validates that the output does not contain banned words, using fuzzy search. Code
  • Bert Toxic Language Validator: Validates that the input string does not contain toxic language based on a BERT model. Code
  • Bias Check: Validates that the text is free from biases related to age, gender, sex, ethnicity, religion, etc. Code
  • Competitor Check: Flags mentions of competitors. Fixes responses by filtering out competitor names. Code
  • Contains String: A Guardrails AI validator to check if the LLM-generated text contains a substring. Code
  • Cucumber Expression Match: Validates that the input string matches a specified cucumber expression. Code
  • Detect Jailbreak: Detects attempts to circumvent safeguards in model conditioning. Code
  • Detect PII: Detects personally identifiable information (PII) in text, using Microsoft Presidio. Code
  • Detect Prompt Injection: Finds prompt injection using the Rebuff prompt library. Code
  • Detect System Prompt Leakage: Detects system prompt leakage using fuzzy string matching (via rapidfuzz) to compare the LLM's response against a provided system prompt. Code
  • Endpoint Is Reachable: Checks if an endpoint can be reached by making a request to it. Code
  • Ends With: Check if a string or list ends with a specified string or list. Code
  • Exclude SQL Predicates: This rule checks for the use of particular SQL predicates in the query. It is important to exclude SQL predicates from the query to prevent SQL injection attacks. Code
  • Extracted Summary Sentences Match: This validator checks if the extracted summary sentences match the original document. Code
  • Gibberish Text: A Guardrails AI validator to detect gibberish text. Code
  • Guardrails PII: Detects personally identifiable information (PII) in text. Code
  • Has Url: Ensure content contains a url. Code
  • Internal Domains: Identifies internal domains in a string output. Code
  • Llama Guard: A llama based validator which checks whether a given prompt is safe/unsafe by specifying a set of policies and lists the violating policies when applicable. Code
  • LLM Critic: Grade the generated response based on provided criteria. Code
  • Logic Check: Validates logical consistency and detects logical fallacies in the model output. Attempts to correct logical fallacies if found. Code
  • Lowercase: Passes when totally lowercase. Code
  • Mentions Drugs: Validates that the generated text does not contain any drug names. Code
  • NSFW Text: A Guardrails AI validator to detect NSFW text. Code
  • One Line: This validator checks if the input is a single line of text. Code
  • Politeness Check: Ensure generated output is polite. Code
  • Presidio Gliner PII: Detects personally identifiable information (PII) in text. Code
  • Profanity Free: Checks for profanity in text, using the alt-profanity-check library. Code
  • Prompt Injection Detector: A Guardrails validator that scores prompts for injection attempts via a secondary LLM. Code
  • Provenance Embeddings: Compares embeddings of generated and source texts to calculate provenance. Code
  • Provenance LLM: A validator for ensuring the factuality and reducing brand risk in generated content. Code
  • Provenance NLI: Detects and removes hallucinations from LLM-generated text using an NLI model to validate it against a provided context. Code
  • QA Relevance LLM Eval: Makes a second request to the LLM, asking it if its original response was relevant to the prompt. Code
  • Quotes Price: Validates that the generated text contains a price quote. Code
  • Reading Level: Parses text to find its readability as a US grade level number (0-12). Code
  • Reading Time: Ensures that any generated text is less than a maximum expected reading time. Code
  • Redundant Sentences: Identifies redundant sentences in text using fuzzy matching. Code
  • Regex Match: Ensure content matches a provided regular expression. This can be used to validate content such as email addresses, phone numbers, and more. Code
  • Relevancy Evaluator: Validates that the reference text contains information relevant to answering the original question. Code
  • Response Evaluator: Evaluate generated output using a provided question. Code
  • Responsiveness Check: Ensure generated output is polite. Code
  • Restrict To Topic: Checks that a text stays on a set of valid topics and avoids invalid ones. Code
  • Saliency Check: Checks if a generated summary covers topics present in a source document. Code
  • Secrets Present: Detects the secrets present in text by matching against common patterns for API keys and other sensitive information. Code
  • Sensitive Topic: A Guardrails AI validator that detects sensitive topics in text. Code
  • Shield Gemma: A Gemma based validator for moderating user prompts to guard against harmful content by specifying a policy. Code
  • Similar To Document: Checks if some generated text is similar to a provided document. Code
  • Similar To Previous Values: Checks if a value is similar to a list of previously known correct values. Code
  • Sky Validator: Validates that the input string does not contain negative statements about Sky Electric. Code
  • Toxic Language: Identifies and flags toxic language in text to ensure communications remain professional and appropriate. Code
  • Toxic Language LLM: Detects toxic language in LLM-generated text using an LLM as the detection backbone. Evaluates text across seven toxicity categories: toxicity, severe toxicity, obscene, threat, insult, identity attack, and sexual explicit content. Code
  • Two Words: Passes when value is exactly two words. Code
  • Unusual Prompt: A Guardrails AI input validator that validates a prompt for unusualness and trickery. Code
  • Uppercase: Passes when totally uppercase. Code
  • Valid Address: Verifies an LLM-generated address using Google Maps' Address Validation API. Code
  • Valid Choices: Checks if a given string is a valid choice from a list of choices. Code
  • Valid HTML: Guardrails validator that checks for HTML parseability. Code
  • Valid JSON: Ensure content is parseable as valid JSON. Code
  • Valid Length: Ensures the length of a string or list falls between a minimum and maximum. Code
  • Valid OpenAPI Specification: Ensures that a generated output is a valid OpenAPI Specification. Code
  • Valid Range: Assess whether a generated number is between a maximum and minimum value. Code
  • Valid SQL: Validates whether the given SQL code is syntactically correct using. Optionally accepts a database schema to validate against using SQLAlchemy. Code
  • Valid URL: Validates that text is a syntactically-valid URL. Code
  • Web Sanitization: Scans LLM outputs for strings that could cause browser script execution downstream. Code
  • Wiki Provenance: A Guardrails AI validator that detects and removes hallucinated text based off Wikipedia. Code

Layout

Each validator is a self-contained package at the repo root:

<name>/
└── py/
    ├── pyproject.toml            # name = guardrails-ai-<name>, license = MIT
    ├── Makefile                  # install / lint / type / test / license-check
    ├── pyrightconfig.json, .coveragerc, LICENSE (MIT), README.md
    ├── src/guardrails_ai/<name>/ # importable as guardrails_ai.<name> (PEP 420, no __init__ at namespace root)
    └── tests/
  • Dist name: guardrails-ai-<name> (underscores → dashes).
  • Import: from guardrails_ai.<name> import <Export>.
  • Registered validator name is unchanged: @register_validator(name="guardrails/<name>"), so existing guards keep working.
  • Versioning: independent per package; a release is gated by the git tag <name>-py-<version>.

Developing a validator

From <name>/py in a fresh virtual environment:

python -m venv .venv && . .venv/bin/activate
make install install-dev
make lint             # ruff
make type             # pyright
make test             # pytest ./tests
make license-check    # license sweep (MIT-only dependency trees)

Adding a validator

Create a new <name>/py/ package following the layout above: an MIT-licensed pyproject.toml named guardrails-ai-<name>, source under src/guardrails_ai/<name>/, and tests. CI picks it up automatically via the */py/** path filters.

Dependency locks

Each package pins its fully resolved dependency tree in py/requirements.lock for reproducible installs — universal locks, valid across platforms and Python 3.10-3.13. sensitive_topics has no lock yet: it depends on guardrails-ai-restricttotopic, which is not yet on PyPI, so its lock will generate once that package is published.

Regenerate them with uv:

./scripts/generate_locks.sh

Licensing

Every validator package is MIT and must depend only on permissively licensed packages. The merge-blocking license sweep (make license-check, wired into validators_pr_qc.yml) reads the allowlist in .licenses-allow.txt and the documented, manually reviewed exceptions in .licenses-exceptions.txt.

CI

  • .github/workflows/validators_pr_qc.yml — change-detected matrix ({changed validator} × {py 3.10–3.13}): install, lint, type, tests, license sweep.
  • .github/workflows/validators_publish.yml — change-detected trusted publishing to public PyPI via OIDC (no tokens), with a version-bump guard and git tagging.
  • .github/workflows/bootstrap_publish.yml — one-time token-auth publish that creates the PyPI projects, before per-project trusted publishers are bound.
  • .github/dependabot.yml — weekly pip (all /*/py) + github-actions updates.

Contributors

zsimjee

13 commits

guardrails-ai/guardrails-hub-monorepo

2

stars

13

commits

Python

primary language

Aug 5, 2026

updated

README

Guardrails Hub Monorepo

Monorepo for Guardrails-AI-owned validators, published to public PyPI as guardrails-ai-<name> and importable from the PEP 420 guardrails_ai namespace.

pip install guardrails-ai-detect-pii
from guardrails import Guard
from guardrails_ai.detect_pii import DetectPII

guard = Guard().use(DetectPII)

No account, API key, or hub login is needed — every validator is a plain PyPI package.

The full catalog is All Hub Validators below. It is generated from each package's pyproject.toml by scripts/generate_validators_index.py and is consumed programmatically by the validator hub UI, so its format is a contract — see the script's docstring before changing it. Regenerate after adding a validator or editing its description/tags:

python scripts/generate_validators_index.py

All Hub Validators

65 validators. Each is a standalone PyPI package — install it with pip install <package>; no account, API key, or hub login is required.

  • Ban List: Validates that the output does not contain banned words, using fuzzy search. Code
  • Bert Toxic Language Validator: Validates that the input string does not contain toxic language based on a BERT model. Code
  • Bias Check: Validates that the text is free from biases related to age, gender, sex, ethnicity, religion, etc. Code
  • Competitor Check: Flags mentions of competitors. Fixes responses by filtering out competitor names. Code
  • Contains String: A Guardrails AI validator to check if the LLM-generated text contains a substring. Code
  • Cucumber Expression Match: Validates that the input string matches a specified cucumber expression. Code
  • Detect Jailbreak: Detects attempts to circumvent safeguards in model conditioning. Code
  • Detect PII: Detects personally identifiable information (PII) in text, using Microsoft Presidio. Code
  • Detect Prompt Injection: Finds prompt injection using the Rebuff prompt library. Code
  • Detect System Prompt Leakage: Detects system prompt leakage using fuzzy string matching (via rapidfuzz) to compare the LLM's response against a provided system prompt. Code
  • Endpoint Is Reachable: Checks if an endpoint can be reached by making a request to it. Code
  • Ends With: Check if a string or list ends with a specified string or list. Code
  • Exclude SQL Predicates: This rule checks for the use of particular SQL predicates in the query. It is important to exclude SQL predicates from the query to prevent SQL injection attacks. Code
  • Extracted Summary Sentences Match: This validator checks if the extracted summary sentences match the original document. Code
  • Gibberish Text: A Guardrails AI validator to detect gibberish text. Code
  • Guardrails PII: Detects personally identifiable information (PII) in text. Code
  • Has Url: Ensure content contains a url. Code
  • Internal Domains: Identifies internal domains in a string output. Code
  • Llama Guard: A llama based validator which checks whether a given prompt is safe/unsafe by specifying a set of policies and lists the violating policies when applicable. Code
  • LLM Critic: Grade the generated response based on provided criteria. Code
  • Logic Check: Validates logical consistency and detects logical fallacies in the model output. Attempts to correct logical fallacies if found. Code
  • Lowercase: Passes when totally lowercase. Code
  • Mentions Drugs: Validates that the generated text does not contain any drug names. Code
  • NSFW Text: A Guardrails AI validator to detect NSFW text. Code
  • One Line: This validator checks if the input is a single line of text. Code
  • Politeness Check: Ensure generated output is polite. Code
  • Presidio Gliner PII: Detects personally identifiable information (PII) in text. Code
  • Profanity Free: Checks for profanity in text, using the alt-profanity-check library. Code
  • Prompt Injection Detector: A Guardrails validator that scores prompts for injection attempts via a secondary LLM. Code
  • Provenance Embeddings: Compares embeddings of generated and source texts to calculate provenance. Code
  • Provenance LLM: A validator for ensuring the factuality and reducing brand risk in generated content. Code
  • Provenance NLI: Detects and removes hallucinations from LLM-generated text using an NLI model to validate it against a provided context. Code
  • QA Relevance LLM Eval: Makes a second request to the LLM, asking it if its original response was relevant to the prompt. Code
  • Quotes Price: Validates that the generated text contains a price quote. Code
  • Reading Level: Parses text to find its readability as a US grade level number (0-12). Code
  • Reading Time: Ensures that any generated text is less than a maximum expected reading time. Code
  • Redundant Sentences: Identifies redundant sentences in text using fuzzy matching. Code
  • Regex Match: Ensure content matches a provided regular expression. This can be used to validate content such as email addresses, phone numbers, and more. Code
  • Relevancy Evaluator: Validates that the reference text contains information relevant to answering the original question. Code
  • Response Evaluator: Evaluate generated output using a provided question. Code
  • Responsiveness Check: Ensure generated output is polite. Code
  • Restrict To Topic: Checks that a text stays on a set of valid topics and avoids invalid ones. Code
  • Saliency Check: Checks if a generated summary covers topics present in a source document. Code
  • Secrets Present: Detects the secrets present in text by matching against common patterns for API keys and other sensitive information. Code
  • Sensitive Topic: A Guardrails AI validator that detects sensitive topics in text. Code
  • Shield Gemma: A Gemma based validator for moderating user prompts to guard against harmful content by specifying a policy. Code
  • Similar To Document: Checks if some generated text is similar to a provided document. Code
  • Similar To Previous Values: Checks if a value is similar to a list of previously known correct values. Code
  • Sky Validator: Validates that the input string does not contain negative statements about Sky Electric. Code
  • Toxic Language: Identifies and flags toxic language in text to ensure communications remain professional and appropriate. Code
  • Toxic Language LLM: Detects toxic language in LLM-generated text using an LLM as the detection backbone. Evaluates text across seven toxicity categories: toxicity, severe toxicity, obscene, threat, insult, identity attack, and sexual explicit content. Code
  • Two Words: Passes when value is exactly two words. Code
  • Unusual Prompt: A Guardrails AI input validator that validates a prompt for unusualness and trickery. Code
  • Uppercase: Passes when totally uppercase. Code
  • Valid Address: Verifies an LLM-generated address using Google Maps' Address Validation API. Code
  • Valid Choices: Checks if a given string is a valid choice from a list of choices. Code
  • Valid HTML: Guardrails validator that checks for HTML parseability. Code
  • Valid JSON: Ensure content is parseable as valid JSON. Code
  • Valid Length: Ensures the length of a string or list falls between a minimum and maximum. Code
  • Valid OpenAPI Specification: Ensures that a generated output is a valid OpenAPI Specification. Code
  • Valid Range: Assess whether a generated number is between a maximum and minimum value. Code
  • Valid SQL: Validates whether the given SQL code is syntactically correct using. Optionally accepts a database schema to validate against using SQLAlchemy. Code
  • Valid URL: Validates that text is a syntactically-valid URL. Code
  • Web Sanitization: Scans LLM outputs for strings that could cause browser script execution downstream. Code
  • Wiki Provenance: A Guardrails AI validator that detects and removes hallucinated text based off Wikipedia. Code

Layout

Each validator is a self-contained package at the repo root:

<name>/
└── py/
    ├── pyproject.toml            # name = guardrails-ai-<name>, license = MIT
    ├── Makefile                  # install / lint / type / test / license-check
    ├── pyrightconfig.json, .coveragerc, LICENSE (MIT), README.md
    ├── src/guardrails_ai/<name>/ # importable as guardrails_ai.<name> (PEP 420, no __init__ at namespace root)
    └── tests/
  • Dist name: guardrails-ai-<name> (underscores → dashes).
  • Import: from guardrails_ai.<name> import <Export>.
  • Registered validator name is unchanged: @register_validator(name="guardrails/<name>"), so existing guards keep working.
  • Versioning: independent per package; a release is gated by the git tag <name>-py-<version>.

Developing a validator

From <name>/py in a fresh virtual environment:

python -m venv .venv && . .venv/bin/activate
make install install-dev
make lint             # ruff
make type             # pyright
make test             # pytest ./tests
make license-check    # license sweep (MIT-only dependency trees)

Adding a validator

Create a new <name>/py/ package following the layout above: an MIT-licensed pyproject.toml named guardrails-ai-<name>, source under src/guardrails_ai/<name>/, and tests. CI picks it up automatically via the */py/** path filters.

Dependency locks

Each package pins its fully resolved dependency tree in py/requirements.lock for reproducible installs — universal locks, valid across platforms and Python 3.10-3.13. sensitive_topics has no lock yet: it depends on guardrails-ai-restricttotopic, which is not yet on PyPI, so its lock will generate once that package is published.

Regenerate them with uv:

./scripts/generate_locks.sh

Licensing

Every validator package is MIT and must depend only on permissively licensed packages. The merge-blocking license sweep (make license-check, wired into validators_pr_qc.yml) reads the allowlist in .licenses-allow.txt and the documented, manually reviewed exceptions in .licenses-exceptions.txt.

CI

  • .github/workflows/validators_pr_qc.yml — change-detected matrix ({changed validator} × {py 3.10–3.13}): install, lint, type, tests, license sweep.
  • .github/workflows/validators_publish.yml — change-detected trusted publishing to public PyPI via OIDC (no tokens), with a version-bump guard and git tagging.
  • .github/workflows/bootstrap_publish.yml — one-time token-auth publish that creates the PyPI projects, before per-project trusted publishers are bound.
  • .github/dependabot.yml — weekly pip (all /*/py) + github-actions updates.

Contributors

zsimjee

13 commits

Languages

Python

91.4%

Makefile

8.4%