Configuration Structure
Guardrails are configured in your Hub YAML configuration file. The configuration has three main sections:- Providers - Define guardrail evaluation services
- Guards - Configure individual guardrail instances
- Pipelines - Attach guards to specific pipelines
Provider Configuration
Providers are the services that can execute guardrails. Define your providers first, then reference them in guard configurations.Traceloop Provider
Guard Definition
Guards are configured instances of evaluators. Each guard defines what to check, when to check it, and how to respond to failures.Complete Guard Configuration
Guard Fields Reference
Mode: Pre-call vs Post-call
pre_call - Executes on user input before the LLM call:
post_call - Executes on LLM output after the response:
Some evaluators work best in specific modes (e.g., prompt-injection in pre_call), while others are valuable in both modes (e.g., pii-detector). See the Evaluators Reference for recommendations.
On Failure: Block vs Warn
block - Return HTTP 403 when evaluation fails:
warn - Add warning header but continue:
Required: Fail-Closed vs Fail-Open
Therequired flag controls behavior when the evaluator service is unavailable, times out, or errors.
Default: false
required: true (Fail-Closed) - Treat evaluator errors as failures:
required: false (Fail-Open) - Continue when evaluator errors:
Parameters
Each evaluator accepts specific configuration parameters. Common parameters include:Pipeline Integration
Attach guards to pipelines to enable guardrails for specific endpoints. Each pipeline request will perform the attached guards.Basic Pipeline Configuration
Multiple Pipelines with Different Guards
Runtime Guard Control
Add additional guards at runtime using thex-traceloop-guardrails header with a comma-separated list of guard names.
This is additive only - you cannot remove pipeline guards via headers.
You can configure pipelines with no guards and rely entirely on the header to specify which guards to run. This provides maximum flexibility for dynamic guard selection per request.
Header Format
Next Steps
Evaluators Reference
Complete reference for all 12 evaluators with parameters

