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