CreateAutomatedReasoningPolicy
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.
Request Syntax
POST /automated-reasoning-policies HTTP/1.1
Content-type: application/json
{
"clientRequestToken": "string
",
"description": "string
",
"name": "string
",
"policyDefinition": {
"rules": [
{
"alternateExpression": "string
",
"expression": "string
",
"id": "string
"
}
],
"types": [
{
"description": "string
",
"name": "string
",
"values": [
{
"description": "string
",
"value": "string
"
}
]
}
],
"variables": [
{
"description": "string
",
"name": "string
",
"type": "string
"
}
],
"version": "string
"
},
"tags": [
{
"key": "string
",
"value": "string
"
}
]
}
URI Request Parameters
The request does not use any URI parameters.
Request Body
The request accepts the following data in JSON format.
- clientRequestToken
-
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.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
[a-zA-Z0-9](-*[a-zA-Z0-9])*
Required: No
- description
-
A description of the Automated Reasoning policy. Use this to provide context about the policy's purpose and the types of validations it performs.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 1024.
Pattern:
[\s\S]+
Required: No
- name
-
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.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
[0-9a-zA-Z-_ ]+
Required: Yes
- policyDefinition
-
The policy definition that contains the formal logic rules, variables, and custom variable types used to validate foundation model responses in your application.
Type: AutomatedReasoningPolicyDefinition object
Required: No
-
A list of tags to associate with the Automated Reasoning policy. Tags help you organize and manage your policies.
Type: Array of Tag objects
Array Members: Minimum number of 0 items. Maximum number of 200 items.
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"createdAt": "string",
"definitionHash": "string",
"description": "string",
"name": "string",
"policyArn": "string",
"updatedAt": "string",
"version": "string"
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
- createdAt
-
The timestamp when the policy was created.
Type: Timestamp
- definitionHash
-
The hash of the policy definition. This is used as a concurrency token for creating policy versions that you can use in your application.
Type: String
Length Constraints: Fixed length of 128.
Pattern:
[0-9a-z]{128}
- description
-
The description of the Automated Reasoning policy.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 1024.
Pattern:
[\s\S]+
- name
-
The name of the Automated Reasoning policy.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 256.
Pattern:
[0-9a-zA-Z-_ ]+
- policyArn
-
The Amazon Resource Name (ARN) of the Automated Reasoning policy that you created.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
Pattern:
arn:aws(-[^:]+)?:bedrock:[a-z0-9-]{1,20}:[0-9]{12}:automated-reasoning-policy/[a-z0-9]{12}(:([1-9][0-9]{0,11}))?
- updatedAt
-
The timestamp when the policy was last updated.
Type: Timestamp
- version
-
The version number of the newly created Automated Reasoning policy. The initial version is always DRAFT.
Type: String
Length Constraints: Minimum length of 0. Maximum length of 12.
Pattern:
([1-9][0-9]{0,11})
Errors
For information about the errors that are common to all actions, see Common Errors.
- AccessDeniedException
-
The request is denied because of missing access permissions.
HTTP Status Code: 403
- ConflictException
-
Error occurred because of a conflict while performing an operation.
HTTP Status Code: 400
- InternalServerException
-
An internal server error occurred. Retry your request.
HTTP Status Code: 500
- ResourceNotFoundException
-
The specified resource Amazon Resource Name (ARN) was not found. Check the Amazon Resource Name (ARN) and try your request again.
HTTP Status Code: 404
- ServiceQuotaExceededException
-
The number of requests exceeds the service quota. Resubmit your request later.
HTTP Status Code: 400
- ThrottlingException
-
The number of requests exceeds the limit. Resubmit your request later.
HTTP Status Code: 429
- TooManyTagsException
-
The request contains more tags than can be associated with a resource (50 tags per resource). The maximum number of tags includes both existing tags and those included in your current request.
HTTP Status Code: 400
- ValidationException
-
Input validation failed. Check your request parameters and retry the request.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: