start_policy_generation¶
Operation¶
start_policy_generation
¶
start_policy_generation(request: StartPolicyGenerationInput | StartPolicyGenerationInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[StartPolicyGenerationInputDict]) -> StartPolicyGenerationOutput
Initiates the AI-powered generation of Dogwood 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 Dogwood 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 Dogwood syntax, though generated policies may require refinement for complex scenarios.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
StartPolicyGenerationInput | StartPolicyGenerationInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[StartPolicyGenerationInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
StartPolicyGenerationOutput
|
An instance of |
start_policy_generation
async
¶
start_policy_generation(request: StartPolicyGenerationInput | StartPolicyGenerationInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[StartPolicyGenerationInputDict]) -> StartPolicyGenerationOutput
Initiates the AI-powered generation of Dogwood 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 Dogwood 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 Dogwood syntax, though generated policies may require refinement for complex scenarios.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
request
|
StartPolicyGenerationInput | StartPolicyGenerationInputDict | None
|
The input as a model or dictionary. Pass this or keyword arguments, not both. |
None
|
plugins
|
list[Plugin] | None
|
A list of callables that modify the configuration dynamically. Changes made by these plugins only apply for the duration of the operation execution and will not affect any other operation invocations. |
None
|
**kwargs
|
Unpack[StartPolicyGenerationInputDict]
|
The input fields as keyword arguments. |
{}
|
Returns:
| Type | Description |
|---|---|
StartPolicyGenerationOutput
|
An instance of |
Input¶
Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.
StartPolicyGenerationInputDict
¶
Bases: TypedDict
Dictionary form of StartPolicyGenerationInput.
Attributes¶
client_token
instance-attribute
¶
client_token: str | None
A unique, case-sensitive identifier to ensure the idempotency of the request. The Amazon Web Services 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.
content
instance-attribute
¶
content: Required[Content | ContentDict]
The natural language description of the desired policy behavior. This content is processed by AI to generate corresponding Dogwood policy statements that match the described intent.
name
instance-attribute
¶
A customer-assigned name for the policy generation request. This helps track and identify generation operations, especially when running multiple generations simultaneously.
policy_engine_id
instance-attribute
¶
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
instance-attribute
¶
resource: Required[Resource | ResourceDict]
The resource information that provides context for policy generation. This helps the AI understand the target resources and generate appropriate access control rules.
StartPolicyGenerationInput
dataclass
¶
Bases: _SerdeShape
Dataclass for StartPolicyGenerationInput structure.
Attributes¶
client_token
class-attribute
instance-attribute
¶
client_token: str | None = ...
A unique, case-sensitive identifier to ensure the idempotency of the request. The Amazon Web Services 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.
content
class-attribute
instance-attribute
¶
content: Content | None = ...
The natural language description of the desired policy behavior. This content is processed by AI to generate corresponding Dogwood policy statements that match the described intent.
name
class-attribute
instance-attribute
¶
name: str | None = ...
A customer-assigned name for the policy generation request. This helps track and identify generation operations, especially when running multiple generations simultaneously.
Output¶
StartPolicyGenerationOutput
dataclass
¶
Bases: _SerdeShape
Dataclass for StartPolicyGenerationOutput structure.
Attributes¶
created_at
instance-attribute
¶
created_at: datetime
The timestamp when the policy generation request was created.
findings
class-attribute
instance-attribute
¶
findings: str | None = ...
Initial findings from the policy generation process.
policy_engine_id
instance-attribute
¶
policy_engine_id: str
The identifier of the policy engine associated with the started policy generation.
policy_generation_arn
instance-attribute
¶
policy_generation_arn: str
The ARN of the created policy generation request.
policy_generation_id
instance-attribute
¶
policy_generation_id: str
The unique identifier assigned to the policy generation request for tracking progress.
resource
instance-attribute
¶
resource: Resource
The resource information associated with the policy generation request.
response_metadata
class-attribute
instance-attribute
¶
Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.
status_reasons
instance-attribute
¶
Additional information about the generation status.