OpenViSTAI · Agents · Blockchain · Crypto
Menu
AI Developer Tools & SDKs

Guardrails

Guardrails is an open-source Python framework for adding configurable input and output checks to large language model applications and generating structured data from model responses.

Independent OpenViST project profile, based on linked sources.

Guardrails — OpenViST project profile in AI Developer Tools & SDKs.
OpenViST project illustration. See the linked sources for product details.
Understand the project

Practical overview

When it fits

Use Guardrails when building a Python LLM application that needs selected checks around model interactions or a defined structure for generated responses.

Who it is for

  • Python developers building applications that use large language models.
  • Teams that need to validate model inputs or outputs with selected validators.
  • Developers who want LLM responses shaped to a Pydantic data model.

Documented uses

  • Add a configurable validation layer around LLM inputs and outputs.
  • Combine validators to detect specified conditions in text and define how validation failures are handled.
  • Shape model responses to a defined structured-data model.
Before you choose

Requirements & limits

The repository is public and identifies the project as Apache-2.0 licensed. The README documents installation through pip.

  • The core workflow is Python-based and involves installing the library and any required validator packages.
  • Validators are selected and combined into guards, so the checks depend on the validators chosen for the application.
  • Structured-output setup uses a Pydantic model; the README describes function calling for models that support it.

Check current requirements in the official documentation. Source-based guidance does not mean OpenViST has run or independently tested this project.

Source-based practical guide

Install the Guardrails library and configure a validator

Set up the Python package, install a documented validator, and create a guard that validates text against a regular expression.

Before you start

  • Python environment with pip
  • Access to install the Guardrails package and a validator package

Steps

  1. Install the library with the command below.

    Documented command
    pip install guardrails-ai
  2. Run guardrails configure to configure the Guardrails Hub CLI.

  3. Install the regex validator with the command below.

    Documented command
    pip install guardrails-ai-regex-match
  4. Create a Guard using RegexMatch and call guard.validate() on text.

Expected outcome

A configured guard validates text against the chosen regular expression and can raise an exception when validation fails.

Guide limitations

  • The example validates a specific phone-number pattern; it does not establish that the pattern is appropriate for every application.
  • The example shows validation behavior, not integration with a particular production model or deployment.
Source-based practical guide

Define a structured output shape for an LLM response

Create a Pydantic model and use it as the structure for a Guard that formats LLM output.

Before you start

  • Python environment
  • Pydantic
  • An LLM interaction supported by the chosen approach

Steps

  1. Define a Pydantic BaseModel with the fields required in the response.

  2. Create a Guard from that model.

  3. Use the Guard in the LLM interaction to request output formatted to the model.

Expected outcome

The Guard is configured to shape the model response according to the defined data structure.

Guide limitations

  • It describes function calling for models that support it and does not specify the alternative method in the available instructions.
Evidence and transparency

Sources & review

Source record details
Source availability
Active
Sources checked
7 October 2026
Original website title
guardrails-ai/guardrails · Official homepage title · retained in its source language