This is the new CloudFormation Template Reference Guide. Please update your bookmarks and links. For help getting started with CloudFormation, see the AWS CloudFormation User Guide.
AWS::BedrockAgentCore::Harness
Specifies a harness for Amazon Bedrock AgentCore. A harness is a managed agent loop that lets you define and invoke AI agents with a single API call. Specify a model, system prompt, and tools inline — the harness handles orchestration, tool execution, memory management, and response generation. Each session runs in an isolated microVM with filesystem and shell access, supporting use cases like code generation, data analysis, and deep research.
For more information, see Build agents with Amazon Bedrock AgentCore Harness.
See the Properties section below for descriptions of both the required and optional properties.
Syntax
To declare this entity in your CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::BedrockAgentCore::Harness", "Properties" : { "AllowedTools" :[ String, ... ], "AuthorizerConfiguration" :AuthorizerConfiguration, "Environment" :HarnessEnvironmentProvider, "EnvironmentArtifact" :HarnessEnvironmentArtifact, "EnvironmentVariables" :{, "ExecutionRoleArn" :Key:Value, ...}String, "HarnessName" :String, "MaxIterations" :Integer, "MaxTokens" :Integer, "Memory" :HarnessMemoryConfiguration, "Model" :HarnessModelConfiguration, "Skills" :[ HarnessSkill, ... ], "SystemPrompt" :[ HarnessSystemContentBlock, ... ], "Tags" :[ Tag, ... ], "TimeoutSeconds" :Integer, "Tools" :[ HarnessTool, ... ], "Truncation" :HarnessTruncationConfiguration} }
YAML
Type: AWS::BedrockAgentCore::Harness Properties: AllowedTools:- StringAuthorizerConfiguration:AuthorizerConfigurationEnvironment:HarnessEnvironmentProviderEnvironmentArtifact:HarnessEnvironmentArtifactEnvironmentVariables:ExecutionRoleArn:Key:ValueStringHarnessName:StringMaxIterations:IntegerMaxTokens:IntegerMemory:HarnessMemoryConfigurationModel:HarnessModelConfigurationSkills:- HarnessSkillSystemPrompt:- HarnessSystemContentBlockTags:- TagTimeoutSeconds:IntegerTools:- HarnessToolTruncation:HarnessTruncationConfiguration
Properties
AllowedTools-
The allowed tools of the harness. All tools are allowed by default.
Required: No
Type: Array of String
Minimum:
1Maximum:
64Update requires: No interruption
-
Represents inbound authorization configuration options used to authenticate incoming requests.
Required: No
Type: AuthorizerConfiguration
Update requires: No interruption
Environment-
The compute environment on which the Harness runs.
Required: No
Type: HarnessEnvironmentProvider
Update requires: No interruption
EnvironmentArtifact-
The environment artifact (e.g., container) in which the Harness operates.
Required: No
Type: HarnessEnvironmentArtifact
Update requires: No interruption
EnvironmentVariables-
Environment variables exposed in the environment in which the harness operates.
Required: No
Type: Object of String
Pattern:
^[\s\S]*$Minimum:
0Maximum:
5000Update requires: No interruption
ExecutionRoleArn-
IAM role the harness assumes when running.
Required: Yes
Type: String
Pattern:
^arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+$Minimum:
1Maximum:
2048Update requires: No interruption
HarnessName-
The name of the harness.
Required: Yes
Type: String
Pattern:
^[a-zA-Z][a-zA-Z0-9_]{0,39}$Update requires: Replacement
MaxIterations-
The maximum number of iterations in the agent loop allowed before exiting per invocation.
Required: No
Type: Integer
Update requires: No interruption
MaxTokens-
The maximum total number of output tokens the agent can generate across all model calls within a single invocation.
Required: No
Type: Integer
Update requires: No interruption
Memory-
AgentCore Memory instance configuration for short and long term memory.
Required: No
Type: HarnessMemoryConfiguration
Update requires: No interruption
Model-
The configuration of the default model used by the Harness.
Required: Yes
Type: HarnessModelConfiguration
Update requires: No interruption
Skills-
The skills of the harness.
Required: No
Type: Array of HarnessSkill
Update requires: No interruption
SystemPrompt-
The system prompt of the harness.
Required: No
Type: Array of HarnessSystemContentBlock
Update requires: No interruption
-
Tags to apply to the harness resource.
Required: No
Type: Array of Tag
Maximum:
50Update requires: No interruption
TimeoutSeconds-
The maximum duration per invocation.
Required: No
Type: Integer
Update requires: No interruption
Tools-
The tools of the harness.
Required: No
Type: Array of HarnessTool
Update requires: No interruption
Truncation-
Configuration for truncating model context.
Required: No
Type: HarnessTruncationConfiguration
Update requires: No interruption
Return values
Ref
Fn::GetAtt
The Fn::GetAtt intrinsic function returns a value for a specified attribute of this type. The following are the available attributes and sample return values.
For more information about using the Fn::GetAtt intrinsic function, see Fn::GetAtt.
Arn-
The ARN of the harness.
CreatedAt-
The createdAt time of the harness.
Environment.AgentCoreRuntimeEnvironment.AgentRuntimeArn-
The ARN of the underlying AgentCore Runtime.
Environment.AgentCoreRuntimeEnvironment.AgentRuntimeId-
The ID of the underlying AgentCore Runtime.
Environment.AgentCoreRuntimeEnvironment.AgentRuntimeName-
The name of the underlying AgentCore Runtime.
HarnessId-
The ID of the harness.
Memory.ManagedMemoryConfiguration.Arn-
The ARN of the harness.
Status-
The status of the harness.
UpdatedAt-
The updatedAt time of the harness.
Version-
The version of the harness. Incremented on every successful UpdateHarness.