Skip to content

Start Policy Generation

bedrockagentcorecontrol_start_policy_generation R Documentation

Initiates the AI-powered generation of Cedar policies from natural language descriptions within the AgentCore Policy system

Description

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.

Usage

bedrockagentcorecontrol_start_policy_generation(policyEngineId,
  resource, content, name, clientToken)

Arguments

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.

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.

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.

name

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

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.

Value

A list with the following syntax:

list(
  policyEngineId = "string",
  policyGenerationId = "string",
  name = "string",
  policyGenerationArn = "string",
  resource = list(
    arn = "string"
  ),
  createdAt = as.POSIXct(
    "2015-01-01"
  ),
  updatedAt = as.POSIXct(
    "2015-01-01"
  ),
  status = "GENERATING"|"GENERATED"|"GENERATE_FAILED"|"DELETE_FAILED",
  findings = "string",
  statusReasons = list(
    "string"
  )
)

Request syntax

svc$start_policy_generation(
  policyEngineId = "string",
  resource = list(
    arn = "string"
  ),
  content = list(
    rawText = "string"
  ),
  name = "string",
  clientToken = "string"
)