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 | awscc.wisdom.ai_guardrails |
Fields
- get (all properties)
- list (identifiers only)
| 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. |
| Name | Datatype | Description |
|---|---|---|
assistant_id | string | |
a_iguardrail_id | string | |
region | string | AWS region. |
For more information, see AWS::Wisdom::AIGuardrail.
Methods
| Name | Resource | Accessible by | Required Params |
|---|---|---|---|
create_resource | ai_guardrails | INSERT | AssistantId, BlockedInputMessaging, BlockedOutputsMessaging, region |
delete_resource | ai_guardrails | DELETE | Identifier, region |
update_resource | ai_guardrails | UPDATE | Identifier, PatchDocument, region |
list_resources | ai_guardrails_list_only | SELECT | region |
get_resource | ai_guardrails | SELECT | Identifier, region |
SELECT examples
- get (all properties)
- list (identifiers only)
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 }}';
Lists all ai_guardrails in a region.
SELECT
region,
a_iguardrail_id,
assistant_id
FROM awscc.wisdom.ai_guardrails_list_only
WHERE
region = '{{ region }}';
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 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
;
/*+ create */
INSERT INTO awscc.wisdom.ai_guardrails (
AssistantId,
Name,
BlockedInputMessaging,
BlockedOutputsMessaging,
Description,
TopicPolicyConfig,
ContentPolicyConfig,
WordPolicyConfig,
SensitiveInformationPolicyConfig,
ContextualGroundingPolicyConfig,
Tags,
region
)
SELECT
'{{ assistant_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 }}',
'{{ region }}'
RETURNING
ErrorCode,
EventTime,
Identifier,
Operation,
OperationStatus,
RequestToken,
ResourceModel,
RetryAfter,
StatusMessage,
TypeName
;
version: 1
name: stack name
description: stack description
providers:
- aws
globals:
- name: region
value: '{{ vars.AWS_REGION }}'
resources:
- name: ai_guardrail
props:
- name: assistant_id
value: '{{ assistant_id }}'
- name: name
value: '{{ name }}'
- name: blocked_input_messaging
value: '{{ blocked_input_messaging }}'
- name: blocked_outputs_messaging
value: '{{ blocked_outputs_messaging }}'
- name: description
value: '{{ description }}'
- name: topic_policy_config
value:
topics_config:
- name: '{{ name }}'
definition: '{{ definition }}'
examples:
- '{{ examples[0] }}'
type: '{{ type }}'
- name: content_policy_config
value:
filters_config:
- type: '{{ type }}'
input_strength: '{{ input_strength }}'
output_strength: null
- name: word_policy_config
value:
words_config:
- text: '{{ text }}'
managed_word_lists_config:
- type: '{{ type }}'
- name: sensitive_information_policy_config
value:
pii_entities_config:
- type: '{{ type }}'
action: '{{ action }}'
regexes_config:
- name: '{{ name }}'
description: '{{ description }}'
pattern: '{{ pattern }}'
action: null
- name: contextual_grounding_policy_config
value:
filters_config:
- type: '{{ type }}'
threshold: null
- name: tags
value: {}
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:
| Parameter | Description |
|---|---|
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:
- Create
- Read
- Update
- Delete
- List
wisdom:CreateAIGuardrail,
wisdom:TagResource
wisdom:GetAIGuardrail
wisdom:UpdateAIGuardrail
wisdom:DeleteAIGuardrail
wisdom:ListAIGuardrails