Update Guardrail
bedrock_update_guardrail | R Documentation |
Updates a guardrail with the values you specify¶
Description¶
Updates a guardrail with the values you specify.
-
Specify a
name
and optionaldescription
. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessaging
andblockedOutputsMessaging
fields. -
Specify topics for the guardrail to deny in the
topicPolicyConfig
object. Each GuardrailTopicConfig object in thetopicsConfig
list pertains to one topic.-
Give a
name
anddescription
so that the guardrail can properly identify the topic. -
Specify
DENY
in thetype
field. -
(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the
examples
list.
-
-
Specify filter strengths for the harmful categories defined in Amazon Bedrock in the
contentPolicyConfig
object. Each GuardrailContentFilterConfig object in thefiltersConfig
list pertains to a harmful category. For more information, see Content filters. For more information about the fields in a content filter, see GuardrailContentFilterConfig.-
Specify the category in the
type
field. -
Specify the strength of the filter for prompts in the
inputStrength
field and for model responses in thestrength
field of the GuardrailContentFilterConfig.
-
-
(Optional) For security, include the ARN of a KMS key in the
kmsKeyId
field.
Usage¶
bedrock_update_guardrail(guardrailIdentifier, name, description,
topicPolicyConfig, contentPolicyConfig, wordPolicyConfig,
sensitiveInformationPolicyConfig, contextualGroundingPolicyConfig,
blockedInputMessaging, blockedOutputsMessaging, kmsKeyId)
Arguments¶
guardrailIdentifier |
[required] The unique identifier of the guardrail. This can be an ID or the ARN. |
name |
[required] A name for the guardrail. |
description |
A description of the guardrail. |
topicPolicyConfig |
The topic policy to configure for the guardrail. |
contentPolicyConfig |
The content policy to configure for the guardrail. |
wordPolicyConfig |
The word policy to configure for the guardrail. |
sensitiveInformationPolicyConfig |
The sensitive information policy to configure for the guardrail. |
contextualGroundingPolicyConfig |
The contextual grounding policy configuration used to update a guardrail. |
blockedInputMessaging |
[required] The message to return when the guardrail blocks a prompt. |
blockedOutputsMessaging |
[required] The message to return when the guardrail blocks a model response. |
kmsKeyId |
The ARN of the KMS key with which to encrypt the guardrail. |
Value¶
A list with the following syntax:
list(
guardrailId = "string",
guardrailArn = "string",
version = "string",
updatedAt = as.POSIXct(
"2015-01-01"
)
)
Request syntax¶
svc$update_guardrail(
guardrailIdentifier = "string",
name = "string",
description = "string",
topicPolicyConfig = list(
topicsConfig = list(
list(
name = "string",
definition = "string",
examples = list(
"string"
),
type = "DENY"
)
)
),
contentPolicyConfig = list(
filtersConfig = list(
list(
type = "SEXUAL"|"VIOLENCE"|"HATE"|"INSULTS"|"MISCONDUCT"|"PROMPT_ATTACK",
inputStrength = "NONE"|"LOW"|"MEDIUM"|"HIGH",
outputStrength = "NONE"|"LOW"|"MEDIUM"|"HIGH",
inputModalities = list(
"TEXT"|"IMAGE"
),
outputModalities = list(
"TEXT"|"IMAGE"
)
)
)
),
wordPolicyConfig = list(
wordsConfig = list(
list(
text = "string"
)
),
managedWordListsConfig = list(
list(
type = "PROFANITY"
)
)
),
sensitiveInformationPolicyConfig = list(
piiEntitiesConfig = list(
list(
type = "ADDRESS"|"AGE"|"AWS_ACCESS_KEY"|"AWS_SECRET_KEY"|"CA_HEALTH_NUMBER"|"CA_SOCIAL_INSURANCE_NUMBER"|"CREDIT_DEBIT_CARD_CVV"|"CREDIT_DEBIT_CARD_EXPIRY"|"CREDIT_DEBIT_CARD_NUMBER"|"DRIVER_ID"|"EMAIL"|"INTERNATIONAL_BANK_ACCOUNT_NUMBER"|"IP_ADDRESS"|"LICENSE_PLATE"|"MAC_ADDRESS"|"NAME"|"PASSWORD"|"PHONE"|"PIN"|"SWIFT_CODE"|"UK_NATIONAL_HEALTH_SERVICE_NUMBER"|"UK_NATIONAL_INSURANCE_NUMBER"|"UK_UNIQUE_TAXPAYER_REFERENCE_NUMBER"|"URL"|"USERNAME"|"US_BANK_ACCOUNT_NUMBER"|"US_BANK_ROUTING_NUMBER"|"US_INDIVIDUAL_TAX_IDENTIFICATION_NUMBER"|"US_PASSPORT_NUMBER"|"US_SOCIAL_SECURITY_NUMBER"|"VEHICLE_IDENTIFICATION_NUMBER",
action = "BLOCK"|"ANONYMIZE"
)
),
regexesConfig = list(
list(
name = "string",
description = "string",
pattern = "string",
action = "BLOCK"|"ANONYMIZE"
)
)
),
contextualGroundingPolicyConfig = list(
filtersConfig = list(
list(
type = "GROUNDING"|"RELEVANCE",
threshold = 123.0
)
)
),
blockedInputMessaging = "string",
blockedOutputsMessaging = "string",
kmsKeyId = "string"
)