Skip to content

BedrockAgentCoreControlClient.create_harness

rboto-bedrock-agentcore-control==0.4.0 · Service index · Types

Model summary (excerpt): Operation to create a harness.

Install and imports

python -m pip install "rboto[bedrock-agentcore-control]==0.4.0"
from rboto import BedrockAgentCoreControlClient
from collections.abc import Sequence
from rboto_bedrock_agentcore_control.types import (
    AuthorizerConfiguration,
    CreateHarnessOutput,
    HarnessEnvironmentArtifact,
    HarnessEnvironmentProviderRequest,
    HarnessHook,
    HarnessMemoryConfiguration,
    HarnessModelConfiguration,
    HarnessSkill,
    HarnessSystemContentBlock,
    HarnessTool,
    HarnessTruncationConfiguration,
)

Signature

async def create_harness(
    *,
    harness_name: str,
    execution_role_arn: str,
    client_token: str | None = None,
    environment: HarnessEnvironmentProviderRequest | None = None,
    environment_artifact: HarnessEnvironmentArtifact | None = None,
    environment_variables: dict[str, str] | None = None,
    authorizer_configuration: AuthorizerConfiguration | None = None,
    model: HarnessModelConfiguration | None = None,
    system_prompt: Sequence[HarnessSystemContentBlock] | None = None,
    tools: Sequence[HarnessTool] | None = None,
    skills: Sequence[HarnessSkill] | None = None,
    allowed_tools: Sequence[str] | None = None,
    memory: HarnessMemoryConfiguration | None = None,
    truncation: HarnessTruncationConfiguration | None = None,
    hooks: Sequence[HarnessHook] | None = None,
    max_iterations: int | None = None,
    max_tokens: int | None = None,
    timeout_seconds: int | None = None,
    tags: dict[str, str] | None = None,
) -> CreateHarnessOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
harness_name Yes The name of the harness. Must start with a letter and contain only alphanumeric characters and underscores.
execution_role_arn Yes 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.
client_token No A unique, case-sensitive identifier to ensure idempotency of the request.
environment No The compute environment configuration for the harness, including network and lifecycle settings.
environment_artifact No The environment artifact for the harness, such as a custom container image containing additional dependencies.
environment_variables No Environment variables to set in the harness runtime environment.
authorizer_configuration No
model No The model configuration for the harness. Supports Amazon Bedrock, OpenAI, and Google Gemini model providers.
system_prompt No The system prompt that defines the agent's behavior and instructions.
tools No The tools available to the agent, such as remote MCP servers, AgentCore Gateway, AgentCore Browser, Code Interpreter, or inline functions.
skills No The skills available to the agent. Skills are bundles of files that the agent can pull into its context on demand.
allowed_tools No 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.
memory No The AgentCore Memory configuration for persisting conversation context across sessions.
truncation No The truncation configuration for managing conversation context when it exceeds model limits.
hooks No The lifecycle hooks to run at defined points in the agent loop.
max_iterations No The maximum number of iterations the agent loop can execute per invocation.
max_tokens No The maximum total number of output tokens the agent can generate across all model calls within a single invocation.
timeout_seconds No The maximum duration in seconds for the agent loop execution per invocation.
tags No Tags to apply to the harness resource.

Output

CreateHarnessOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
harness HarnessOutput | None Always present HarnessOutput

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

AuthorizerConfiguration, CreateHarnessOutput, HarnessEnvironmentArtifact, HarnessEnvironmentProviderRequest, HarnessHook, HarnessMemoryConfiguration, HarnessModelConfiguration, HarnessSkill, HarnessSystemContentBlock, HarnessTool, HarnessTruncationConfiguration

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_bedrock_agentcore_control.exceptions:

AccessDeniedError, ConflictError, InternalServerError, ServiceQuotaExceededError, ThrottlingError, ValidationError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Service guide · Pinned model