Skip to content
v2.273.0

Amazon Bedrock AgentCore Construct Library ​

Version 2.273.0-alpha.0

Separate package

@aws-cdk/aws-bedrock-agentcore-alpha is not part of aws-cdk-lib — install it separately:

sh
npm install @aws-cdk/aws-bedrock-agentcore-alpha
pip install aws-cdk.aws-bedrock-agentcore-alpha

This module is experimental (alpha): its API may change in any release, without a major version bump.


cdk-constructs: Experimental

The APIs of higher level constructs in this module are experimental and under active development. They are subject to non-backward compatible changes or removal in any future version. These are not subject to the Semantic Versioning model and breaking changes will be announced in the release notes. This means that while you may use them, you may need to update your source code when upgrading to a newer version of this package.


The Policy submodule is the only submodule that remains in alpha. All other constructs have graduated to stable in aws-cdk-lib/aws-bedrockagentcore and we recommend migrating to the stable versions.

LanguagePackage
Typescript Logo TypeScript@aws-cdk/aws-bedrock-agentcore-alpha

Migration to Stable ​

All constructs except Policy have moved to aws-cdk-lib/aws-bedrockagentcore:

ts
// Before
import * as agentcore from '@aws-cdk/aws-bedrock-agentcore-alpha';
python
# Before
import aws_cdk.aws_bedrock_agentcore_alpha as agentcore
java
// Before
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;
csharp
// Before
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;
go
// Before
import agentcore "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"
ts
// After (for all non-Policy constructs)
import * as agentcore from 'aws-cdk-lib/aws-bedrockagentcore';
python
# After (for all non-Policy constructs)
import aws_cdk.aws_bedrockagentcore as agentcore
java
// After (for all non-Policy constructs)
import software.amazon.awscdk.services.bedrockagentcore.*;
csharp
// After (for all non-Policy constructs)
using Amazon.CDK.AWS.BedrockAgentCore;
go
// After (for all non-Policy constructs)
import agentcore "github.com/aws/aws-cdk-go/awscdk"

The following constructs are now in stable:

  • Runtime: Runtime, RuntimeEndpoint, AgentRuntimeArtifact, NetworkConfiguration, Observability
  • Gateway: Gateway, GatewayTarget, GatewayAuthorizer, GatewayCredentialProvider, Interceptor
  • Tools: BrowserCustom, CodeInterpreterCustom
  • Memory: Memory, MemoryStrategy
  • Evaluation: OnlineEvaluationConfig, Evaluator, EvaluatorSelector
  • Identity: OAuth2CredentialProvider, ApiKeyCredentialProvider, WorkloadIdentity

What Remains in Alpha ​

The Policy submodule remains experimental:

  • PolicyEngine
  • Policy
  • PolicyStatement
  • PolicyValidationMode
  • PolicyEngineMode

Policy Engine ​

A policy engine is a collection of policies that evaluates and authorizes agent tool calls. When associated with a gateway, the policy engine intercepts all agent requests and determines whether to allow or deny each action based on the defined policies.

For more information, see the Policy in Amazon Bedrock AgentCore documentation.

PolicyEngine Properties ​

NameTypeRequiredDescription
policyEngineNamestringNoThe name of the policy engine. Valid characters: a-z, A-Z, 0-9, _ (underscore). Must start with a letter, 1-48 characters. If not provided, a unique name will be auto-generated
descriptionstringNoOptional description for the policy engine (max 4,096 characters). Default: no description
kmsKeyIKeyNoCustom KMS key for encryption. IMPORTANT: Once set, cannot be changed (requires replacement). Must be symmetric ENCRYPT_DECRYPT key. If key becomes inaccessible, all authorization decisions will be DENIED. Default: AWS owned key
tags{ [key: string]: string }NoTags for the policy engine (max 50 tags). Default: no tags

Understanding Cedar Policies in AgentCore ​

Policies are constructed using Cedar language, an open source language for writing and enforcing authorization policies. Cedar policies in AgentCore follow a specific structure with three main components: Principal, Action, and Resource. Understanding how these components work together is critical for writing effective policies.

Policy Structure ​

Every Cedar policy has this basic structure:

cedar
permit(              // or forbid
  principal,         // Who is making the request
  action,            // What operation they want to perform
  resource           // What Gateway/tool they want to access
)
when {               // Optional conditions
  // Additional constraints
};

Example Policy

cedar
permit(
  principal,
  action == AgentCore::Action::"ApplicationToolTarget___create_application",
  resource == AgentCore::Gateway::"<gateway-arn>"
) when {
  context.input.coverage_amount <= 1000000
};

Basic PolicyEngine and Policy Creation ​

Create a policy engine and add policies to it.

Policy Engine Mode ​

When associating a policy engine with a gateway, you can control the enforcement behavior using PolicyEngineMode:

  • PolicyEngineMode.LOG_ONLY (default) — evaluates actions and adds traces but does not enforce decisions. Use this mode for testing and validation before enabling enforcement.
  • PolicyEngineMode.ENFORCE — actively allows or denies agent operations based on Cedar policy evaluation.
ts

// Create a Policy engine
const policyEngine = new agentcore.PolicyEngine(this, "MyPolicyEngine", {
  policyEngineName: "my_policy_engine",
  description: "Policy engine for access control",
});

const gateway = new agentcore.Gateway(this, "MyGateway", {
  gatewayName: "my-gateway",
  policyEngineConfiguration: {
    policyEngine: policyEngine,
    mode: agentcore.PolicyEngineMode.ENFORCE, // Default is LOG_ONLY
  },
});

// Add policy to policy engine
policyEngine.addPolicy("AllowAllActions", {
  definition: `
    permit(
      principal,
      action,
      resource == AgentCore::Gateway::"${gateway.gatewayArn}"
    );
  `,
  description: "Allow all actions on specific gateway (development)",
  validationMode: agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS, // This will ignore all cedar warnings
});

// you can add multiple policies to the policy engine
policyEngine.addPolicy("SpecificToolPolicy", {
  definition: `
    permit(
      principal is AgentCore::OAuthUser,
      action == AgentCore::Action::"WeatherTool__get_forecast",
      resource == AgentCore::Gateway::"${gateway.gatewayArn}"
    );
  `,
  description: "Allow specific weather tool access",
  validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS, // This will fail policy creation for any cedar warning
});
python
# Create a Policy engine
policy_engine = agentcore.PolicyEngine(self, "MyPolicyEngine",
    policy_engine_name="my_policy_engine",
    description="Policy engine for access control"
)

gateway = agentcore.Gateway(self, "MyGateway",
    gateway_name="my-gateway",
    policy_engine_configuration=agentcore.GatewayPolicyEngineConfig(
        policy_engine=policy_engine,
        mode=agentcore.PolicyEngineMode.ENFORCE
    )
)

# Add policy to policy engine
policy_engine.add_policy("AllowAllActions",
    definition=f"""
        permit(
          principal,
          action,
          resource == AgentCore::Gateway::\"{gateway.gatewayArn}\"
        );
      """,
    description="Allow all actions on specific gateway (development)",
    validation_mode=agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS
)

# you can add multiple policies to the policy engine
policy_engine.add_policy("SpecificToolPolicy",
    definition=f"""
        permit(
          principal is AgentCore::OAuthUser,
          action == AgentCore::Action::\"WeatherTool__get_forecast\",
          resource == AgentCore::Gateway::\"{gateway.gatewayArn}\"
        );
      """,
    description="Allow specific weather tool access",
    validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
java
// Create a Policy engine
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "MyPolicyEngine")
        .policyEngineName("my_policy_engine")
        .description("Policy engine for access control")
        .build();

Gateway gateway = Gateway.Builder.create(this, "MyGateway")
        .gatewayName("my-gateway")
        .policyEngineConfiguration(GatewayPolicyEngineConfig.builder()
                .policyEngine(policyEngine)
                .mode(PolicyEngineMode.ENFORCE)
                .build())
        .build();

// Add policy to policy engine
policyEngine.addPolicy("AllowAllActions", AddPolicyOptions.builder()
        .definition(String.format("%n    permit(%n      principal,%n      action,%n      resource == AgentCore::Gateway::\"%s\"%n    );%n  ", gateway.getGatewayArn()))
        .description("Allow all actions on specific gateway (development)")
        .validationMode(PolicyValidationMode.IGNORE_ALL_FINDINGS)
        .build());

// you can add multiple policies to the policy engine
policyEngine.addPolicy("SpecificToolPolicy", AddPolicyOptions.builder()
        .definition(String.format("%n    permit(%n      principal is AgentCore::OAuthUser,%n      action == AgentCore::Action::\"WeatherTool__get_forecast\",%n      resource == AgentCore::Gateway::\"%s\"%n    );%n  ", gateway.getGatewayArn()))
        .description("Allow specific weather tool access")
        .validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
        .build());
