Skip to content

Commit f0b8527

Browse files
Merge branch 'aig-guardrails' of https://github.com/cloudflare/cloudflare-docs into aig-guardrails
2 parents 728c906 + c1378e9 commit f0b8527

File tree

1 file changed

+14
-5
lines changed

1 file changed

+14
-5
lines changed

src/content/docs/ai-gateway/guardrails/set-up-guardrail.mdx

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,18 +13,27 @@ Within AI Gateway settings, you can customize Guardrails:
1313
- Choose evaluation scope: Analyze user prompts, model responses, or both.
1414
- Define hazard categories: Select categories like violence, hate, or sexual content and assign actions (ignore, flag, or block).
1515

16-
## Workers AI and Guardrails
16+
## Supported model types
1717

18-
Guardrails currently uses [Llama Guard 3 8B](https://ai.meta.com/research/publications/llama-guard-llm-based-input-output-safeguard-for-human-ai-conversations/) on [Workers AI](/workers-ai/) to perform content evaluations. The underlying model may be updated in the future, and we will reflect those changes within Guardrails.
18+
AI Gateway's Guardrails detects the type of AI model being used and applies safety checks accordingly:
1919

20-
Since Guardrails runs on Workers AI, enabling it incurs usage on Workers AI. You can monitor usage through the Workers AI Dashboard.
20+
- **Text generation models**: Both prompts and responses are evaluated.
21+
- **Embedding models**: Only the prompt is evaluated, as the response consists of numerical embeddings, which are not meaningful for moderation.
22+
- **Unknown models**: If the model type cannot be determined, only the prompt is evaluated, while the response bypass Guardrails.
2123

22-
## Additional considerations
24+
## Workers AI and Guardrails
2325

24-
- Latency impact: Enabling Guardrails adds some latency. Consider this when balancing safety and speed.
26+
Guardrails currently uses [Llama Guard 3 8B](https://ai.meta.com/research/publications/llama-guard-llm-based-input-output-safeguard-for-human-ai-conversations/) on [Workers AI](/workers-ai/) to perform content evaluations. The underlying model may be updated in the future, and we will reflect those changes within Guardrails.
27+
28+
Since Guardrails runs on Workers AI, enabling it incurs usage on Workers AI. You can monitor usage through the [Workers AI Dashboard](https://dash.cloudflare.com/?to=/:account/ai/workers-ai).
2529

2630
:::note
2731

32+
2833
Llama Guard is provided as-is without any representations, warranties, or guarantees. Any rules or examples contained in blogs, developer docs, or other reference materials are provided for informational purposes only. You acknowledge and understand that you are responsible for the results and outcomes of your use of AI Gateway.
2934

3035
:::
36+
37+
## Additional considerations
38+
39+
- Latency impact: Enabling Guardrails adds some latency. Consider this when balancing safety and speed.

0 commit comments

Comments
 (0)