Principle:Guardrails ai Guardrails Remote Guard Connection
| 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:
- Fetch: Client calls Guard.load(name, base_url) to fetch Guard metadata from server
- Configure: Client Guard instance is configured with _use_server=True and an API client
- Proxy: Subsequent guard(...) calls are routed to the server via GuardrailsApiClient.validate()
- Return: Server executes validation and returns ValidationOutcome to client