> For the complete documentation index, see [llms.txt](https://docs.convai.com/api-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.convai.com/api-docs/zh/convai-playground/character-customization/guardrails.md).

# 安全护栏

“安全护栏”选项卡是一个安全与控制界面，用于限制和引导角色的 AI 行为。它允许创建者定义对话的道德与主题边界。

{% hint style="danger" %}
此 API 仅适用于付费方案。
{% endhint %}

## 简介

该 **护栏选项卡** 提供了一个强大的控制界面，用于定义你角色的伦理和主题边界，防止跑题或不恰当的回应。通过在“说明”字段中输入具体约束并开启自定义护栏，你可以确保 AI 角色以安全且专业的方式作出回应，并且严格符合你预期的品牌声音。

<figure><img src="https://2402152281-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FEtUJA212Zc1S9ACc8T4l%2Fuploads%2FKEG3pfFfGykYRAfeqgOa%2FScreenshot%202026-04-15%20at%2012.02.30%E2%80%AFPM.png?alt=media&amp;token=8949477f-54ca-4b79-ab22-e15843a5ce2a" alt=""><figcaption></figcaption></figure>

## 主要功能与部分

### 1. 自定义护栏开关

此开关充当总开关，用于启用或停用你角色的安全监督。启用后，它会强制 AI 角色优先遵循你的特定行为规则，而不是其通用的对话逻辑。

### 2. 护栏说明

此文本字段允许你使用最多 7,500 个词来定义明确的安全规则和回应边界。你可以在这里输入诸如“不要谈论政治”之类的约束，以确保角色保持专业并紧扣主题。

## 示例

此示例展示了你如何在 Convai Playground 中为你的 AI 角色实施护栏

{% embed url="<https://youtu.be/dfosB0XYiOo>" %}

***

## 结论

护栏选项卡是一项重要的安全工具，使创作者能够对其 AI 角色施加严格的行为边界和内容限制。通过将自定义说明与实时测试相结合，它可确保互动保持安全、符合品牌调性，并避免不受欢迎的主题或幻觉。


---

# 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.convai.com/api-docs/zh/convai-playground/character-customization/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.
