Set up Guardrails
Add Guardrails to any gateway to start evaluating and potentially modifying responses.
- Log into the Cloudflare dashboard ↗ and select your account.
- Go to AI > AI Gateway.
- Select a gateway.
- Go to Guardrails.
- Switch the toggle to On.
- To customize categories, select Change > Configure specific categories.
- Update your choices for how Guardrails works on specific prompts or responses (Flag, Ignore, Block).
- For Prompts: Guardrails will evaluate and transform incoming prompts based on your security policies.
- For Responses: Guardrails will inspect the model's responses to ensure they meet your content and formatting guidelines.
- Select Save.
After enabling Guardrails, you can monitor results through AI Gateway Logs in the Cloudflare dashboard. Guardrail logs are marked with a green shield icon, and each logged request includes an eventID
, which links to its corresponding Guardrail evaluation log(s) for easy tracking. Logs are generated for all requests, including those that pass Guardrail checks.
Was this helpful?
- Resources
- API
- New to Cloudflare?
- Products
- Sponsorships
- Open Source
- Support
- Help Center
- System Status
- Compliance
- GDPR
- Company
- cloudflare.com
- Our team
- Careers
- 2025 Cloudflare, Inc.
- Privacy Policy
- Terms of Use
- Report Security Issues
- Trademark