

本文為英文版的機器翻譯版本，如內容有任何歧義或不一致之處，概以英文版為準。

# 透過將防護機制與代理程式建立關聯，為您的應用程式實作保護措施
<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)。