:doc:`BedrockAgentCoreControl <../../bedrock-agentcore-control>` / Client / start_policy_generation

***********************
start_policy_generation
***********************



.. py:method:: BedrockAgentCoreControl.Client.start_policy_generation(**kwargs)

  

  Initiates the AI-powered generation of Cedar policies from natural language descriptions within the AgentCore Policy system. This feature enables both technical and non-technical users to create policies by describing their authorization requirements in plain English, which is then automatically translated into formal Cedar policy statements. The generation process analyzes the natural language input along with the Gateway's tool context to produce validated policy options. Generated policy assets are automatically deleted after 7 days, so you should review and create policies from the generated assets within this timeframe. Once created, policies are permanent and not subject to this expiration. Generated policies should be reviewed and tested in log-only mode before deploying to production. Use this when you want to describe policy intent naturally rather than learning Cedar syntax, though generated policies may require refinement for complex scenarios.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/bedrock-agentcore-control-2023-06-05/StartPolicyGeneration>`_  


  **Request Syntax**
  ::

    response = client.start_policy_generation(
        policyEngineId='string',
        resource={
            'arn': 'string'
        },
        content={
            'rawText': 'string'
        },
        name='string',
        clientToken='string'
    )
    
  :type policyEngineId: string
  :param policyEngineId: **[REQUIRED]** 

    The identifier of the policy engine that provides the context for policy generation. This engine's schema and tool context are used to ensure generated policies are valid and applicable.

    

  
  :type resource: dict
  :param resource: **[REQUIRED]** 

    The resource information that provides context for policy generation. This helps the AI understand the target resources and generate appropriate access control rules.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``arn``. 

  
    - **arn** *(string) --* 

      The Amazon Resource Name (ARN) of the resource. This globally unique identifier specifies the exact resource that policies will be evaluated against for access control decisions.

      

    
  
  :type content: dict
  :param content: **[REQUIRED]** 

    The natural language description of the desired policy behavior. This content is processed by AI to generate corresponding Cedar policy statements that match the described intent.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``rawText``. 

  
    - **rawText** *(string) --* 

      The raw text content containing natural language descriptions of desired policy behavior. This text is processed by AI to generate corresponding Cedar policy statements that match the described intent.

      

    
  
  :type name: string
  :param name: **[REQUIRED]** 

    A customer-assigned name for the policy generation request. This helps track and identify generation operations, especially when running multiple generations simultaneously.

    

  
  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier to ensure the idempotency of the request. The AWS SDK automatically generates this token, so you don't need to provide it in most cases. If you retry a request with the same client token, the service returns the same response without starting a duplicate generation.

    This field is autopopulated if not provided.

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'policyEngineId': 'string',
          'policyGenerationId': 'string',
          'name': 'string',
          'policyGenerationArn': 'string',
          'resource': {
              'arn': 'string'
          },
          'createdAt': datetime(2015, 1, 1),
          'updatedAt': datetime(2015, 1, 1),
          'status': 'GENERATING'|'GENERATED'|'GENERATE_FAILED'|'DELETE_FAILED',
          'statusReasons': [
              'string',
          ],
          'findings': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **policyEngineId** *(string) --* 

        The identifier of the policy engine associated with the started policy generation.

        
      

      - **policyGenerationId** *(string) --* 

        The unique identifier assigned to the policy generation request for tracking progress.

        
      

      - **name** *(string) --* 

        The customer-assigned name for the policy generation request.

        
      

      - **policyGenerationArn** *(string) --* 

        The ARN of the created policy generation request.

        
      

      - **resource** *(dict) --* 

        The resource information associated with the policy generation request.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys will be set: ``arn``.     If a client receives an unknown member it will     set ``SDK_UNKNOWN_MEMBER`` as the top level key,     which maps to the name or tag of the unknown     member. The structure of ``SDK_UNKNOWN_MEMBER`` is     as follows::

                'SDK_UNKNOWN_MEMBER': {'name': 'UnknownMemberName'}


      
        

        - **arn** *(string) --* 

          The Amazon Resource Name (ARN) of the resource. This globally unique identifier specifies the exact resource that policies will be evaluated against for access control decisions.

          
    
      

      - **createdAt** *(datetime) --* 

        The timestamp when the policy generation request was created.

        
      

      - **updatedAt** *(datetime) --* 

        The timestamp when the policy generation was last updated.

        
      

      - **status** *(string) --* 

        The initial status of the policy generation request.

        
      

      - **statusReasons** *(list) --* 

        Additional information about the generation status.

        
        

        - *(string) --* 
    
      

      - **findings** *(string) --* 

        Initial findings from the policy generation process.

        
  
  **Exceptions**
  
  *   :py:class:`BedrockAgentCoreControl.Client.exceptions.ServiceQuotaExceededException`

  
  *   :py:class:`BedrockAgentCoreControl.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`BedrockAgentCoreControl.Client.exceptions.ConflictException`

  
  *   :py:class:`BedrockAgentCoreControl.Client.exceptions.ValidationException`

  
  *   :py:class:`BedrockAgentCoreControl.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`BedrockAgentCoreControl.Client.exceptions.ThrottlingException`

  
  *   :py:class:`BedrockAgentCoreControl.Client.exceptions.InternalServerException`

  