Amazon Bedrock

2025/10/15 - Amazon Bedrock - 3 updated api methods

Changes  Amazon Bedrock Automated Reasoning Policy now offers enhanced AWS KMS integration. The CreateAutomatedReasoningPolicy API includes a new kmsKeyId field, allowing customers to specify their preferred KMS key for encryption, improving control and compliance with AWS encryption mandates.

CreateAutomatedReasoningPolicy (updated) Link ¶
Changes (request)
{'kmsKeyId': 'string'}

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

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'
            },
        ]
    },
    kmsKeyId='string',
    tags=[
        {
            'key': 'string',
            'value': 'string'
        },
    ]
)
type name:

string

param name:

[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.

type description:

string

param 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 clientRequestToken:

string

param 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.

This field is autopopulated if not provided.

type policyDefinition:

dict

param policyDefinition:

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.

type kmsKeyId:

string

param kmsKeyId:

The identifier of the KMS key to use for encrypting the automated reasoning policy and its associated artifacts. If you don't specify a KMS key, Amazon Bedrock uses an KMS managed key for encryption. For enhanced security and control, you can specify a customer managed KMS key.

type tags:

list

param tags:

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.

rtype:

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.

DeleteAutomatedReasoningPolicy (updated) Link ¶
Changes (request)
{'force': 'boolean'}

Deletes an Automated Reasoning policy or policy version. This operation is idempotent. If you delete a policy more than once, each call succeeds. Deleting a policy removes it permanently and cannot be undone.

See also: AWS API Documentation

Request Syntax

client.delete_automated_reasoning_policy(
    policyArn='string',
    force=True|False
)
type policyArn:

string

param policyArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the Automated Reasoning policy to delete.

type force:

boolean

param force:

Specifies whether to force delete the automated reasoning policy even if it has active resources. When false, Amazon Bedrock validates if all artifacts have been deleted (e.g. policy version, test case, test result) for a policy before deletion. When true, Amazon Bedrock will delete the policy and all its artifacts without validation. Default is false.

rtype:

dict

returns:

Response Syntax

{}

Response Structure

  • (dict) --

GetAutomatedReasoningPolicy (updated) Link ¶
Changes (response)
{'kmsKeyArn': 'string'}

Retrieves details about an Automated Reasoning policy or policy version. Returns information including the policy definition, metadata, and timestamps.

See also: AWS API Documentation

Request Syntax

client.get_automated_reasoning_policy(
    policyArn='string'
)
type policyArn:

string

param policyArn:

[REQUIRED]

The Amazon Resource Name (ARN) of the Automated Reasoning policy to retrieve. Can be either the unversioned ARN for the draft policy or an ARN for a specific policy version.

rtype:

dict

returns:

Response Syntax

{
    'policyArn': 'string',
    'name': 'string',
    'version': 'string',
    'policyId': 'string',
    'description': 'string',
    'definitionHash': 'string',
    'kmsKeyArn': 'string',
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1)
}

Response Structure

  • (dict) --

    • policyArn (string) --

      The Amazon Resource Name (ARN) of the policy.

    • name (string) --

      The name of the policy.

    • version (string) --

      The version of the policy.

    • policyId (string) --

      The unique identifier of the policy.

    • description (string) --

      The description of the policy.

    • definitionHash (string) --

      The hash of the policy definition used as a concurrency token.

    • kmsKeyArn (string) --

      The Amazon Resource Name (ARN) of the KMS key used to encrypt the automated reasoning policy and its associated artifacts. If a KMS key is not provided during the initial CreateAutomatedReasoningPolicyRequest, the kmsKeyArn won't be included in the GetAutomatedReasoningPolicyResponse.

    • createdAt (datetime) --

      The timestamp when the policy was created.

    • updatedAt (datetime) --

      The timestamp when the policy was last updated.