Jump to content

Connect Leeroopedia MCP: Equip your AI agents to search best practices, build plans, verify code, diagnose failures, and look up hyperparameter defaults.

Principle:Guardrails ai Guardrails Validator Installation

From Leeroopedia
Knowledge Sources
Domains Package_Management, Validation
Last Updated 2026-02-14 00:00 GMT

Overview

A package management principle for discovering and installing validator modules from a centralized Hub into the local environment.

Description

Validator Installation is the process of resolving, downloading, and registering validator packages from the Guardrails Hub marketplace. Each validator is an independent Python package identified by a Hub URI (e.g., hub://guardrails/regex_match) that can optionally include version specifiers. The installation process fetches a manifest from the Hub, installs the package via pip, optionally downloads local ML models, and registers the validator's exports so they become importable through the guardrails.hub namespace.

This principle follows a plugin architecture pattern where functionality is distributed as independently installable packages, allowing the framework to remain lightweight while supporting a growing ecosystem of validators.

Usage

Apply this principle whenever you need to add validation capabilities beyond what is available in the base framework. Common scenarios include adding content safety checks, format validation (regex, JSON schema), or ML-based output quality checks.

Theoretical Basis

The installation pipeline follows these stages:

  1. URI Resolution: Parse the Hub URI to extract validator identifier and optional version constraint
  2. Manifest Fetch: Retrieve package metadata from the Hub service (dependencies, model requirements)
  3. Package Install: Use pip to install the validator as a Python package from the Hub's git repository
  4. Model Download: Optionally download ML model files for validators that run inference locally
  5. Registration: The validator's __validator_exports__ attribute registers the validator class in the global validators registry

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment