Principle:Guardrails ai Guardrails Server Config Scaffolding
| Knowledge Sources | |
|---|---|
| Domains | Deployment, Configuration |
| Last Updated | 2026-02-14 00:00 GMT |
Overview
A scaffolding principle for generating server-ready Guard configuration files from Hub validator selections.
Description
Server Config Scaffolding generates a config.py file that defines Guards with their validators for use with the Guardrails API server. The configuration file serves as the server's initialization script, loaded at startup to register Guards that become available as REST endpoints. This uses the same guardrails create CLI command but in the context of server deployment rather than Hub submission.
Usage
Use guardrails create to generate a server config file, then customize the TODO placeholders with appropriate validator parameters before starting the server with guardrails start --config config.py.
Theoretical Basis
The config-file pattern for server deployment:
- Scaffold: guardrails create generates config.py with validator imports and Guard setup
- Customize: Replace TODO markers with real parameters
- Load: guardrails start --config loads the file at server startup
- Serve: Each Guard becomes a REST endpoint at /guards/{name}/validate