Keep AI interactions secure and risk-free with Guardrails in AI Gateway
Feb 26, 2025Kathy Liao

Summary
This post introduces Guardrails in AI Gateway, a new feature that integrates Llama Guard 3 8B, hosted on Workers AI, for content moderation of AI interactions. Guardrails allows developers to configure evaluation scope (prompts, responses, or both) and specify hazard categories to block or flag. The implementation leverages the AI Binding for seamless integration with Workers and Workers AI, and includes eventID for traceability. The post details how Guardrails prevents harmful prompts from reaching models and inspects responses, providing examples of blocked prompts and the underlying Llama Guard evaluation.
More from the Artificial Intelligence Integration & Impact trail
- Introducing Clef-omni with full multimodality, plus a faster Clef and a cheaper Clef-flash
- Introducing Web Search API via AI Gateway
- Introducing Clef: our open-source decision models, and new RL fine-tuning platform
- One year later: Sovereign AI and the fight for choice
- AI Search is now generally available