Examples
Ready-to-run examples demonstrating Guardrails in various scenarios. See the guardrails/examples/
folder for complete implementations.
Example Implementations
- hello_world.py — Basic pipeline configuration with input/output guardrails
- agents_sdk.py — Integration with OpenAI Agents SDK
- pii_mask_example.py — PII detection and scrubbing
- structured_outputs_example.py — Using responses.parse with guardrails
- Streaming — Stream output while guardrails run
- Blocking — Validate fully before showing output
Hallucination Detection Example
Complete implementation using real documents as knowledge sources:
examples/hallucination_detection/
Getting Started
- Follow the Quickstart guide: Python
- Explore repositories: Python examples
- Run scripts to see Guardrails in action
Each example is self-contained with clear configuration and usage patterns.