csharp
// Create a Policy engine
var policyEngine = new PolicyEngine(this, "MyPolicyEngine", new PolicyEngineProps {
    PolicyEngineName = "my_policy_engine",
    Description = "Policy engine for access control"
});

var gateway = new Gateway(this, "MyGateway", new GatewayProps {
    GatewayName = "my-gateway",
    PolicyEngineConfiguration = new GatewayPolicyEngineConfig {
        PolicyEngine = policyEngine,
        Mode = PolicyEngineMode.ENFORCE
    }
});

// Add policy to policy engine
policyEngine.AddPolicy("AllowAllActions", new AddPolicyOptions {
    Definition = $@"
        permit(
          principal,
          action,
          resource == AgentCore::Gateway::""{gateway.gatewayArn}""
        );
      ",
    Description = "Allow all actions on specific gateway (development)",
    ValidationMode = PolicyValidationMode.IGNORE_ALL_FINDINGS
});

// you can add multiple policies to the policy engine
policyEngine.AddPolicy("SpecificToolPolicy", new AddPolicyOptions {
    Definition = $@"
        permit(
          principal is AgentCore::OAuthUser,
          action == AgentCore::Action::""WeatherTool__get_forecast"",
          resource == AgentCore::Gateway::""{gateway.gatewayArn}""
        );
      ",
    Description = "Allow specific weather tool access",
    ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
go
// Create a Policy engine
policyEngine := agentcore.NewPolicyEngine(this, jsii.String("MyPolicyEngine"), &PolicyEngineProps{
	PolicyEngineName: jsii.String("my_policy_engine"),
	Description: jsii.String("Policy engine for access control"),
})

gateway := agentcore.NewGateway(this, jsii.String("MyGateway"), &GatewayProps{
	GatewayName: jsii.String("my-gateway"),
	PolicyEngineConfiguration: &GatewayPolicyEngineConfig{
		PolicyEngine: policyEngine,
		Mode: agentcore.PolicyEngineMode_ENFORCE(),
	},
})

// Add policy to policy engine
policyEngine.AddPolicy(jsii.String("AllowAllActions"), &AddPolicyOptions{
	Definition: fmt.Sprintf("\n    permit(\n      principal,\n      action,\n      resource == AgentCore::Gateway::\"%v\"\n    );\n  ", gateway.GatewayArn),
	Description: jsii.String("Allow all actions on specific gateway (development)"),
	ValidationMode: agentcore.PolicyValidationMode_IGNORE_ALL_FINDINGS(),
})

// you can add multiple policies to the policy engine
policyEngine.AddPolicy(jsii.String("SpecificToolPolicy"), &AddPolicyOptions{
	Definition: fmt.Sprintf("\n    permit(\n      principal is AgentCore::OAuthUser,\n      action == AgentCore::Action::\"WeatherTool__get_forecast\",\n      resource == AgentCore::Gateway::\"%v\"\n    );\n  ", gateway.*GatewayArn),
	Description: jsii.String("Allow specific weather tool access"),
	ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})

Type-Safe Policy Builder ​

For a more type-safe approach, use the PolicyStatement builder instead of writing raw Cedar syntax.

ts
const gateway = new agentcore.Gateway(this, "MyGateway", {
  gatewayName: "my-gateway",
});

const policyEngine = new agentcore.PolicyEngine(this, "MyPolicyEngine", {
  policyEngineName: "my_policy_engine",
});

const allowAllPolicy = new agentcore.Policy(this, "AllowAllPolicy", {
  policyEngine: policyEngine,
  policyName: "allow_all",
  statement: agentcore.PolicyStatement.permit()
    .forAllPrincipals() // ** This will give overly permission to all principals
    .onAllActions()
    .onResource('AgentCore::Gateway', gateway.gatewayArn),
  description: "Allow all actions on specific gateway (development only)",
  validationMode: agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS,
});

// Generated Cedar:
// permit(
//   principal,
//   action,
//   resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:region:account:gateway/gateway-id"
// );
python
gateway = agentcore.Gateway(self, "MyGateway",
    gateway_name="my-gateway"
)

policy_engine = agentcore.PolicyEngine(self, "MyPolicyEngine",
    policy_engine_name="my_policy_engine"
)

allow_all_policy = agentcore.Policy(self, "AllowAllPolicy",
    policy_engine=policy_engine,
    policy_name="allow_all",
    statement=agentcore.PolicyStatement.permit().for_all_principals().on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn),
    description="Allow all actions on specific gateway (development only)",
    validation_mode=agentcore.PolicyValidationMode.IGNORE_ALL_FINDINGS
)
java
Gateway gateway = Gateway.Builder.create(this, "MyGateway")
        .gatewayName("my-gateway")
        .build();

PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "MyPolicyEngine")
        .policyEngineName("my_policy_engine")
        .build();

Policy allowAllPolicy = Policy.Builder.create(this, "AllowAllPolicy")
        .policyEngine(policyEngine)
        .policyName("allow_all")
        .statement(PolicyStatement.permit().forAllPrincipals().onAllActions().onResource("AgentCore::Gateway", gateway.getGatewayArn()))
        .description("Allow all actions on specific gateway (development only)")
        .validationMode(PolicyValidationMode.IGNORE_ALL_FINDINGS)
        .build();
csharp
var gateway = new Gateway(this, "MyGateway", new GatewayProps {
    GatewayName = "my-gateway"
});

var policyEngine = new PolicyEngine(this, "MyPolicyEngine", new PolicyEngineProps {
    PolicyEngineName = "my_policy_engine"
});

var allowAllPolicy = new Policy(this, "AllowAllPolicy", new PolicyProps {
    PolicyEngine = policyEngine,
    PolicyName = "allow_all",
    Statement = PolicyStatement.Permit().ForAllPrincipals().OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn),
    Description = "Allow all actions on specific gateway (development only)",
    ValidationMode = PolicyValidationMode.IGNORE_ALL_FINDINGS
});
go
gateway := agentcore.NewGateway(this, jsii.String("MyGateway"), &GatewayProps{
	GatewayName: jsii.String("my-gateway"),
})

policyEngine := agentcore.NewPolicyEngine(this, jsii.String("MyPolicyEngine"), &PolicyEngineProps{
	PolicyEngineName: jsii.String("my_policy_engine"),
})

allowAllPolicy := agentcore.NewPolicy(this, jsii.String("AllowAllPolicy"), &PolicyProps{
	PolicyEngine: policyEngine,
	PolicyName: jsii.String("allow_all"),
	Statement: agentcore.PolicyStatement_Permit().ForAllPrincipals().OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn),
	Description: jsii.String("Allow all actions on specific gateway (development only)"),
	ValidationMode: agentcore.PolicyValidationMode_IGNORE_ALL_FINDINGS(),
})

Policy with Specific Actions ​

ts
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;

// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.addPolicy("SpecificToolPolicy", {
  statement: agentcore.PolicyStatement.permit()
    .forPrincipal('AgentCore::OAuthUser::your-client-id')
    .onActions([
      'AgentCore::Action::WeatherTool__get_forecast',
      'AgentCore::Action::WeatherTool__get_current',
    ])
    .onResource('AgentCore::Gateway', gateway.gatewayArn),
  description: "Allow specific weather tool operations",
  validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});

// Generated Cedar:
// permit(
//   principal is AgentCore::OAuthUser,
//   action in [
//     AgentCore::Action::"WeatherTool__get_forecast",
//     AgentCore::Action::"WeatherTool__get_current"
//   ],
//   resource == AgentCore::Gateway::"arn:aws:bedrock-agentcore:us-east-1:123:gateway/gw-123"
// );
python
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway


# Allow specific tool actions on specific gateway
# Action names follow pattern: "ToolName__operation"
policy_engine.add_policy("SpecificToolPolicy",
    statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser::your-client-id").on_actions(["AgentCore::Action::WeatherTool__get_forecast", "AgentCore::Action::WeatherTool__get_current"
    ]).on_resource("AgentCore::Gateway", gateway.gateway_arn),
    description="Allow specific weather tool operations",
    validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
java
PolicyEngine policyEngine;
Gateway gateway;


// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.addPolicy("SpecificToolPolicy", AddPolicyOptions.builder()
        .statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser::your-client-id").onActions(List.of("AgentCore::Action::WeatherTool__get_forecast", "AgentCore::Action::WeatherTool__get_current")).onResource("AgentCore::Gateway", gateway.getGatewayArn()))
        .description("Allow specific weather tool operations")
        .validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
        .build());
csharp
PolicyEngine policyEngine;
Gateway gateway;


// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.AddPolicy("SpecificToolPolicy", new AddPolicyOptions {
    Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser::your-client-id").OnActions(new [] { "AgentCore::Action::WeatherTool__get_forecast", "AgentCore::Action::WeatherTool__get_current" }).OnResource("AgentCore::Gateway", gateway.GatewayArn),
    Description = "Allow specific weather tool operations",
    ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
go
var policyEngine PolicyEngine
var gateway Gateway


// Allow specific tool actions on specific gateway
// Action names follow pattern: "ToolName__operation"
policyEngine.AddPolicy(jsii.String("SpecificToolPolicy"), &AddPolicyOptions{
	Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser::your-client-id")).OnActions([]*string{
		jsii.String("AgentCore::Action::WeatherTool__get_forecast"),
		jsii.String("AgentCore::Action::WeatherTool__get_current"),
	}).OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn),
	Description: jsii.String("Allow specific weather tool operations"),
	ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})

Policy with Conditions ​

Use when clauses to add advanced conditions based on principal tags (from OAuth token) or context:

ts
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;

// Policy with when conditions using principal tags
const conditionalPolicy = new agentcore.Policy(this, "ConditionalPolicy", {
  policyEngine: policyEngine,
  policyName: "conditional_access",
  statement: agentcore.PolicyStatement.permit()
    .forPrincipal('AgentCore::OAuthUser')  // Type constraint
    .onAllActions()
    .onResource('AgentCore::Gateway', gateway.gatewayArn)  // Specific ARN
    .when()
      .principalAttribute('department').equalTo('Engineering')
      .and()
      .contextAttribute('input.priority').equalTo('high')
      .done(),
  description: "Allow engineers for high-priority requests",
  validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});

// Generated Cedar:
// permit(
//   principal is AgentCore::OAuthUser,
//   action,
//   resource == AgentCore::Gateway::"arn:..."
// )
// when {
//   principal.department == "Engineering" && context.input.priority == "high"
// };
python
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway


