Cookie の設定を選択する

当社は、当社のサイトおよびサービスを提供するために必要な必須 Cookie および類似のツールを使用しています。当社は、パフォーマンス Cookie を使用して匿名の統計情報を収集することで、お客様が当社のサイトをどのように利用しているかを把握し、改善に役立てています。必須 Cookie は無効化できませんが、[カスタマイズ] または [拒否] をクリックしてパフォーマンス Cookie を拒否することはできます。

お客様が同意した場合、AWS および承認された第三者は、Cookie を使用して便利なサイト機能を提供したり、お客様の選択を記憶したり、関連する広告を含む関連コンテンツを表示したりします。すべての必須ではない Cookie を受け入れるか拒否するには、[受け入れる] または [拒否] をクリックしてください。より詳細な選択を行うには、[カスタマイズ] をクリックしてください。

ApplyGuardrail - Amazon Bedrock
このページはお客様の言語に翻訳されていません。 翻訳のリクエスト

ApplyGuardrail

The action to apply a guardrail.

For troubleshooting some of the common errors you might encounter when using the ApplyGuardrail API, see Troubleshooting Amazon Bedrock API Error Codes in the Amazon Bedrock User Guide

Request Syntax

POST /guardrail/guardrailIdentifier/version/guardrailVersion/apply HTTP/1.1 Content-type: application/json { "content": [ { ... } ], "source": "string" }

URI Request Parameters

The request uses the following URI parameters.

guardrailIdentifier

The guardrail identifier used in the request to apply the guardrail.

Length Constraints: Minimum length of 0. Maximum length of 2048.

Pattern: ^(([a-z0-9]+)|(arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:guardrail/[a-z0-9]+))$

Required: Yes

guardrailVersion

The guardrail version used in the request to apply the guardrail.

Pattern: ^(([1-9][0-9]{0,7})|(DRAFT))$

Required: Yes

Request Body

The request accepts the following data in JSON format.

content

The content details used in the request to apply the guardrail.

Type: Array of GuardrailContentBlock objects

Required: Yes

source

The source of data used in the request to apply the guardrail.

Type: String

Valid Values: INPUT | OUTPUT

Required: Yes

Response Syntax

HTTP/1.1 200 Content-type: application/json { "action": "string", "assessments": [ { "contentPolicy": { "filters": [ { "action": "string", "confidence": "string", "filterStrength": "string", "type": "string" } ] }, "contextualGroundingPolicy": { "filters": [ { "action": "string", "score": number, "threshold": number, "type": "string" } ] }, "invocationMetrics": { "guardrailCoverage": { "images": { "guarded": number, "total": number }, "textCharacters": { "guarded": number, "total": number } }, "guardrailProcessingLatency": number, "usage": { "contentPolicyImageUnits": number, "contentPolicyUnits": number, "contextualGroundingPolicyUnits": number, "sensitiveInformationPolicyFreeUnits": number, "sensitiveInformationPolicyUnits": number, "topicPolicyUnits": number, "wordPolicyUnits": number } }, "sensitiveInformationPolicy": { "piiEntities": [ { "action": "string", "match": "string", "type": "string" } ], "regexes": [ { "action": "string", "match": "string", "name": "string", "regex": "string" } ] }, "topicPolicy": { "topics": [ { "action": "string", "name": "string", "type": "string" } ] }, "wordPolicy": { "customWords": [ { "action": "string", "match": "string" } ], "managedWordLists": [ { "action": "string", "match": "string", "type": "string" } ] } } ], "guardrailCoverage": { "images": { "guarded": number, "total": number }, "textCharacters": { "guarded": number, "total": number } }, "outputs": [ { "text": "string" } ], "usage": { "contentPolicyImageUnits": number, "contentPolicyUnits": number, "contextualGroundingPolicyUnits": number, "sensitiveInformationPolicyFreeUnits": number, "sensitiveInformationPolicyUnits": number, "topicPolicyUnits": number, "wordPolicyUnits": number } }

Response Elements

If the action is successful, the service sends back an HTTP 200 response.

The following data is returned in JSON format by the service.

action

The action taken in the response from the guardrail.

Type: String

Valid Values: NONE | GUARDRAIL_INTERVENED

assessments

The assessment details in the response from the guardrail.

Type: Array of GuardrailAssessment objects

guardrailCoverage

The guardrail coverage details in the apply guardrail response.

Type: GuardrailCoverage object

outputs

The output details in the response from the guardrail.

Type: Array of GuardrailOutputContent objects

usage

The usage details in the response from the guardrail.

Type: GuardrailUsage object

Errors

For information about the errors that are common to all actions, see Common Errors.

AccessDeniedException

The request is denied because you do not have sufficient permissions to perform the requested action. For troubleshooting this error, see AccessDeniedException in the Amazon Bedrock User Guide

HTTP Status Code: 403

InternalServerException

An internal server error occurred. For troubleshooting this error, see InternalFailure in the Amazon Bedrock User Guide

HTTP Status Code: 500

ResourceNotFoundException

The specified resource ARN was not found. For troubleshooting this error, see ResourceNotFound in the Amazon Bedrock User Guide

HTTP Status Code: 404

ServiceQuotaExceededException

Your request exceeds the service quota for your account. You can view your quotas at Viewing service quotas. You can resubmit your request later.

HTTP Status Code: 400

ThrottlingException

Your request was denied due to exceeding the account quotas for Amazon Bedrock. For troubleshooting this error, see ThrottlingException in the Amazon Bedrock User Guide

HTTP Status Code: 429

ValidationException

The input fails to satisfy the constraints specified by Amazon Bedrock. For troubleshooting this error, see ValidationError in the Amazon Bedrock User Guide

HTTP Status Code: 400

See Also

For more information about using this API in one of the language-specific AWS SDKs, see the following:

プライバシーサイト規約Cookie の設定
© 2025, Amazon Web Services, Inc. or its affiliates.All rights reserved.