# Examples

Ready-to-run examples demonstrating Guardrails in various scenarios. See the [`guardrails/examples/`](https://github.com/openai/openai-guardrails-python/tree/main/examples/) folder for complete implementations.

## Example Implementations

- [hello_world.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/hello_world.py) — Basic pipeline configuration with input/output guardrails
- [agents_sdk.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/agents_sdk.py) — Integration with OpenAI Agents SDK
- [pii_mask_example.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/pii_mask_example.py) — PII detection and scrubbing
- [structured_outputs_example.py](https://github.com/openai/openai-guardrails-python/tree/main/examples/basic/structured_outputs_example.py) — Using responses.parse with guardrails
- [Streaming](https://github.com/openai/openai-guardrails-python/tree/main/examples/implementation_code/streaming) — Stream output while guardrails run
- [Blocking](https://github.com/openai/openai-guardrails-python/tree/main/examples/implementation_code/blocking) — Validate fully before showing output

## Hallucination Detection Example

Complete implementation using real documents as knowledge sources:
[`examples/hallucination_detection/`](https://github.com/openai/openai-guardrails-python/tree/main/examples/hallucination_detection)

## Getting Started

1. Follow the Quickstart guide: [Python](./quickstart.md)
2. Explore repositories: [Python examples](https://github.com/openai/openai-guardrails-python/tree/main/examples/)
3. Run scripts to see Guardrails in action

Each example is self-contained with clear configuration and usage patterns.
