BedrockAgentCoreControl / Client / create_policy_engine

create_policy_engine

BedrockAgentCoreControl.Client.create_policy_engine(**kwargs)

Creates a new policy engine within the AgentCore Policy system. A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with Gateways (each Gateway can be associated with at most one policy engine, but multiple Gateways can be associated with the same engine), the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies. This is an asynchronous operation. Use the GetPolicyEngine operation to poll the status field to track completion.

See also: AWS API Documentation

Request Syntax

response = client.create_policy_engine(
    name='string',
    description='string',
    clientToken='string'
)
Parameters:
  • name (string) –

    [REQUIRED]

    The customer-assigned immutable name for the policy engine. This name identifies the policy engine and cannot be changed after creation.

  • description (string) – A human-readable description of the policy engine’s purpose and scope (1-4,096 characters). This helps administrators understand the policy engine’s role in the overall governance strategy. Document which Gateway this engine will be associated with, what types of tools or workflows it governs, and the team or service responsible for maintaining it. Clear descriptions are essential when managing multiple policy engines across different services or environments.

  • clientToken (string) –

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If you retry a request with the same client token, the service returns the same response without creating a duplicate policy engine.

    This field is autopopulated if not provided.

Return type:

dict

Returns:

Response Syntax

{
    'policyEngineId': 'string',
    'name': 'string',
    'description': 'string',
    'createdAt': datetime(2015, 1, 1),
    'updatedAt': datetime(2015, 1, 1),
    'policyEngineArn': 'string',
    'status': 'CREATING'|'ACTIVE'|'UPDATING'|'DELETING'|'CREATE_FAILED'|'UPDATE_FAILED'|'DELETE_FAILED',
    'statusReasons': [
        'string',
    ]
}

Response Structure

  • (dict) –

    • policyEngineId (string) –

      The unique identifier for the created policy engine. This system-generated identifier consists of the user name plus a 10-character generated suffix and is used for all subsequent policy engine operations.

    • name (string) –

      The customer-assigned name of the created policy engine. This matches the name provided in the request and serves as the human-readable identifier.

    • description (string) –

      A human-readable description of the policy engine’s purpose.

    • createdAt (datetime) –

      The timestamp when the policy engine was created. This is automatically set by the service and used for auditing and lifecycle management.

    • updatedAt (datetime) –

      The timestamp when the policy engine was last updated. For newly created policy engines, this matches the createdAt timestamp.

    • policyEngineArn (string) –

      The Amazon Resource Name (ARN) of the created policy engine. This globally unique identifier can be used for cross-service references and IAM policy statements.

    • status (string) –

      The current status of the policy engine. A status of ACTIVE indicates the policy engine is ready for use.

    • statusReasons (list) –

      Additional information about the policy engine status. This provides details about any failures or the current state of the policy engine creation process.

      • (string) –

Exceptions

  • BedrockAgentCoreControl.Client.exceptions.ServiceQuotaExceededException

  • BedrockAgentCoreControl.Client.exceptions.AccessDeniedException

  • BedrockAgentCoreControl.Client.exceptions.ConflictException

  • BedrockAgentCoreControl.Client.exceptions.ValidationException

  • BedrockAgentCoreControl.Client.exceptions.ThrottlingException

  • BedrockAgentCoreControl.Client.exceptions.InternalServerException