Skip to content

Commit 451be8f

Browse files
removed duplicate
1 parent 86d8f6b commit 451be8f

File tree

1 file changed

+0
-67
lines changed

1 file changed

+0
-67
lines changed

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

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,6 @@ sidebar:
55
order: 3
66
---
77

8-
AI Gateway inspects all interactions in real time by evaluating content against predefined safety parameters. Below a breakdown of the process:
9-
10-
1. Intercepting interactions:
11-
AI Gateway proxies requests and responses, sitting between the user and the AI model.
12-
13-
2. Inspecting content:
14-
15-
- User prompts: AI Gateway checks prompts against safety parameters (for example, violence, hate, or sexual content). Based on your settings, prompts can be flagged or blocked before reaching the model.
16-
- Model responses: Once processed, the AI model response is inspected. If hazardous content is detected, it can be flagged or blocked before being delivered to the user.
17-
18-
3. Applying actions:
19-
Depending on your configuration, flagged content is logged for review, while blocked content is prevented from proceeding.
20-
218
## Supported model types
229

2310
AI Gateway's Guardrails detects the type of AI model being used and applies safety checks accordingly:
@@ -48,58 +35,4 @@ Since Guardrails runs on Workers AI, enabling it incurs usage on Workers AI. You
4835

4936
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.
5037

51-
## :::
52-
53-
pcx_content_type: how-to
54-
title: How Guardrails works
55-
sidebar:
56-
order: 3
57-
58-
---
59-
60-
AI Gateway inspects all interactions in real time by evaluating content against predefined safety parameters. Below a breakdown of the process:
61-
62-
1. Intercepting interactions:
63-
AI Gateway proxies requests and responses, sitting between the user and the AI model.
64-
65-
2. Inspecting content:
66-
67-
- User prompts: AI Gateway checks prompts against safety parameters (for example, violence, hate, or sexual content). Based on your settings, prompts can be flagged or blocked before reaching the model.
68-
- Model responses: Once processed, the AI model response is inspected. If hazardous content is detected, it can be flagged or blocked before being delivered to the user.
69-
70-
3. Applying actions:
71-
Depending on your configuration, flagged content is logged for review, while blocked content is prevented from proceeding.
72-
73-
## Supported model types
74-
75-
Guardrails determines the type of AI model being used and applies safety checks accordingly:
76-
77-
- Text generation models: Both prompts and responses are evaluated.
78-
- Embedding models: Only the prompt is evaluated, and the response is passed directly back to the user.
79-
- Unknown models: If the model type cannot be determined, prompts are evaluated, but responses bypass Guardrails.
80-
81-
If Guardrails cannot access the underlying model, requests set to "block" will result in an error, while flagged requests will proceed.
82-
83-
## Configuration
84-
85-
Within AI Gateway settings, you can customize Guardrails:
86-
87-
- Enable or disable content moderation.
88-
- Choose evaluation scope: Analyze user prompts, model responses, or both.
89-
- Define hazard categories: Select categories like violence, hate, or sexual content and assign actions (ignore, flag, or block).
90-
91-
## Workers AI and Guardrails
92-
93-
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.
94-
95-
Since Guardrails runs on Workers AI, enabling it incurs usage on Workers AI. You can monitor usage through the Workers AI Dashboard.
96-
97-
## Additional considerations
98-
99-
- Latency impact: Enabling Guardrails adds some latency. Consider this when balancing safety and speed.
100-
101-
:::note
102-
103-
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.
104-
10538
:::

0 commit comments

Comments
 (0)