ai_guardrails
Creates, updates, deletes or gets an ai_guardrail
resource or lists ai_guardrails
in a region
Overview
Name | ai_guardrails |
Type | Resource |
Description | Definition of AWS::Wisdom::AIGuardrail Resource Type |
Id | aws.wisdom.ai_guardrails |
Fields
Name | Datatype | Description |
---|---|---|
assistant_id | string | |
assistant_arn | string | |
a_iguardrail_arn | string | |
a_iguardrail_id | string | |
name | string | |
blocked_input_messaging | string | Messaging for when violations are detected in text |
blocked_outputs_messaging | string | Messaging for when violations are detected in text |
description | string | Description of the guardrail or its version |
topic_policy_config | object | Topic policy config for a guardrail. |
content_policy_config | object | Content policy config for a guardrail. |
word_policy_config | object | Word policy config for a guardrail. |
sensitive_information_policy_config | object | Sensitive information policy config for a guardrail. |
contextual_grounding_policy_config | object | Contextual grounding policy config for a guardrail. |
tags | object | |
region | string | AWS region. |
For more information, see AWS::Wisdom::AIGuardrail
.
Methods
Name | Accessible by | Required Params |
---|---|---|
create_resource | INSERT | AssistantId, BlockedInputMessaging, BlockedOutputsMessaging, region |
delete_resource | DELETE | data__Identifier, region |
update_resource | UPDATE | data__Identifier, data__PatchDocument, region |
list_resources | SELECT | region |
get_resource | SELECT | data__Identifier, region |
SELECT
examples
Gets all ai_guardrails
in a region.
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 aws.wisdom.ai_guardrails
WHERE region = 'us-east-1';
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 aws.wisdom.ai_guardrails
WHERE region = 'us-east-1' AND data__Identifier = '<AIGuardrailId>|<AssistantId>';
INSERT
example
Use the following StackQL query and manifest file to create a new ai_guardrail
resource, using stack-deploy
.
- Required Properties
- All Properties
- Manifest
/*+ create */
INSERT INTO aws.wisdom.ai_guardrails (
AssistantId,
BlockedInputMessaging,
BlockedOutputsMessaging,
region
)
SELECT
'{{ AssistantId }}',
'{{ BlockedInputMessaging }}',
'{{ BlockedOutputsMessaging }}',
'{{ region }}';
/*+ create */
INSERT INTO aws.wisdom.ai_guardrails (
AssistantId,
Name,
BlockedInputMessaging,
BlockedOutputsMessaging,
Description,
TopicPolicyConfig,
ContentPolicyConfig,
WordPolicyConfig,
SensitiveInformationPolicyConfig,
ContextualGroundingPolicyConfig,
Tags,
region
)
SELECT
'{{ AssistantId }}',
'{{ Name }}',
'{{ BlockedInputMessaging }}',
'{{ BlockedOutputsMessaging }}',
'{{ Description }}',
'{{ TopicPolicyConfig }}',
'{{ ContentPolicyConfig }}',
'{{ WordPolicyConfig }}',
'{{ SensitiveInformationPolicyConfig }}',
'{{ ContextualGroundingPolicyConfig }}',
'{{ Tags }}',
'{{ region }}';
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: ai_guardrail
props:
- name: AssistantId
value: '{{ AssistantId }}'
- name: Name
value: '{{ Name }}'
- name: BlockedInputMessaging
value: '{{ BlockedInputMessaging }}'
- name: BlockedOutputsMessaging
value: '{{ BlockedOutputsMessaging }}'
- name: Description
value: '{{ Description }}'
- name: TopicPolicyConfig
value:
TopicsConfig:
- Name: '{{ Name }}'
Definition: '{{ Definition }}'
Examples:
- '{{ Examples[0] }}'
Type: '{{ Type }}'
- name: ContentPolicyConfig
value:
FiltersConfig:
- Type: '{{ Type }}'
InputStrength: '{{ InputStrength }}'
OutputStrength: null
- name: WordPolicyConfig
value:
WordsConfig:
- Text: '{{ Text }}'
ManagedWordListsConfig:
- Type: '{{ Type }}'
- name: SensitiveInformationPolicyConfig
value:
PiiEntitiesConfig:
- Type: '{{ Type }}'
Action: '{{ Action }}'
RegexesConfig:
- Name: '{{ Name }}'
Description: '{{ Description }}'
Pattern: '{{ Pattern }}'
Action: null
- name: ContextualGroundingPolicyConfig
value:
FiltersConfig:
- Type: '{{ Type }}'
Threshold: null
- name: Tags
value: {}
DELETE
example
/*+ delete */
DELETE FROM aws.wisdom.ai_guardrails
WHERE data__Identifier = '<AIGuardrailId|AssistantId>'
AND region = 'us-east-1';
Permissions
To operate on the ai_guardrails
resource, the following permissions are required:
Create
wisdom:CreateAIGuardrail,
wisdom:TagResource
Read
wisdom:GetAIGuardrail
Update
wisdom:UpdateAIGuardrail
Delete
wisdom:DeleteAIGuardrail
List
wisdom:ListAIGuardrails