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 Remote Guard Connection

From Leeroopedia
Knowledge Sources
Domains Client_Server, API
Last Updated 2026-02-14 00:00 GMT

Overview

A client-server connection principle for fetching and using Guards from a remote Guardrails API server.

Description

Remote Guard Connection enables client applications to use Guards defined on a remote server without local validator installation or configuration. The client loads a Guard by name from the server, receiving a proxy Guard that routes all validation calls to the server's REST API. This creates a clear separation between Guard definition (server-side) and Guard usage (client-side).

This pattern enables centralized Guard management where a single server hosts all validation logic, and multiple client applications consume it without needing local validator dependencies.

Usage

Use Guard.load(name=...) to fetch a Guard from a running Guardrails server. Subsequent calls to the loaded Guard are automatically proxied to the server.

Theoretical Basis

The client-server pattern:

  1. Fetch: Client calls Guard.load(name, base_url) to fetch Guard metadata from server
  2. Configure: Client Guard instance is configured with _use_server=True and an API client
  3. Proxy: Subsequent guard(...) calls are routed to the server via GuardrailsApiClient.validate()
  4. Return: Server executes validation and returns ValidationOutcome to client

Related Pages

Implemented By

Uses Heuristic

Page Connections

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