Bedrock / Client / create_automated_reasoning_policy
create_automated_reasoning_policy¶
- Bedrock.Client.create_automated_reasoning_policy(**kwargs)¶
Creates an Automated Reasoning policy for Amazon Bedrock Guardrails. Automated Reasoning policies use mathematical techniques to detect hallucinations, suggest corrections, and highlight unstated assumptions in the responses of your GenAI application.
To create a policy, you upload a source document that describes the rules that you’re encoding. Automated Reasoning extracts important concepts from the source document that will become variables in the policy and infers policy rules.
See also: AWS API Documentation
Request Syntax
response = client.create_automated_reasoning_policy( name='string', description='string', clientRequestToken='string', policyDefinition={ 'version': 'string', 'types': [ { 'name': 'string', 'description': 'string', 'values': [ { 'value': 'string', 'description': 'string' }, ] }, ], 'rules': [ { 'id': 'string', 'expression': 'string', 'alternateExpression': 'string' }, ], 'variables': [ { 'name': 'string', 'type': 'string', 'description': 'string' }, ] }, tags=[ { 'key': 'string', 'value': 'string' }, ] )
- Parameters:
name (string) –
[REQUIRED]
A unique name for the Automated Reasoning policy. The name must be between 1 and 63 characters and can contain letters, numbers, hyphens, and underscores.
description (string) – A description of the Automated Reasoning policy. Use this to provide context about the policy’s purpose and the types of validations it performs.
clientRequestToken (string) –
A unique, case-sensitive identifier to ensure that the operation completes no more than once. If this token matches a previous request, Amazon Bedrock ignores the request but doesn’t return an error.
This field is autopopulated if not provided.
policyDefinition (dict) –
The policy definition that contains the formal logic rules, variables, and custom variable types used to validate foundation model responses in your application.
version (string) –
The version of the policy definition format.
types (list) –
The custom user-defined vairable types used in the policy. Types are enum-based variable types that provide additional context beyond the predefined variable types.
(dict) –
Represents a custom user-defined viarble type in an Automated Reasoning policy. Types are enum-based and provide additional context beyond predefined variable types.
name (string) – [REQUIRED]
The name of the custom type.
description (string) –
The description of what the custom type represents.
values (list) – [REQUIRED]
The possible values for this enum-based type, each with its own description.
(dict) –
Represents a single value within a custom type definition, including its identifier and description.
value (string) – [REQUIRED]
The actual value or identifier for this type value.
description (string) –
A human-readable description explaining what this type value represents and when it should be used.
rules (list) –
The formal logic rules extracted from the source document. Rules define the logical constraints that determine whether model responses are valid, invalid, or satisfiable.
(dict) –
Represents a formal logic rule in an Automated Reasoning policy. For example, rules can be expressed as if-then statements that define logical constraints.
id (string) – [REQUIRED]
The unique identifier of the rule within the policy.
expression (string) – [REQUIRED]
The formal logic expression of the rule.
alternateExpression (string) –
The human-readable form of the rule expression, often in natural language or simplified notation.
variables (list) –
The variables that represent concepts in the policy. Variables can have values assigned when translating natural language into formal logic. Their descriptions are crucial for accurate translation.
(dict) –
Represents a variable in an Automated Reasoning policy. Variables represent concepts that can have values assigned during natural language translation.
name (string) – [REQUIRED]
The name of the variable. Use descriptive names that clearly indicate the concept being represented.
type (string) – [REQUIRED]
The data type of the variable. Valid types include bool, int, real, enum, and custom types that you can provide.
description (string) – [REQUIRED]
The description of the variable that explains what it represents and how users might refer to it. Clear and comprehensive descriptions are essential for accurate natural language translation.
tags (list) –
A list of tags to associate with the Automated Reasoning policy. Tags help you organize and manage your policies.
(dict) –
Definition of the key/value pair for a tag.
key (string) – [REQUIRED]
Key for the tag.
value (string) – [REQUIRED]
Value for the tag.
- Return type:
dict
- Returns:
Response Syntax
{ 'policyArn': 'string', 'version': 'string', 'name': 'string', 'description': 'string', 'definitionHash': 'string', 'createdAt': datetime(2015, 1, 1), 'updatedAt': datetime(2015, 1, 1) }
Response Structure
(dict) –
policyArn (string) –
The Amazon Resource Name (ARN) of the Automated Reasoning policy that you created.
version (string) –
The version number of the newly created Automated Reasoning policy. The initial version is always DRAFT.
name (string) –
The name of the Automated Reasoning policy.
description (string) –
The description of the Automated Reasoning policy.
definitionHash (string) –
The hash of the policy definition. This is used as a concurrency token for creating policy versions that you can use in your application.
createdAt (datetime) –
The timestamp when the policy was created.
updatedAt (datetime) –
The timestamp when the policy was last updated.
Exceptions