# Policy with when conditions using principal tags
conditional_policy = agentcore.Policy(self, "ConditionalPolicy",
    policy_engine=policy_engine,
    policy_name="conditional_access",
    statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser").on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn).when().principal_attribute("department").equal_to("Engineering").and().context_attribute("input.priority").equal_to("high").done(),
    description="Allow engineers for high-priority requests",
    validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
java
PolicyEngine policyEngine;
Gateway gateway;


// Policy with when conditions using principal tags
Policy conditionalPolicy = Policy.Builder.create(this, "ConditionalPolicy")
        .policyEngine(policyEngine)
        .policyName("conditional_access")
        .statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser").onAllActions().onResource("AgentCore::Gateway", gateway.gatewayArn).when().principalAttribute("department").equalTo("Engineering").and().contextAttribute("input.priority").equalTo("high").done())
        .description("Allow engineers for high-priority requests")
        .validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
        .build();
csharp
PolicyEngine policyEngine;
Gateway gateway;


// Policy with when conditions using principal tags
var conditionalPolicy = new Policy(this, "ConditionalPolicy", new PolicyProps {
    PolicyEngine = policyEngine,
    PolicyName = "conditional_access",
    Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser").OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn).When().PrincipalAttribute("department").EqualTo("Engineering").And().ContextAttribute("input.priority").EqualTo("high").Done(),
    Description = "Allow engineers for high-priority requests",
    ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
go
var policyEngine PolicyEngine
var gateway Gateway


// Policy with when conditions using principal tags
conditionalPolicy := agentcore.NewPolicy(this, jsii.String("ConditionalPolicy"), &PolicyProps{
	PolicyEngine: policyEngine,
	PolicyName: jsii.String("conditional_access"),
	Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser")).OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn).When().PrincipalAttribute(jsii.String("department")).EqualTo(jsii.String("Engineering")).And().ContextAttribute(jsii.String("input.priority")).*EqualTo(jsii.String("high")).Done(),
	Description: jsii.String("Allow engineers for high-priority requests"),
	ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})

Policy with Exclusions (unless) ​

Use unless clauses to exclude specific conditions from a policy. The policy applies when the unless conditions are NOT met:

ts
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;

// Allow access unless the user is suspended
const policyWithUnless = new agentcore.Policy(this, "UnlessPolicy", {
  policyEngine: policyEngine,
  policyName: "unless_suspended",
  statement: agentcore.PolicyStatement.permit()
    .forPrincipal('AgentCore::OAuthUser')
    .onAllActions()
    .onResource('AgentCore::Gateway', gateway.gatewayArn)
    .unless()
      .principalAttribute('suspended').equalTo(true)
      .done(),
  description: "Allow all actions unless user is suspended",
  validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});

// Generated Cedar:
// permit(
//   principal is AgentCore::OAuthUser,
//   action,
//   resource == AgentCore::Gateway::"arn:..."
// )
// unless {
//   principal.suspended == true
// };
python
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway


# Allow access unless the user is suspended
policy_with_unless = agentcore.Policy(self, "UnlessPolicy",
    policy_engine=policy_engine,
    policy_name="unless_suspended",
    statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser").on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn).unless().principal_attribute("suspended").equal_to(True).done(),
    description="Allow all actions unless user is suspended",
    validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
java
PolicyEngine policyEngine;
Gateway gateway;


// Allow access unless the user is suspended
Policy policyWithUnless = Policy.Builder.create(this, "UnlessPolicy")
        .policyEngine(policyEngine)
        .policyName("unless_suspended")
        .statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser").onAllActions().onResource("AgentCore::Gateway", gateway.gatewayArn).unless().principalAttribute("suspended").equalTo(true).done())
        .description("Allow all actions unless user is suspended")
        .validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
        .build();
csharp
PolicyEngine policyEngine;
Gateway gateway;


// Allow access unless the user is suspended
var policyWithUnless = new Policy(this, "UnlessPolicy", new PolicyProps {
    PolicyEngine = policyEngine,
    PolicyName = "unless_suspended",
    Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser").OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn).Unless().PrincipalAttribute("suspended").EqualTo(true).Done(),
    Description = "Allow all actions unless user is suspended",
    ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
go
var policyEngine PolicyEngine
var gateway Gateway


// Allow access unless the user is suspended
policyWithUnless := agentcore.NewPolicy(this, jsii.String("UnlessPolicy"), &PolicyProps{
	PolicyEngine: policyEngine,
	PolicyName: jsii.String("unless_suspended"),
	Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser")).OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn).Unless().PrincipalAttribute(jsii.String("suspended")).EqualTo(jsii.Boolean(true)).Done(),
	Description: jsii.String("Allow all actions unless user is suspended"),
	ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})

You can combine when and unless clauses in the same policy:

ts
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;

// Allow engineers unless they are on probation
policyEngine.addPolicy("CombinedConditions", {
  statement: agentcore.PolicyStatement.permit()
    .forPrincipal('AgentCore::OAuthUser')
    .onAllActions()
    .onResource('AgentCore::Gateway', gateway.gatewayArn)
    .when()
      .principalAttribute('department').equalTo('Engineering')
      .done()
    .unless()
      .principalAttribute('status').equalTo('probation')
      .done(),
  description: "Allow engineers unless on probation",
  validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});
python
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway


# Allow engineers unless they are on probation
policy_engine.add_policy("CombinedConditions",
    statement=agentcore.PolicyStatement.permit().for_principal("AgentCore::OAuthUser").on_all_actions().on_resource("AgentCore::Gateway", gateway.gateway_arn).when().principal_attribute("department").equal_to("Engineering").done().unless().principal_attribute("status").equal_to("probation").done(),
    description="Allow engineers unless on probation",
    validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
java
PolicyEngine policyEngine;
Gateway gateway;


// Allow engineers unless they are on probation
policyEngine.addPolicy("CombinedConditions", AddPolicyOptions.builder()
        .statement(PolicyStatement.permit().forPrincipal("AgentCore::OAuthUser").onAllActions().onResource("AgentCore::Gateway", gateway.gatewayArn).when().principalAttribute("department").equalTo("Engineering").done().unless().principalAttribute("status").equalTo("probation").done())
        .description("Allow engineers unless on probation")
        .validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
        .build());
csharp
PolicyEngine policyEngine;
Gateway gateway;


// Allow engineers unless they are on probation
policyEngine.AddPolicy("CombinedConditions", new AddPolicyOptions {
    Statement = PolicyStatement.Permit().ForPrincipal("AgentCore::OAuthUser").OnAllActions().OnResource("AgentCore::Gateway", gateway.GatewayArn).When().PrincipalAttribute("department").EqualTo("Engineering").Done().Unless().PrincipalAttribute("status").EqualTo("probation").Done(),
    Description = "Allow engineers unless on probation",
    ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
go
var policyEngine PolicyEngine
var gateway Gateway


// Allow engineers unless they are on probation
policyEngine.AddPolicy(jsii.String("CombinedConditions"), &AddPolicyOptions{
	Statement: agentcore.PolicyStatement_Permit().ForPrincipal(jsii.String("AgentCore::OAuthUser")).OnAllActions().OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn).When().PrincipalAttribute(jsii.String("department")).EqualTo(jsii.String("Engineering")).Done().Unless().*PrincipalAttribute(jsii.String("status")).*EqualTo(jsii.String("probation")).*Done(),
	Description: jsii.String("Allow engineers unless on probation"),
	ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})

Forbid (Deny) Policy ​

Use forbid to explicitly deny access. Forbid policies override permit policies.

ts
declare const policyEngine: agentcore.PolicyEngine;
declare const gateway: agentcore.Gateway;

// Explicitly deny dangerous tool operations
policyEngine.addPolicy("DenyDangerous", {
  statement: agentcore.PolicyStatement.forbid()
    .forAllPrincipals()
    .onAction('AgentCore::Action::DeleteTool__delete_all')
    .onResource('AgentCore::Gateway', gateway.gatewayArn),
  description: "Forbid delete_all operation for all users",
  validationMode: agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS,
});

// Generated Cedar:
// forbid(
//   principal,
//   action == AgentCore::Action::"DeleteTool__delete_all",
//   resource == AgentCore::Gateway::"arn:..."
// );
python
# policy_engine: agentcore.PolicyEngine
# gateway: agentcore.Gateway


# Explicitly deny dangerous tool operations
policy_engine.add_policy("DenyDangerous",
    statement=agentcore.PolicyStatement.forbid().for_all_principals().on_action("AgentCore::Action::DeleteTool__delete_all").on_resource("AgentCore::Gateway", gateway.gateway_arn),
    description="Forbid delete_all operation for all users",
    validation_mode=agentcore.PolicyValidationMode.FAIL_ON_ANY_FINDINGS
)
java
PolicyEngine policyEngine;
Gateway gateway;


// Explicitly deny dangerous tool operations
policyEngine.addPolicy("DenyDangerous", AddPolicyOptions.builder()
        .statement(PolicyStatement.forbid().forAllPrincipals().onAction("AgentCore::Action::DeleteTool__delete_all").onResource("AgentCore::Gateway", gateway.getGatewayArn()))
        .description("Forbid delete_all operation for all users")
        .validationMode(PolicyValidationMode.FAIL_ON_ANY_FINDINGS)
        .build());
csharp
PolicyEngine policyEngine;
Gateway gateway;


// Explicitly deny dangerous tool operations
policyEngine.AddPolicy("DenyDangerous", new AddPolicyOptions {
    Statement = PolicyStatement.Forbid().ForAllPrincipals().OnAction("AgentCore::Action::DeleteTool__delete_all").OnResource("AgentCore::Gateway", gateway.GatewayArn),
    Description = "Forbid delete_all operation for all users",
    ValidationMode = PolicyValidationMode.FAIL_ON_ANY_FINDINGS
});
go
var policyEngine PolicyEngine
var gateway Gateway


// Explicitly deny dangerous tool operations
policyEngine.AddPolicy(jsii.String("DenyDangerous"), &AddPolicyOptions{
	Statement: agentcore.PolicyStatement_Forbid().ForAllPrincipals().OnAction(jsii.String("AgentCore::Action::DeleteTool__delete_all")).OnResource(jsii.String("AgentCore::Gateway"), gateway.GatewayArn),
	Description: jsii.String("Forbid delete_all operation for all users"),
	ValidationMode: agentcore.PolicyValidationMode_FAIL_ON_ANY_FINDINGS(),
})

Raw Cedar for Advanced Cases ​

For advanced Cedar features not supported by the builder, use raw Cedar strings:

ts
declare const policyEngine: agentcore.PolicyEngine;

// Option 1: Using definition property
const advancedPolicy = new agentcore.Policy(this, "AdvancedPolicy", {
  policyEngine: policyEngine,
  definition: 'permit(principal, action, resource) when { context.custom > 10 };',
  description: "Advanced policy with custom Cedar logic",
});

// Option 2: Using fromCedar() with statement property
policyEngine.addPolicy("CustomPolicy", {
  statement: agentcore.PolicyStatement.fromCedar(
    'forbid(principal, action, resource) when { resource.confidential == true };'
  ),
  description: "Custom policy from Cedar string",
});
python
# policy_engine: agentcore.PolicyEngine


# Option 1: Using definition property
advanced_policy = agentcore.Policy(self, "AdvancedPolicy",
    policy_engine=policy_engine,
    definition="permit(principal, action, resource) when { context.custom > 10 };",
    description="Advanced policy with custom Cedar logic"
)

# Option 2: Using fromCedar() with statement property
policy_engine.add_policy("CustomPolicy",
    statement=agentcore.PolicyStatement.from_cedar("forbid(principal, action, resource) when { resource.confidential == true };"),
    description="Custom policy from Cedar string"
)
java
PolicyEngine policyEngine;


// Option 1: Using definition property
Policy advancedPolicy = Policy.Builder.create(this, "AdvancedPolicy")
        .policyEngine(policyEngine)
        .definition("permit(principal, action, resource) when { context.custom > 10 };")
        .description("Advanced policy with custom Cedar logic")
        .build();

// Option 2: Using fromCedar() with statement property
policyEngine.addPolicy("CustomPolicy", AddPolicyOptions.builder()
        .statement(PolicyStatement.fromCedar("forbid(principal, action, resource) when { resource.confidential == true };"))
        .description("Custom policy from Cedar string")
        .build());
csharp
PolicyEngine policyEngine;


// Option 1: Using definition property
var advancedPolicy = new Policy(this, "AdvancedPolicy", new PolicyProps {
    PolicyEngine = policyEngine,
    Definition = "permit(principal, action, resource) when { context.custom > 10 };",
    Description = "Advanced policy with custom Cedar logic"
});

// Option 2: Using fromCedar() with statement property
policyEngine.AddPolicy("CustomPolicy", new AddPolicyOptions {
    Statement = PolicyStatement.FromCedar("forbid(principal, action, resource) when { resource.confidential == true };"),
    Description = "Custom policy from Cedar string"
});
go
var policyEngine PolicyEngine


// Option 1: Using definition property
advancedPolicy := agentcore.NewPolicy(this, jsii.String("AdvancedPolicy"), &PolicyProps{
	PolicyEngine: policyEngine,
	Definition: jsii.String("permit(principal, action, resource) when { context.custom > 10 };"),
	Description: jsii.String("Advanced policy with custom Cedar logic"),
})

// Option 2: Using fromCedar() with statement property
policyEngine.AddPolicy(jsii.String("CustomPolicy"), &AddPolicyOptions{
	Statement: agentcore.PolicyStatement_FromCedar(jsii.String("forbid(principal, action, resource) when { resource.confidential == true };")),
	Description: jsii.String("Custom policy from Cedar string"),
})

Note: You must specify either definition (raw Cedar string) or statement (PolicyStatement builder), but not both.

Accessing Policies on PolicyEngine ​

You can access the list of policies added to a PolicyEngine using policyEngine.policies.

PolicyEngine with KMS Encryption ​

Encrypt policy data with a custom KMS key.

ts
// Create a custom KMS key
const policyKey = new kms.Key(this, "PolicyEngineKey", {
  enableKeyRotation: true,
  description: "KMS key for policy engine encryption",
});

// Create policy engine with encryption
const policyEngine = new agentcore.PolicyEngine(this, "EncryptedEngine", {
  policyEngineName: "encrypted_engine",
  description: "Policy engine with KMS encryption",
  kmsKey: policyKey,
});
python
# Create a custom KMS key
policy_key = kms.Key(self, "PolicyEngineKey",
    enable_key_rotation=True,
    description="KMS key for policy engine encryption"
)

# Create policy engine with encryption
policy_engine = agentcore.PolicyEngine(self, "EncryptedEngine",
    policy_engine_name="encrypted_engine",
    description="Policy engine with KMS encryption",
    kms_key=policy_key
)
java
// Create a custom KMS key
Key policyKey = Key.Builder.create(this, "PolicyEngineKey")
        .enableKeyRotation(true)
        .description("KMS key for policy engine encryption")
        .build();

// Create policy engine with encryption
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "EncryptedEngine")
        .policyEngineName("encrypted_engine")
        .description("Policy engine with KMS encryption")
        .kmsKey(policyKey)
        .build();
csharp
// Create a custom KMS key
var policyKey = new Key(this, "PolicyEngineKey", new KeyProps {
    EnableKeyRotation = true,
    Description = "KMS key for policy engine encryption"
});

// Create policy engine with encryption
var policyEngine = new PolicyEngine(this, "EncryptedEngine", new PolicyEngineProps {
    PolicyEngineName = "encrypted_engine",
    Description = "Policy engine with KMS encryption",
    KmsKey = policyKey
});
go
// Create a custom KMS key
policyKey := kms.NewKey(this, jsii.String("PolicyEngineKey"), &KeyProps{
	EnableKeyRotation: jsii.Boolean(true),
	Description: jsii.String("KMS key for policy engine encryption"),
})

// Create policy engine with encryption
policyEngine := agentcore.NewPolicyEngine(this, jsii.String("EncryptedEngine"), &PolicyEngineProps{
	PolicyEngineName: jsii.String("encrypted_engine"),
	Description: jsii.String("Policy engine with KMS encryption"),
	KmsKey: policyKey,
})

Importing Existing PolicyEngine ​

Import an existing policy engine from its ARN:

ts
const importedEngine = agentcore.PolicyEngine.fromPolicyEngineAttributes(
  this,
  "ImportedEngine",
  {
    policyEngineArn: "policy-engine-arn",
    kmsKeyArn: "kms-arn",
  }
);

// Use the imported engine
const policy = new agentcore.Policy(this, "PolicyForImportedEngine", {
  policyEngine: importedEngine,
  definition: "permit(principal, action, resource);",
});
python
imported_engine = agentcore.PolicyEngine.from_policy_engine_attributes(self, "ImportedEngine",
    policy_engine_arn="policy-engine-arn",
    kms_key_arn="kms-arn"
)

# Use the imported engine
policy = agentcore.Policy(self, "PolicyForImportedEngine",
    policy_engine=imported_engine,
    definition="permit(principal, action, resource);"
)
java
IPolicyEngine importedEngine = PolicyEngine.fromPolicyEngineAttributes(this, "ImportedEngine", PolicyEngineAttributes.builder()
        .policyEngineArn("policy-engine-arn")
        .kmsKeyArn("kms-arn")
        .build());

// Use the imported engine
Policy policy = Policy.Builder.create(this, "PolicyForImportedEngine")
        .policyEngine(importedEngine)
        .definition("permit(principal, action, resource);")
        .build();
csharp
var importedEngine = PolicyEngine.FromPolicyEngineAttributes(this, "ImportedEngine", new PolicyEngineAttributes {
    PolicyEngineArn = "policy-engine-arn",
    KmsKeyArn = "kms-arn"
});

// Use the imported engine
var policy = new Policy(this, "PolicyForImportedEngine", new PolicyProps {
    PolicyEngine = importedEngine,
    Definition = "permit(principal, action, resource);"
});
go
importedEngine := agentcore.PolicyEngine_FromPolicyEngineAttributes(this, jsii.String("ImportedEngine"), &PolicyEngineAttributes{
	PolicyEngineArn: jsii.String("policy-engine-arn"),
	KmsKeyArn: jsii.String("kms-arn"),
})

// Use the imported engine
policy := agentcore.NewPolicy(this, jsii.String("PolicyForImportedEngine"), &PolicyProps{
	PolicyEngine: importedEngine,
	Definition: jsii.String("permit(principal, action, resource);"),
})

Importing Existing Policy ​

Import an existing policy from its ARN:

ts
const importedEngine = agentcore.PolicyEngine.fromPolicyEngineAttributes(
  this,
  "ImportedEngine",
  {
    policyEngineArn: "policy-engine/my-engine-id",
  }
);

const importedPolicy = agentcore.Policy.fromPolicyAttributes(
  this,
  "ImportedPolicy",
  {
    policyArn: "my-policy-arn",
    policyEngine: importedEngine,
  }
);

// Grant permissions to the imported policy
const role = new iam.Role(this, "PolicyRole", {
  assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com"),
});

importedPolicy.grantRead(role);
python
imported_engine = agentcore.PolicyEngine.from_policy_engine_attributes(self, "ImportedEngine",
    policy_engine_arn="policy-engine/my-engine-id"
)

imported_policy = agentcore.Policy.from_policy_attributes(self, "ImportedPolicy",
    policy_arn="my-policy-arn",
    policy_engine=imported_engine
)

# Grant permissions to the imported policy
role = iam.Role(self, "PolicyRole",
    assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
)

imported_policy.grant_read(role)
java
IPolicyEngine importedEngine = PolicyEngine.fromPolicyEngineAttributes(this, "ImportedEngine", PolicyEngineAttributes.builder()
        .policyEngineArn("policy-engine/my-engine-id")
        .build());

IPolicy importedPolicy = Policy.fromPolicyAttributes(this, "ImportedPolicy", PolicyAttributes.builder()
        .policyArn("my-policy-arn")
        .policyEngine(importedEngine)
        .build());

// Grant permissions to the imported policy
Role role = Role.Builder.create(this, "PolicyRole")
        .assumedBy(new ServicePrincipal("lambda.amazonaws.com"))
        .build();

importedPolicy.grantRead(role);
csharp
var importedEngine = PolicyEngine.FromPolicyEngineAttributes(this, "ImportedEngine", new PolicyEngineAttributes {
    PolicyEngineArn = "policy-engine/my-engine-id"
});

var importedPolicy = Policy.FromPolicyAttributes(this, "ImportedPolicy", new PolicyAttributes {
    PolicyArn = "my-policy-arn",
    PolicyEngine = importedEngine
});

// Grant permissions to the imported policy
var role = new Role(this, "PolicyRole", new RoleProps {
    AssumedBy = new ServicePrincipal("lambda.amazonaws.com")
});

importedPolicy.GrantRead(role);
go
importedEngine := agentcore.PolicyEngine_FromPolicyEngineAttributes(this, jsii.String("ImportedEngine"), &PolicyEngineAttributes{
	PolicyEngineArn: jsii.String("policy-engine/my-engine-id"),
})

importedPolicy := agentcore.Policy_FromPolicyAttributes(this, jsii.String("ImportedPolicy"), &PolicyAttributes{
	PolicyArn: jsii.String("my-policy-arn"),
	PolicyEngine: importedEngine,
})

// Grant permissions to the imported policy
role := iam.NewRole(this, jsii.String("PolicyRole"), &RoleProps{
	AssumedBy: iam.NewServicePrincipal(jsii.String("lambda.amazonaws.com")),
})

importedPolicy.GrantRead(role)

PolicyEngine IAM Permissions ​

Grant various levels of access to policy engines:

ts
const policyEngine = new agentcore.PolicyEngine(this, "MyEngine", {
  policyEngineName: "my_engine",
});

const lambdaRole = new iam.Role(this, "LambdaRole", {
  assumedBy: new iam.ServicePrincipal("lambda.amazonaws.com"),
});

// Grant read permissions
policyEngine.grantRead(lambdaRole);

// Grant evaluation permissions
policyEngine.grantEvaluate(lambdaRole);
python
policy_engine = agentcore.PolicyEngine(self, "MyEngine",
    policy_engine_name="my_engine"
)

lambda_role = iam.Role(self, "LambdaRole",
    assumed_by=iam.ServicePrincipal("lambda.amazonaws.com")
)

# Grant read permissions
policy_engine.grant_read(lambda_role)

# Grant evaluation permissions
policy_engine.grant_evaluate(lambda_role)
java
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "MyEngine")
        .policyEngineName("my_engine")
        .build();

Role lambdaRole = Role.Builder.create(this, "LambdaRole")
        .assumedBy(new ServicePrincipal("lambda.amazonaws.com"))
        .build();

// Grant read permissions
policyEngine.grantRead(lambdaRole);

// Grant evaluation permissions
policyEngine.grantEvaluate(lambdaRole);
csharp
var policyEngine = new PolicyEngine(this, "MyEngine", new PolicyEngineProps {
    PolicyEngineName = "my_engine"
});

var lambdaRole = new Role(this, "LambdaRole", new RoleProps {
    AssumedBy = new ServicePrincipal("lambda.amazonaws.com")
});

// Grant read permissions
policyEngine.GrantRead(lambdaRole);

// Grant evaluation permissions
policyEngine.GrantEvaluate(lambdaRole);
go
policyEngine := agentcore.NewPolicyEngine(this, jsii.String("MyEngine"), &PolicyEngineProps{
	PolicyEngineName: jsii.String("my_engine"),
})

lambdaRole := iam.NewRole(this, jsii.String("LambdaRole"), &RoleProps{
	AssumedBy: iam.NewServicePrincipal(jsii.String("lambda.amazonaws.com")),
})

// Grant read permissions
policyEngine.GrantRead(lambdaRole)

// Grant evaluation permissions
policyEngine.GrantEvaluate(lambdaRole)

Using Policy with Stable Gateway ​

Since Gateway is now in aws-cdk-lib/aws-bedrockagentcore but Policy remains in alpha, use the L1 escape hatch to associate a policy engine with a stable gateway:

Proper L2 integration will be added in a future update.

ts
import * as agentcore from 'aws-cdk-lib/aws-bedrockagentcore';
import * as agentcoreAlpha from '@aws-cdk/aws-bedrock-agentcore-alpha';

// Create policy engine (alpha)
const policyEngine = new agentcoreAlpha.PolicyEngine(this, 'Engine', {
  policyEngineName: 'my_engine',
});

// Create gateway (stable)
const gateway = new agentcore.Gateway(this, 'Gateway', {
  gatewayName: 'my-gateway',
});

// Wire policy engine to gateway via the L1 construct
const cfnGateway = gateway.node.defaultChild as agentcore.CfnGateway;
cfnGateway.policyEngineConfiguration = {
  arn: policyEngine.policyEngineArn,
  mode: agentcoreAlpha.PolicyEngineMode.ENFORCE.value,
};

// Grant evaluate permissions to the gateway role
gateway.role.addToPrincipalPolicy(new iam.PolicyStatement({
  actions: ['bedrock-agentcore:GetPolicyEngine'],
  resources: [policyEngine.policyEngineArn],
}));
gateway.role.addToPrincipalPolicy(new iam.PolicyStatement({
  actions: ['bedrock-agentcore:AuthorizeAction', 'bedrock-agentcore:PartiallyAuthorizeActions'],
  resources: [policyEngine.policyEngineArn, gateway.gatewayArn],
}));
python
import aws_cdk.aws_bedrockagentcore as agentcore
import aws_cdk.aws_bedrock_agentcore_alpha as agentcore_alpha


# Create policy engine (alpha)
policy_engine = agentcore_alpha.PolicyEngine(self, "Engine",
    policy_engine_name="my_engine"
)

# Create gateway (stable)
gateway = agentcore.Gateway(self, "Gateway",
    gateway_name="my-gateway"
)

# Wire policy engine to gateway via the L1 construct
cfn_gateway = gateway.node.default_child
cfn_gateway.policy_engine_configuration = agentcore.CfnGateway.GatewayPolicyEngineConfigurationProperty(
    arn=policy_engine.policy_engine_arn,
    mode=agentcore_alpha.PolicyEngineMode.ENFORCE.value
)

# Grant evaluate permissions to the gateway role
gateway.role.add_to_principal_policy(iam.PolicyStatement(
    actions=["bedrock-agentcore:GetPolicyEngine"],
    resources=[policy_engine.policy_engine_arn]
))
gateway.role.add_to_principal_policy(iam.PolicyStatement(
    actions=["bedrock-agentcore:AuthorizeAction", "bedrock-agentcore:PartiallyAuthorizeActions"],
    resources=[policy_engine.policy_engine_arn, gateway.gateway_arn]
))
java
import software.amazon.awscdk.services.bedrockagentcore.*;
import software.amazon.awscdk.services.bedrock.agentcore.alpha.*;


// Create policy engine (alpha)
PolicyEngine policyEngine = PolicyEngine.Builder.create(this, "Engine")
        .policyEngineName("my_engine")
        .build();

// Create gateway (stable)
Gateway gateway = Gateway.Builder.create(this, "Gateway")
        .gatewayName("my-gateway")
        .build();

// Wire policy engine to gateway via the L1 construct
CfnGateway cfnGateway = (CfnGateway)gateway.getNode().getDefaultChild();
cfnGateway.getPolicyEngineConfiguration() = GatewayPolicyEngineConfigurationProperty.builder()
        .arn(policyEngine.getPolicyEngineArn())
        .mode(PolicyEngineMode.ENFORCE.getValue())
        .build();

// Grant evaluate permissions to the gateway role
gateway.role.addToPrincipalPolicy(PolicyStatement.Builder.create()
        .actions(List.of("bedrock-agentcore:GetPolicyEngine"))
        .resources(List.of(policyEngine.getPolicyEngineArn()))
        .build());
gateway.role.addToPrincipalPolicy(PolicyStatement.Builder.create()
        .actions(List.of("bedrock-agentcore:AuthorizeAction", "bedrock-agentcore:PartiallyAuthorizeActions"))
        .resources(List.of(policyEngine.getPolicyEngineArn(), gateway.getGatewayArn()))
        .build());
csharp
using Amazon.CDK.AWS.BedrockAgentCore;
using Amazon.CDK.AWS.Bedrock.Agentcore.Alpha;


// Create policy engine (alpha)
var policyEngine = new PolicyEngine(this, "Engine", new PolicyEngineProps {
    PolicyEngineName = "my_engine"
});

// Create gateway (stable)
var gateway = new Gateway(this, "Gateway", new GatewayProps {
    GatewayName = "my-gateway"
});

// Wire policy engine to gateway via the L1 construct
var cfnGateway = (CfnGateway)gateway.Node.DefaultChild;
cfnGateway.PolicyEngineConfiguration = new GatewayPolicyEngineConfigurationProperty {
    Arn = policyEngine.PolicyEngineArn,
    Mode = PolicyEngineMode.ENFORCE.Value
};

// Grant evaluate permissions to the gateway role
gateway.Role.AddToPrincipalPolicy(new PolicyStatement(new PolicyStatementProps {
    Actions = new [] { "bedrock-agentcore:GetPolicyEngine" },
    Resources = new [] { policyEngine.PolicyEngineArn }
}));
gateway.Role.AddToPrincipalPolicy(new PolicyStatement(new PolicyStatementProps {
    Actions = new [] { "bedrock-agentcore:AuthorizeAction", "bedrock-agentcore:PartiallyAuthorizeActions" },
    Resources = new [] { policyEngine.PolicyEngineArn, gateway.GatewayArn }
}));
go
import agentcore "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awsbedrockagentcorealpha"


// Create policy engine (alpha)
policyEngine := agentcoreAlpha.NewPolicyEngine(this, jsii.String("Engine"), &PolicyEngineProps{
	PolicyEngineName: jsii.String("my_engine"),
})

// Create gateway (stable)
gateway := agentcore.NewGateway(this, jsii.String("Gateway"), &GatewayProps{
	GatewayName: jsii.String("my-gateway"),
})

// Wire policy engine to gateway via the L1 construct
cfnGateway := gateway.Node.defaultChild.(CfnGateway)
cfnGateway.policyEngineConfiguration = &GatewayPolicyEngineConfigurationProperty{
	Arn: policyEngine.PolicyEngineArn,
	Mode: agentcoreAlpha.PolicyEngineMode_ENFORCE().Value,
}

// Grant evaluate permissions to the gateway role
gateway.Role.AddToPrincipalPolicy(iam.NewPolicyStatement(&PolicyStatementProps{
	Actions: []*string{
		jsii.String("bedrock-agentcore:GetPolicyEngine"),
	},
	Resources: []*string{
		policyEngine.*PolicyEngineArn,
	},
}))
gateway.Role.AddToPrincipalPolicy(iam.NewPolicyStatement(&PolicyStatementProps{
	Actions: []*string{
		jsii.String("bedrock-agentcore:AuthorizeAction"),
		jsii.String("bedrock-agentcore:PartiallyAuthorizeActions"),
	},
	Resources: []*string{
		policyEngine.*PolicyEngineArn,
		gateway.GatewayArn,
	},
}))

Types ​

NameKindSummary
ApiKeyCredentialProviderConstruct (L2)L2 construct for AWS::BedrockAgentCore::ApiKeyCredentialProvider.
BrowserCustomConstruct (L2)Browser resource for AWS Bedrock Agent Core.
BrowserCustomBaseConstruct (L2)Abstract base class for a Browser.
CodeInterpreterCustomConstruct (L2)Custom code interpreter resource for AWS Bedrock Agent Core.
CodeInterpreterCustomBaseConstruct (L2)Abstract base class for a Code Interpreter.
EvaluatorConstruct (L2)A custom evaluator for Amazon Bedrock AgentCore.
EvaluatorBaseConstruct (L2)Abstract base class for Evaluator.
GatewayConstruct (L2)Gateway resource for AWS Bedrock Agent Core.
GatewayBaseConstruct (L2)Base class for Gateway constructs.
GatewayTargetConstruct (L2)Defines tools that your gateway will host.
GatewayTargetBaseConstruct (L2)Base class for gateway target implementations.
MemoryConstruct (L2)Long-term memory store for extracted insights like user preferences, semantic facts and summaries.
MemoryBaseConstruct (L2)Abstract base class for a Memory.
OAuth2CredentialProviderConstruct (L2)L2 construct for AWS::BedrockAgentCore::OAuth2CredentialProvider.
OnlineEvaluationBaseConstruct (L2)Abstract base class for OnlineEvaluationConfig.
OnlineEvaluationConfigConstruct (L2)Online evaluation configuration for Amazon Bedrock AgentCore.
PolicyConstruct (L2)Individual Cedar policy defining what agents can access.
PolicyBaseConstruct (L2)Abstract base class for a Policy.
PolicyEngineConstruct (L2)Container that manages Cedar authorization policies associated with gateways.
PolicyEngineBaseConstruct (L2)Abstract base class for a PolicyEngine.
RuntimeConstruct (L2)Bedrock Agent Core Runtime Enables running containerized agents with specific network configurations, security settings, and runtime artifacts.
RuntimeBaseConstruct (L2)Base class for Agent Runtime.
RuntimeEndpointConstruct (L2)Bedrock Agent Core Runtime Endpoint Provides a stable endpoint for invoking agent runtimes with versioning support.
RuntimeEndpointBaseConstruct (L2)Base class for Runtime Endpoint.
WorkloadIdentityConstruct (L2)L2 construct for AWS::BedrockAgentCore::WorkloadIdentity.
AddApiGatewayTargetOptionsStructOptions for adding an API Gateway target to a gateway.
AddEndpointOptionsStructOptions for adding an endpoint to the runtime.
AddLambdaTargetOptionsStructOptions for adding a Lambda target to a gateway.
AddMcpServerTargetOptionsStructOptions for adding an MCP Server target to a gateway.
AddOpenApiTargetOptionsStructOptions for adding an OpenAPI target to a gateway.
AddPolicyOptionsStructOptions for adding a policy via PolicyEngine.addPolicy().
AddSmithyTargetOptionsStructOptions for adding a Smithy target to a gateway.
AgentCoreRuntimeEnumBedrock AgentCore runtime environment for code execution Allowed values: PYTHON_3_10 | PYTHON_3_11 | PYTHON_3_12 | PYTHON_3_13 | PYTHON_3_14 | NODE_22.
AgentRuntimeArtifactClassAbstract base class for agent runtime artifacts.
AgentRuntimeAttributesStructAttributes for importing an existing Agent Runtime.
ApiGatewayHttpMethodEnumHTTP methods supported by API Gateway.
ApiGatewayTargetConfigurationClassConfiguration for API Gateway-based MCP targets.
ApiGatewayTargetConfigurationPropsStructProperties for creating an API Gateway target configuration.
ApiGatewayToolConfigurationStructConfiguration for API Gateway tools.
ApiGatewayToolFilterStructConfiguration for filtering API Gateway tools.
ApiGatewayToolOverrideStructConfiguration for overriding API Gateway tool metadata.
ApiKeyAdditionalConfigurationStructAPI Key additional configuration.
ApiKeyCredentialLocationClassAPI Key location within the request.
ApiKeyCredentialProviderAttributesStructAttributes for importing an existing API key credential provider.
ApiKeyCredentialProviderIdentityPermsClassIAM actions for AgentCore API key credential providers (Token Vault).
ApiKeyCredentialProviderPropsStructAPI key credential provider ARNs for gateway outbound auth (Token Vault identity).
ApiKeyCredentialProviderResourcePropsStructProperties for a new {@link ApiKeyCredentialProvider} (Token Vault resource).
ApiSchemaClassRepresents the concept of an API Schema for a Gateway Target.
AssetApiSchemaClassAPI Schema from a local asset.
AssetToolSchemaClassTool Schema from a local asset.
AtlassianOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingAtlassian}.
AttributeAccessorClassAccessor for building type-safe attribute comparisons.
BrowserCustomAttributesStructAttributes for specifying an imported Browser Custom.
BrowserCustomPropsStructProperties for creating a Browser resource.
BrowserNetworkConfigurationClassNetwork configuration for the Browser tool.
BrowserSigningEnumBrowser signing.
BuiltinEvaluatorClassBuilt-in evaluators provided by Amazon Bedrock AgentCore.
CategoricalRatingOptionStructA categorical rating scale option for custom evaluators.
CloudWatchLogsDataSourceConfigStructConfiguration for CloudWatch Logs data source.
CodeAssetOptionsStructOptions for configuring an S3 code asset from local files for agent runtime artifact.
CodeBasedOptionsStructOptions for configuring a code-based custom evaluator using a Lambda function.
CodeInterpreterCustomAttributesStructAttributes for specifying an imported Code Interpreter Custom.
CodeInterpreterCustomPropsStructProperties for creating a CodeInterpreter resource.
CodeInterpreterNetworkConfigurationClassNetwork configuration for the Code Interpreter tool.
CognitoAuthorizerPropsStructProperties for configuring a Cognito authorizer.
ConditionalAttributeAccessorClassAccessor for building type-safe attribute comparisons within conditional statements.
ConditionalPolicyStatementClassWrapper class for conditionally building policy statements.
ConditionBuilderClassBuilder for condition expressions in Cedar policies.
CredentialProviderTypeEnumCredential provider types supported by gateway target.
CustomClaimOperatorEnumCustom claim match operator.
CustomJwtAuthorizerClassCustom JWT authorizer configuration implementation.
CustomJwtConfigurationStructCustom JWT authorizer configuration.
CustomOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingCustom}.
DataSourceConfigClassConfiguration for the data source used in online evaluation.
DataSourceConfigBindResultStructThe result of binding a DataSourceConfig.
DropboxOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingDropbox}.
EpisodicReflectionConfigurationStructConfiguration for episodic memory reflection.
EvaluationLevelClassThe level at which a custom evaluator assesses agent performance.
EvaluatorAttributesStructAttributes for importing an existing Evaluator.
EvaluatorConfigClassConfiguration for a custom evaluator.
EvaluatorInferenceConfigStructInference configuration for a custom LLM-as-a-Judge evaluator.
EvaluatorPropsStructProperties for creating an Evaluator.
EvaluatorRatingScaleClassRepresents a rating scale for custom LLM-as-a-Judge evaluators.
EvaluatorReferenceClassRepresents a reference to an evaluator for online evaluation.
EvaluatorReferenceBindResultStructThe result of binding an EvaluatorReference.
ExecutionStatusClassThe execution status of an online evaluation configuration.
FacebookOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingFacebook}.
FilterConfigStructFilter configuration for online evaluation.
FilterOperatorClassFilter operators for online evaluation filtering.
FilterValueClassA typed filter value for online evaluation filtering.
FromApiKeyIdentityOptionsStructOptional gateway settings when binding an {@link IApiKeyCredentialProvider} to a target.
FromOauthIdentityOptionsStructOAuth scopes (and optional custom parameters) when binding an {@link IOAuth2CredentialProvider} to a gateway target.
GatewayApiKeyIdentityBindingStructProvider and secret ARNs for wiring a Token Vault API key identity into a gateway target.
GatewayAttributesStructAttributes for importing an existing Gateway.
GatewayAuthorizerClassFactory class for creating Gateway Authorizers.
GatewayAuthorizerTypeEnumGateway authorizer type.
GatewayCredentialProviderClassFactory class for creating different Gateway Credential Providers.
GatewayCustomClaimClassRepresents a custom claim validation configuration for Gateway JWT authorizers.
GatewayExceptionLevelEnumException levels for gateway.
GatewayOAuth2IdentityBindingStructProvider ARN, secret ARN, and OAuth scopes for wiring a Token Vault OAuth2 identity into a gateway target.
GatewayPolicyEngineConfigStructConfiguration for associating a policy engine with a gateway.
GatewayPropsStructProperties for defining a Gateway.
GatewayProtocolClassFactory class for instantiating Gateway Protocols.
GatewayTargetApiGatewayPropsStructProperties for creating an API Gateway-based Gateway Target.
GatewayTargetAttributesStructAttributes for importing an existing Gateway Target.
GatewayTargetCommonPropsStructCommon properties for all Gateway Target types.
GatewayTargetLambdaPropsStructProperties for creating a Lambda-based Gateway Target Convenience interface for the most common use case.
GatewayTargetMcpServerPropsStructProperties for creating an MCP Server-based Gateway Target.
GatewayTargetOpenApiPropsStructProperties for creating an OpenAPI-based Gateway Target.
GatewayTargetPropsStructProperties for creating a Gateway Target resource.
GatewayTargetProtocolTypeEnumProtocol types supported by gateway targets.
GatewayTargetSmithyPropsStructProperties for creating a Smithy-based Gateway Target.
GithubOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingGithub}.
GoogleOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingGoogle}.
HubspotOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingHubspot}.
IamAuthorizerClassAWS IAM authorizer configuration implementation.
IApiKeyCredentialProviderInterfaceAn API key credential provider registered in AgentCore Token Vault.
IBedrockAgentRuntimeInterfaceInterface for Agent Runtime resources.
IBrowserCustomInterfaceInterface for Browser resources.
ICodeInterpreterCustomInterfaceInterface for CodeInterpreterCustom resources.
ICredentialProviderConfigInterfaceAbstract interface for gateway credential provider configuration.
IEvaluatorInterfaceInterface for Evaluator resources.
IGatewayInterfaceInterface for Gateway resources.
IGatewayAuthorizerConfigInterfaceAbstract interface for gateway authorizer configuration.
IGatewayProtocolConfigInterfaceAbstract interface for gateway protocol configuration.
IGatewayTargetInterfaceInterface for GatewayTarget resources.
IInterceptorInterfaceRepresents an interceptor that can be bound to a Gateway.
IMcpGatewayTargetInterfaceInterface for MCP gateway targets.
IMemoryInterfaceInterface for Memory resources.
IMemoryStrategyInterfaceInterface for Memory strategies.
IncludedOauth2TenantCredentialProviderPropsStructProps for IncludedOauth2ProviderConfig IdPs whose outbound documentation requires issuer, authorizationEndpoint, and/or tokenEndpoint (for example Okta, Auth0, Amazon Cognito, OneLogin, PingOne, CyberArk, FusionAuth).
IncludedOauth2TenantEndpointsStructOptional tenant OAuth endpoints for IdPs that use CloudFormation IncludedOauth2ProviderConfig with issuer and/or endpoints per the IdP’s outbound documentation.
InlineApiSchemaClassClass to define an API Schema from an inline string.
InlineToolSchemaClassClass to define a Tool Schema from an inline string.
InterceptionPointEnumThe interception point where the interceptor will be invoked.
InterceptorBindConfigStructConfiguration returned from binding an interceptor to a Gateway.
InterceptorOptionsStructOptions for configuring an interceptor.
InvocationConfigurationStructInvocation configuration for self managed memory strategy.
IOAuth2CredentialProviderInterfaceAn OAuth2 credential provider registered in AgentCore Token Vault.
IOnlineEvaluationConfigInterfaceInterface for OnlineEvaluationConfig resources.
IPolicyInterfaceMinimal reference interface for Policy resources.
IPolicyEngineInterfaceContains all properties and methods for both created and imported policy engines.
IRuntimeEndpointInterfaceInterface for Runtime Endpoint resources.
ITargetConfigurationInterfaceBase interface for target configurations.
IWorkloadIdentityInterfaceA workload identity for Amazon Bedrock AgentCore.
LambdaInterceptorClassA Lambda-based interceptor for Gateway.
LambdaTargetConfigurationClassConfiguration for Lambda-based MCP targets.
LifecycleConfigurationStructLifecycleConfiguration lets you manage the lifecycle of runtime sessions and resources in AgentCore Runtime.
LinkedinOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingLinkedin}.
LlmAsAJudgeOptionsStructOptions for configuring an LLM-as-a-Judge custom evaluator.
LoggingConfigStructConfiguration for logging with log type and destination.
LoggingDestinationClassRepresents a logging destination for AgentCore Runtime.
LogTypeClassLog types for AgentCore Runtime observability.
ManagedMemoryStrategyClassManaged memory strategy that handles both built-in and override configurations.
ManagedStrategyPropsStructConfiguration parameters for a memory strategy that can override existing built-in default prompts/models.
McpConfigurationStructMCP protocol configuration The configuration for the Model Context Protocol (MCP).
McpGatewaySearchTypeEnumSearch types supported by MCP gateway.
McpProtocolConfigurationClassMCP (Model Context Protocol) configuration implementation.
MCPProtocolVersionEnumMCP protocol versions.
McpServerTargetConfigurationClassConfiguration for MCP Server-based targets.
McpTargetConfigurationClassAbstract base class for MCP target configurations Provides common functionality for all MCP target types.
McpTargetTypeEnumMCP target types.
MemoryAttributesStructAttributes for specifying an imported Memory.
MemoryPropsStructProperties for creating a Memory resource.
MemoryStrategyClassFactory class for creating memory strategies If you need long-term memory for context recall across sessions, you can setup memory extraction strategies to extract the relevant memory from the raw events.
MemoryStrategyCommonPropsStructConfiguration parameters common for any memory strategy.
MemoryStrategyTypeEnumLong-term memory extraction strategy types.
MetadataConfigurationStructConfiguration for passing metadata (headers and query parameters) to the API Gateway target.
MicrosoftOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingMicrosoft}.
NetworkConfigurationClassAbstract base class for network configuration.
NoAuthAuthorizerClassNo authorization configuration implementation.
NotionOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingNotion}.
NumericalRatingOptionStructA numerical rating scale option for custom evaluators.
OAuth2AuthorizationServerMetadataStructStatic OAuth2 authorization server metadata for custom credential providers.
OAuth2ClientCredentialsStructOAuth2 client identifier and secret registered with the identity provider (all vendors).
OAuth2CredentialProviderAttributesStructAttributes for importing an existing OAuth2 credential provider.
OAuth2CredentialProviderBasePropsStructShared properties for OAuth2 credential providers created via {@link OAuth2CredentialProvider} factory methods.
OAuth2CredentialProviderFactoryBasePropsStructNaming, tags, and client credentials shared by every {@link OAuth2CredentialProvider} factory.
OAuth2CredentialProviderIdentityPermsClassIAM actions for AgentCore OAuth2 credential providers (Token Vault).
OAuth2CredentialProviderPropsStructLow-level properties when you need full control (prefer {@link OAuth2CredentialProvider.usingSlack} and other factories).
OAuth2CredentialProviderVendorEnumBuilt-in OAuth2 vendors supported by AWS::BedrockAgentCore::OAuth2CredentialProvider.
OAuthConfigurationStructOAuth configuration.
OnlineEvaluationBasePropsStructBase properties for creating an OnlineEvaluationConfig.
OnlineEvaluationConfigAttributesStructAttributes for importing an existing OnlineEvaluationConfig.
OnlineEvaluationConfigPropsStructProperties for creating an OnlineEvaluationConfig.
OpenApiTargetConfigurationClassConfiguration for OpenAPI-based MCP targets.
OverrideConfigStructConfiguration for overriding model and prompt template.
PolicyAttributesStructAttributes for importing an existing Policy.
PolicyEngineAttributesStructAttributes for importing an existing PolicyEngine.
PolicyEngineModeClassThe enforcement mode for a policy engine associated with a gateway.
PolicyEnginePropsStructProperties for creating a PolicyEngine resource.
PolicyPropsStructProperties for creating a Policy resource.
PolicyStatementClassType-safe builder for creating Cedar authorization policy statements.
PolicyValidationModeClassValidation mode for Cedar policy definitions.
ProtocolTypeEnumProtocol configuration for Agent Runtime.
RecordingConfigStructRecording configuration for browser.
RedditOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingReddit}.
RequestHeaderConfigurationStructConfiguration for HTTP request headers that will be passed through to the runtime.
RuntimeAuthorizerConfigurationClassAbstract base class for runtime authorizer configurations.
RuntimeCustomClaimClassRepresents a custom claim validation configuration for Runtime JWT authorizers.
RuntimeEndpointAttributesStructAttributes for importing an existing Runtime Endpoint.
RuntimeEndpointPropsStructProperties for creating a Bedrock Agent Core Runtime Endpoint resource.
RuntimeNetworkConfigurationClassNetwork configuration for the Runtime.
RuntimePropsStructProperties for creating a Bedrock Agent Core Runtime resource.
S3ApiSchemaClassClass to define an API Schema from an S3 object.
S3ToolSchemaClassClass to define a Tool Schema from an S3 object.
SalesforceOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingSalesforce}.
SchemaDefinitionStructSchema definition for tool input/output.
SchemaDefinitionTypeEnumSchema definition types.
SelfManagedMemoryStrategyClassUse AgentCore memory for event storage with custom triggers.
SelfManagedStrategyPropsStructConfiguration parameters for a self managed memory strategy existing built-in default prompts/models.
SlackOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingSlack}.
SmithyTargetConfigurationClassConfiguration for Smithy-based MCP targets.
SpotifyOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingSpotify}.
TargetConfigurationConfigStructConfiguration returned by binding a target configuration.
ToolDefinitionStructTool definition for inline payload.
ToolSchemaClassDefines the schema for tools available to a gateway target.
TriggerConditionsStructTrigger conditions for self managed memory strategy When first condition is met, batched payloads are sent to specified S3 bucket.
TwitchOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingTwitch}.
VpcConfigPropsStructVPC configuration properties.
WorkloadIdentityAttributesStructAttributes for importing an existing workload identity.
WorkloadIdentityPermsClassIAM actions for AgentCore workload identities.
WorkloadIdentityPropsStructProperties for a new {@link WorkloadIdentity}.
XOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingX}.
YandexOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingYandex}.
ZoomOAuth2CredentialProviderPropsStructProps for {@link OAuth2CredentialProvider.usingZoom}.