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
nameand optionaldescription. -
Specify messages for when the guardrail successfully blocks a prompt or a model response in the
blockedInputMessagingandblockedOutputsMessagingfields. -
Specify topics for the guardrail to deny in the
topicPolicyConfigobject. Each GuardrailTopicConfig object in thetopicsConfiglist pertains to one topic.-
Give a
nameanddescriptionso that the guardrail can properly identify the topic. -
Specify
DENYin thetypefield. -
(Optional) Provide up to five prompts that you would categorize as belonging to the topic in the
exampleslist.
-
-
Specify filter strengths for the harmful categories defined in Amazon Bedrock in the
contentPolicyConfigobject. Each GuardrailContentFilterConfig object in thefiltersConfiglist 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
typefield. -
Specify the strength of the filter for prompts in the
inputStrengthfield and for model responses in thestrengthfield of the GuardrailContentFilterConfig.
-
-
(Optional) For security, include the ARN of a KMS key in the
kmsKeyIdfield.
Usage¶
bedrock_update_guardrail(guardrailIdentifier, name, description,
topicPolicyConfig, contentPolicyConfig, wordPolicyConfig,
sensitiveInformationPolicyConfig, contextualGroundingPolicyConfig,
crossRegionConfig, 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. |
crossRegionConfig |
The system-defined guardrail profile that you're using with your guardrail. Guardrail profiles define the destination Amazon Web Services Regions where guardrail inference requests can be automatically routed. For more information, see the Amazon Bedrock User Guide. |
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",
inputAction = "BLOCK"|"NONE",
outputAction = "BLOCK"|"NONE",
inputEnabled = TRUE|FALSE,
outputEnabled = TRUE|FALSE
)
)
),
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"
),
inputAction = "BLOCK"|"NONE",
outputAction = "BLOCK"|"NONE",
inputEnabled = TRUE|FALSE,
outputEnabled = TRUE|FALSE
)
)
),
wordPolicyConfig = list(
wordsConfig = list(
list(
text = "string",
inputAction = "BLOCK"|"NONE",
outputAction = "BLOCK"|"NONE",
inputEnabled = TRUE|FALSE,
outputEnabled = TRUE|FALSE
)
),
managedWordListsConfig = list(
list(
type = "PROFANITY",
inputAction = "BLOCK"|"NONE",
outputAction = "BLOCK"|"NONE",
inputEnabled = TRUE|FALSE,
outputEnabled = TRUE|FALSE
)
)
),
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"|"NONE",
inputAction = "BLOCK"|"ANONYMIZE"|"NONE",
outputAction = "BLOCK"|"ANONYMIZE"|"NONE",
inputEnabled = TRUE|FALSE,
outputEnabled = TRUE|FALSE
)
),
regexesConfig = list(
list(
name = "string",
description = "string",
pattern = "string",
action = "BLOCK"|"ANONYMIZE"|"NONE",
inputAction = "BLOCK"|"ANONYMIZE"|"NONE",
outputAction = "BLOCK"|"ANONYMIZE"|"NONE",
inputEnabled = TRUE|FALSE,
outputEnabled = TRUE|FALSE
)
)
),
contextualGroundingPolicyConfig = list(
filtersConfig = list(
list(
type = "GROUNDING"|"RELEVANCE",
threshold = 123.0,
action = "BLOCK"|"NONE",
enabled = TRUE|FALSE
)
)
),
crossRegionConfig = list(
guardrailProfileIdentifier = "string"
),
blockedInputMessaging = "string",
blockedOutputsMessaging = "string",
kmsKeyId = "string"
)