> For the complete documentation index, see [llms.txt](https://docs.otari.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.otari.ai/how-to-guides/manage-guardrails.md).

# Manage guardrails

Create guardrails that monitor or block unsafe requests across workspaces.

Guardrails evaluate model traffic before it reaches a provider. Use them to detect content that violates your safety or compliance requirements.

A guardrail can monitor matching requests or block them, and can be applied to the entire organization or only to selected workspaces.

For supported guardrails and provider-specific settings, see the [guardrail catalog](https://docs.mozilla.ai/any-guardrail/api-reference/index).

***

### Configure a guardrail

Only organization owners and admins can add, edit, or delete guardrails.

1. From the dashboard, open **Organization** → **Guardrails**.
2. Click **Configure guardrail**.
3. Follow the steps in the setup wizard:
   1. Select the type of risk you want to detect, such as bias, hallucination, content safety, PII, or toxicity.
   2. Choose a guardrail from the catalog for that check.
   3. Give the guardrail a name.
   4. Enter an API key, if any. Enter `None` to use the key from the guardrail’s environment variable.
   5. Complete the remaining configuration steps. These may vary depending on the guardrail provider you selected.
4. Click **Configure guardrail** to save your settings.

***

### Mandate a guardrail

Each guardrail can be applied across the entire organization or to specific workspaces. You can configure it to either **block requests** or **monitor them** without blocking. Once mandated, the guardrail will run on every request from the selected workspaces.

1. In Guardrails, click **Mandate a guardrail**.
2. Choose whether you want to use a guardrail configured from the catalog or your own guardrail service.
3. If using a guardrail from the catalog:
   * Select a guardrail you previously configured.
   * Give the check a name that will identify it in requests.
   * Choose whether the guardrail should **block** requests or **monitor** them only.
   * Choose what should happen if the guardrail can’t run: **refuse the request** or **serve it unchecked**. Note that only blocking guardrails can refuse requests; monitoring guardrails will always serve them.
   * Select the workspaces where the guardrail should run.
4. If using your own guardrail service:
   * Select the guardrail profile.
   * Enter the guardrail credential.
   * Complete the remaining configuration steps described above.
5. Click **Mandate a guardrail** to save your settings.

***

### Test a guardrail <a href="#h_e505ea8820" id="h_e505ea8820"></a>

Before applying a guardrail, you can test how it evaluates specific content. Enter the text you want to check, and the guardrail will process it just as it would a real request. Nothing entered during the test is saved. To test a guardrail:

1. In **Guardrails**, select the guardrail you want to test by clicking on the **test icon**.
2. Enter the **text you want to check** against the guardrail.
3. Optionally, add a **model output** if you want to test checks that evaluate responses, such as hallucination or compliance.
4. Optionally, add **context documents in JSON format**, such as retrieved RAG passages.
5. Click **Run test** to see how the guardrail evaluates the content. Nothing from the test is saved.

***

### Edit or delete a guardrail <a href="#h_866cc5959f" id="h_866cc5959f"></a>

In **Guardrails**, select the guardrail you want to update and click the **Edit** icon to modify its credentials or configuration parameters.

To delete a guardrail, make sure it is no longer mandated. If the guardrail is still in use, go to the **Where to run section**, select the relevant mandate, and click the **Delete** icon to remove it. Once all mandates have been removed, you can delete the guardrail itself.

{% hint style="warning" %}
Deleting a guardrail is permanent and cannot be undone. Make sure you no longer need the guardrail before confirming the deletion.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.otari.ai/how-to-guides/manage-guardrails.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
