Skip to main content

ai_guardrails

Creates, updates, deletes or gets an ai_guardrail resource or lists ai_guardrails in a region

Overview

Nameai_guardrails
TypeResource
DescriptionDefinition of AWS::Wisdom::AIGuardrail Resource Type
Idawscc.wisdom.ai_guardrails

Fields

NameDatatypeDescription
assistant_idstring
assistant_arnstring
a_iguardrail_arnstring
a_iguardrail_idstring
namestring
blocked_input_messagingstringMessaging for when violations are detected in text
blocked_outputs_messagingstringMessaging for when violations are detected in text
descriptionstringDescription of the guardrail or its version
topic_policy_configobjectTopic policy config for a guardrail.
content_policy_configobjectContent policy config for a guardrail.
word_policy_configobjectWord policy config for a guardrail.
sensitive_information_policy_configobjectSensitive information policy config for a guardrail.
contextual_grounding_policy_configobjectContextual grounding policy config for a guardrail.
tagsobject
regionstringAWS region.

For more information, see AWS::Wisdom::AIGuardrail.

Methods

NameResourceAccessible byRequired Params
create_resourceai_guardrailsINSERTAssistantId, BlockedInputMessaging, BlockedOutputsMessaging, region
delete_resourceai_guardrailsDELETEIdentifier, region
update_resourceai_guardrailsUPDATEIdentifier, PatchDocument, region
list_resourcesai_guardrails_list_onlySELECTregion
get_resourceai_guardrailsSELECTIdentifier, region

SELECT examples

Gets all properties from an individual ai_guardrail.

SELECT
region,
assistant_id,
assistant_arn,
a_iguardrail_arn,
a_iguardrail_id,
name,
blocked_input_messaging,
blocked_outputs_messaging,
description,
topic_policy_config,
content_policy_config,
word_policy_config,
sensitive_information_policy_config,
contextual_grounding_policy_config,
tags
FROM awscc.wisdom.ai_guardrails
WHERE
region = '{{ region }}' AND
Identifier = '{{ a_iguardrail_id }}|{{ assistant_id }}';

INSERT example

Use the following StackQL query and manifest file to create a new ai_guardrail resource, using stack-deploy.

/*+ create */
INSERT INTO awscc.wisdom.ai_guardrails (
AssistantId,
BlockedInputMessaging,
BlockedOutputsMessaging,
region
)
SELECT
'{{ assistant_id }}',
'{{ blocked_input_messaging }}',
'{{ blocked_outputs_messaging }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

UPDATE example

Use the following StackQL query and manifest file to update a ai_guardrail resource, using stack-deploy.

/*+ update */
UPDATE awscc.wisdom.ai_guardrails
SET PatchDocument = string('{{ {
"BlockedInputMessaging": blocked_input_messaging,
"BlockedOutputsMessaging": blocked_outputs_messaging,
"Description": description,
"TopicPolicyConfig": topic_policy_config,
"ContentPolicyConfig": content_policy_config,
"WordPolicyConfig": word_policy_config,
"SensitiveInformationPolicyConfig": sensitive_information_policy_config,
"ContextualGroundingPolicyConfig": contextual_grounding_policy_config
} | generate_patch_document }}')
WHERE
region = '{{ region }}' AND
Identifier = '{{ a_iguardrail_id }}|{{ assistant_id }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

DELETE example

/*+ delete */
DELETE FROM awscc.wisdom.ai_guardrails
WHERE
Identifier = '{{ a_iguardrail_id }}|{{ assistant_id }}' AND
region = '{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;

Additional Parameters

Mutable resources in the Cloud Control provider support additional optional parameters which can be supplied with INSERT, UPDATE, or DELETE operations. These include:

ParameterDescription
ClientToken
A unique identifier to ensure the idempotency of the resource request.This allows the provider to accurately distinguish between retries and new requests.
A client token is valid for 36 hours once used.
After that, a resource request with the same client token is treated as a new request.
If you do not specify a client token, one is generated for inclusion in the request.
RoleArn
The ARN of the IAM role used to perform this resource operation.The role specified must have the permissions required for this operation.
If you do not specify a role, a temporary session is created using your AWS user credentials.
TypeVersionId
For private resource types, the type version to use in this resource operation.If you do not specify a resource version, the default version is used.

Permissions

To operate on the ai_guardrails resource, the following permissions are required:

wisdom:CreateAIGuardrail,
wisdom:TagResource