

本文属于机器翻译版本。若本译文内容与英语原文存在差异，则一律以英文原文为准。

# 通过将护栏与代理关联为应用程序实施保护措施
<a name="agents-guardrail"></a>

要实施保护措施并防止模型响应或用户消息中出现不良行为，请将护栏与代理关联起来。要详细了解护栏以及如何创建护栏，请参阅 [使用 Amazon Bedrock 护栏检测和筛选掉有害内容](guardrails.md)。

您可以在[创建](agents-create.md)或[更新](agents-edit.md)代理时将护栏与代理关联起来。在 Amazon Bedrock 控制台中，您可以在**代理生成器**的**护栏详细信息**部分添加护栏。在 Amazon Bedrock API 中，您可以在发送 [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgent.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_CreateAgent.html) 或 [https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgent.html](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_UpdateAgent.html) 请求时指定 [GuardrailConfiguration](https://docs.aws.amazon.com/bedrock/latest/APIReference/API_agent_GuardrailConfiguration.html)。