Skip to main content

policies

Creates, updates, deletes, gets or lists a policies resource.

Overview

Namepolicies
TypeResource
Idaws.bedrock_agentcore_control.policies

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe customer-assigned name of the policy. This is the human-readable identifier that was specified when the policy was created. (pattern: <code>[A-Za-z][A-Za-z0-9_]*</code>)
created_atstring (date-time)The timestamp when the policy was originally created.
definitionobjectRepresents the definition structure for policies within the AgentCore Policy system. This structure encapsulates different policy formats and languages that can be used to define access control rules.
descriptionstringThe human-readable description of the policy's purpose and functionality. This helps administrators understand and manage the policy.
enforcement_modestringThe enforcement mode for a policy. Run this policy in LOG_ONLY mode to collect data on how it affects your application. Once you are satisfied with the data gathered, switch the policy to ACTIVE. (ACTIVE, LOG_ONLY)
policy_arnstringThe Amazon Resource Name (ARN) of the policy. This globally unique identifier can be used for cross-service references and IAM policy statements. (pattern: <code>arn:aws[-a-z]{0,7}:bedrock-agentcore:[a-z0-9-]{9,15}:[0-9]{12}:policy-engine/[a-zA-Z][a-zA-Z0-9-]{0,47}-[a-zA-Z0-9]{10}/policy/[a-zA-Z][a-zA-Z0-9-]{0,47}-[a-zA-Z0-9]{10}</code>)
policy_engine_idstringThe identifier of the policy engine that manages this policy. This confirms the policy engine context for the retrieved policy. (pattern: <code>[A-Za-z][A-Za-z0-9_]*-[a-z0-9_]{10}</code>)
policy_idstringThe unique identifier of the retrieved policy. This matches the policy ID provided in the request and serves as the system identifier for the policy. (pattern: <code>[A-Za-z][A-Za-z0-9_]*-[a-z0-9_]{10}</code>)
statusstringThe current status of the policy. (CREATING, ACTIVE, UPDATING, DELETING, CREATE_FAILED, UPDATE_FAILED, DELETE_FAILED)
status_reasonsarrayAdditional information about the policy status. This provides details about any failures or the current state of the policy.
updated_atstring (date-time)The timestamp when the policy was last modified. This tracks the most recent changes to the policy configuration.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
get_policyselectpolicy_engine_id, policy_id, regionRetrieves detailed information about a specific policy within the AgentCore Policy system. This operation returns the complete policy definition, metadata, and current status, allowing administrators to review and manage policy configurations.
list_policiesselectpolicy_engine_id, regionnextToken, maxResults, targetResourceScopeRetrieves a list of policies within the AgentCore Policy engine. This operation supports pagination and filtering to help administrators manage and discover policies across policy engines. Results can be filtered by policy engine or resource associations.
create_policyinsertpolicy_engine_id, region, name, definitionCreates a policy within the AgentCore Policy system. Policies provide real-time, deterministic control over agentic interactions with AgentCore Gateway. Using the Cedar policy language, you can define fine-grained policies that specify which interactions with Gateway tools are permitted based on input parameters and OAuth claims, ensuring agents operate within defined boundaries and business rules. The policy is validated during creation against the Cedar schema generated from the Gateway's tools' input schemas, which defines the available tools, their parameters, and expected data types. This is an asynchronous operation. Use the GetPolicy operation to poll the status field to track completion. If the new policy is a temporal policy, creating it invalidates the policy engine's active temporal sessions. For more information about temporal policy sessions, see session-based temporal policies. The policy engine returns an HTTP 409 ConflictException to in-flight sessions. To resume, you must start a new session with a new session ID.
update_policyupdatepolicy_engine_id, policy_id, regionUpdates an existing policy within the AgentCore Policy system. This operation allows modification of the policy description and definition while maintaining the policy's identity. The updated policy is validated against the Cedar schema before being applied. This is an asynchronous operation. Use the GetPolicy operation to poll the status field to track completion. If the updated policy is a temporal policy, the policy engine invalidates all active temporal sessions. If the update adds or removes temporal operators, the policy engine also invalidates active temporal sessions. For more information about temporal policy sessions, see session-based temporal policies. The policy engine returns an HTTP 409 ConflictException to in-flight sessions. To resume, you must start a new session with a new session ID.
delete_policydeletepolicy_engine_id, policy_id, regionDeletes an existing policy from the AgentCore Policy system. Once deleted, the policy can no longer be used for agent behavior control and all references to it become invalid. This is an asynchronous operation. Use the GetPolicy operation to poll the status field to track completion.
start_policy_generationexecpolicy_engine_id, region, resource, content, nameInitiates 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.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
policy_engine_idstringThe 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.
policy_idstringThe unique identifier of the policy to be deleted. This must be a valid policy ID that exists within the specified policy engine.
regionstringAWS region (default: us-east-1)
maxResultsintegerThe maximum number of policies to return in a single response. If not specified, the default is 10 policies per page, with a maximum of 100 per page.
nextTokenstringA pagination token returned from a previous ListPolicies call. Use this token to retrieve the next page of results when the response is paginated.
targetResourceScopestringOptional filter to list policies that apply to a specific resource scope or resource type. This helps narrow down policy results to those relevant for particular Amazon Web Services resources, agent tools, or operational contexts within the policy engine ecosystem.

