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,
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.
descriptionA description of the guardrail.
topicPolicyConfigThe topic policy to configure for the guardrail.
contentPolicyConfigThe content policy to configure for the guardrail.
wordPolicyConfigThe word policy to configure for the guardrail.
sensitiveInformationPolicyConfigThe sensitive information policy to configure for the guardrail.
contextualGroundingPolicyConfigThe 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.
kmsKeyIdThe 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"
)
)
),
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"
)