Skip to content

Bedrock Agentcore Control  >  Operations  >  create_harness

create_harness

Operation

create_harness async

create_harness(input: CreateHarnessInput, plugins: list[Plugin] | None = None) -> CreateHarnessOutput

Operation to create a harness.

Parameters:

Name Type Description Default
input CreateHarnessInput

An instance of CreateHarnessInput.

required
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

Returns:

Type Description
CreateHarnessOutput

An instance of CreateHarnessOutput.

Input

CreateHarnessInput dataclass

Dataclass for CreateHarnessInput structure.

Attributes

allowed_tools class-attribute instance-attribute
allowed_tools: list[str] | None = None

The tools that the agent is allowed to use. Supports glob patterns such as * for all tools, @builtin for all built-in tools, or @serverName/toolName for specific MCP server tools.

authorizer_configuration class-attribute instance-attribute
authorizer_configuration: AuthorizerConfiguration | None = None

Represents inbound authorization configuration options used to authenticate incoming requests.

client_token class-attribute instance-attribute
client_token: str | None = None

A unique, case-sensitive identifier to ensure idempotency of the request.

environment class-attribute instance-attribute
environment: HarnessEnvironmentProviderRequest | None = None

The compute environment configuration for the harness, including network and lifecycle settings.

environment_artifact class-attribute instance-attribute
environment_artifact: HarnessEnvironmentArtifact | None = None

The environment artifact for the harness, such as a custom container image containing additional dependencies.

environment_variables class-attribute instance-attribute
environment_variables: dict[str, str] | None = field(repr=False, default=None)

Environment variables to set in the harness runtime environment.

execution_role_arn class-attribute instance-attribute
execution_role_arn: str | None = None

The ARN of the IAM role that the harness assumes when running. This role must have permissions for the services the agent needs to access, such as Amazon Bedrock for model invocation.

harness_name class-attribute instance-attribute
harness_name: str | None = None

The name of the harness. Must start with a letter and contain only alphanumeric characters and underscores.

max_iterations class-attribute instance-attribute
max_iterations: int | None = None

The maximum number of iterations the agent loop can execute per invocation.

max_tokens class-attribute instance-attribute
max_tokens: int | None = None

The maximum total number of output tokens the agent can generate across all model calls within a single invocation.

memory class-attribute instance-attribute
memory: HarnessMemoryConfiguration | None = None

The AgentCore Memory configuration for persisting conversation context across sessions.

model class-attribute instance-attribute
model: HarnessModelConfiguration | None = None

The model configuration for the harness. Supports Amazon Bedrock, OpenAI, and Google Gemini model providers.

skills class-attribute instance-attribute
skills: list[HarnessSkill] | None = None

The skills available to the agent. Skills are bundles of files that the agent can pull into its context on demand.

system_prompt class-attribute instance-attribute
system_prompt: list[HarnessSystemContentBlock] | None = None

The system prompt that defines the agent's behavior and instructions.

tags class-attribute instance-attribute
tags: dict[str, str] | None = None

Tags to apply to the harness resource.

timeout_seconds class-attribute instance-attribute
timeout_seconds: int | None = None

The maximum duration in seconds for the agent loop execution per invocation.

tools class-attribute instance-attribute
tools: list[HarnessTool] | None = None

The tools available to the agent, such as remote MCP servers, AgentCore Gateway, AgentCore Browser, Code Interpreter, or inline functions.

truncation class-attribute instance-attribute
truncation: HarnessTruncationConfiguration | None = None

The truncation configuration for managing conversation context when it exceeds model limits.

Output

CreateHarnessOutput dataclass

Dataclass for CreateHarnessOutput structure.

Attributes

harness instance-attribute
harness: Harness

The harness that was created.