SELECT examples

Retrieves detailed information about a specific policy within the AgentCore Policy system. This operation returns the complete policy definition, metadata, and current status, allowing administrators to review and manage policy configurations.

SELECT
name,
created_at,
definition,
description,
enforcement_mode,
policy_arn,
policy_engine_id,
policy_id,
status,
status_reasons,
updated_at
FROM aws.bedrock_agentcore_control.policies
WHERE policy_engine_id = '{{ policy_engine_id }}' -- required
AND policy_id = '{{ policy_id }}' -- required
AND region = '{{ region }}' -- required
;

INSERT examples

Creates a policy within the AgentCore Policy system. Policies provide real-time, deterministic control over agentic interactions with AgentCore Gateway. Using the Cedar policy language, you can define fine-grained policies that specify which interactions with Gateway tools are permitted based on input parameters and OAuth claims, ensuring agents operate within defined boundaries and business rules. The policy is validated during creation against the Cedar schema generated from the Gateway's tools' input schemas, which defines the available tools, their parameters, and expected data types. This is an asynchronous operation. Use the GetPolicy operation to poll the status field to track completion. If the new policy is a temporal policy, creating it invalidates the policy engine's active temporal sessions. For more information about temporal policy sessions, see session-based temporal policies. The policy engine returns an HTTP 409 ConflictException to in-flight sessions. To resume, you must start a new session with a new session ID.

INSERT INTO aws.bedrock_agentcore_control.policies (
name,
definition,
description,
validationMode,
enforcementMode,
clientToken,
policy_engine_id,
region
)
SELECT
'{{ name }}' /* required */,
'{{ definition }}' /* required */,
'{{ description }}',
'{{ validationMode }}',
'{{ enforcementMode }}',
'{{ clientToken }}',
'{{ policy_engine_id }}',
'{{ region }}'
RETURNING
name,
created_at,
definition,
description,
enforcement_mode,
policy_arn,
policy_engine_id,
policy_id,
status,
status_reasons,
updated_at
;

UPDATE examples

Updates an existing policy within the AgentCore Policy system. This operation allows modification of the policy description and definition while maintaining the policy's identity. The updated policy is validated against the Cedar schema before being applied. This is an asynchronous operation. Use the GetPolicy operation to poll the status field to track completion. If the updated policy is a temporal policy, the policy engine invalidates all active temporal sessions. If the update adds or removes temporal operators, the policy engine also invalidates active temporal sessions. For more information about temporal policy sessions, see session-based temporal policies. The policy engine returns an HTTP 409 ConflictException to in-flight sessions. To resume, you must start a new session with a new session ID.

UPDATE aws.bedrock_agentcore_control.policies
SET
description = '{{ description }}',
definition = '{{ definition }}',
validationMode = '{{ validationMode }}',
enforcementMode = '{{ enforcementMode }}'
WHERE
policy_engine_id = '{{ policy_engine_id }}' --required
AND policy_id = '{{ policy_id }}' --required
AND region = '{{ region }}' --required
RETURNING
name,
created_at,
definition,
description,
enforcement_mode,
policy_arn,
policy_engine_id,
policy_id,
status,
status_reasons,
updated_at;

DELETE examples

Deletes an existing policy from the AgentCore Policy system. Once deleted, the policy can no longer be used for agent behavior control and all references to it become invalid. This is an asynchronous operation. Use the GetPolicy operation to poll the status field to track completion.

DELETE FROM aws.bedrock_agentcore_control.policies
WHERE policy_engine_id = '{{ policy_engine_id }}' --required
AND policy_id = '{{ policy_id }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

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.

EXEC aws.bedrock_agentcore_control.policies.start_policy_generation
@policy_engine_id='{{ policy_engine_id }}' --required,
@region='{{ region }}' --required
@@json=
'{
"resource": "{{ resource }}",
"content": "{{ content }}",
"name": "{{ name }}",
"clientToken": "{{ clientToken }}"
}'
;