Skip to content

update_harness

Operation

update_harness

update_harness(request: UpdateHarnessInput | UpdateHarnessInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateHarnessInputDict]) -> UpdateHarnessOutput

Operation to update a harness.

Parameters:

Name Type Description Default
request UpdateHarnessInput | UpdateHarnessInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[UpdateHarnessInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
UpdateHarnessOutput

An instance of UpdateHarnessOutput.

update_harness async

update_harness(request: UpdateHarnessInput | UpdateHarnessInputDict | None = None, /, *, plugins: list[Plugin] | None = None, **kwargs: Unpack[UpdateHarnessInputDict]) -> UpdateHarnessOutput

Operation to update a harness.

Parameters:

Name Type Description Default
request UpdateHarnessInput | UpdateHarnessInputDict | None

The input as a model or dictionary. Pass this or keyword arguments, not both.

None
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
**kwargs Unpack[UpdateHarnessInputDict]

The input fields as keyword arguments.

{}

Returns:

Type Description
UpdateHarnessOutput

An instance of UpdateHarnessOutput.

Input

Pass the input as keyword arguments, a positional dictionary, or a positional model object. Pass plugins separately as a keyword argument.

UpdateHarnessInputDict

Bases: TypedDict

Dictionary form of UpdateHarnessInput.

Attributes

allowed_tools instance-attribute
allowed_tools: Sequence[str] | None

The tools that the agent is allowed to use. If specified, this replaces all existing allowed tools. If not specified, the existing value is retained.

authorizer_configuration instance-attribute

Wrapper for updating an optional AuthorizerConfiguration field with PATCH semantics. When present in an update request, the authorizer configuration is replaced with optionalValue. When absent, the authorizer configuration is left unchanged. To unset, include the wrapper with optionalValue not specified.

client_token instance-attribute
client_token: str | None

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

This field is autopopulated if not provided.

environment instance-attribute

The compute environment configuration for the harness. If not specified, the existing value is retained.

environment_artifact instance-attribute

The environment artifact for the harness. Use the optionalValue wrapper to set a new value, or set it to null to clear the existing configuration.

environment_variables instance-attribute
environment_variables: Mapping[str, str] | None

Environment variables to set in the harness runtime environment. If specified, this replaces all existing environment variables. If not specified, the existing value is retained.

execution_role_arn instance-attribute
execution_role_arn: str | None

The ARN of the IAM role that the harness assumes when running. If not specified, the existing value is retained.

harness_id instance-attribute
harness_id: Required[str]

The ID of the harness to update.

hooks instance-attribute

The lifecycle hooks to run at defined points in the agent loop. If specified, this replaces all existing hooks. If not specified, the existing hooks are retained.

max_iterations instance-attribute
max_iterations: int | None

The maximum number of iterations the agent loop can execute per invocation. If not specified, the existing value is retained.

max_tokens instance-attribute
max_tokens: int | None

The maximum total number of output tokens the agent can generate across all model calls within a single invocation. If not specified, the existing value is retained.

memory instance-attribute

The AgentCore Memory configuration. Use the optionalValue wrapper to set a new value, or set it to null to clear the existing configuration.

model instance-attribute

The model configuration for the harness. If not specified, the existing value is retained.

skills instance-attribute

The skills available to the agent. If specified, this replaces all existing skills. If not specified, the existing value is retained.

system_prompt instance-attribute

The system prompt that defines the agent's behavior. If not specified, the existing value is retained.

timeout_seconds instance-attribute
timeout_seconds: int | None

The maximum duration in seconds for the agent loop execution per invocation. If not specified, the existing value is retained.

tools instance-attribute

The tools available to the agent. If specified, this replaces all existing tools. If not specified, the existing value is retained.

truncation instance-attribute

The truncation configuration for managing conversation context. If not specified, the existing value is retained.

UpdateHarnessInput dataclass

Bases: _SerdeShape

Dataclass for UpdateHarnessInput structure.

Attributes

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

The tools that the agent is allowed to use. If specified, this replaces all existing allowed tools. If not specified, the existing value is retained.

authorizer_configuration class-attribute instance-attribute
authorizer_configuration: UpdatedAuthorizerConfiguration | None = ...

Wrapper for updating an optional AuthorizerConfiguration field with PATCH semantics. When present in an update request, the authorizer configuration is replaced with optionalValue. When absent, the authorizer configuration is left unchanged. To unset, include the wrapper with optionalValue not specified.

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

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

This field is autopopulated if not provided.

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

The compute environment configuration for the harness. If not specified, the existing value is retained.

environment_artifact class-attribute instance-attribute
environment_artifact: UpdatedHarnessEnvironmentArtifact | None = ...

The environment artifact for the harness. Use the optionalValue wrapper to set a new value, or set it to null to clear the existing configuration.

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

Environment variables to set in the harness runtime environment. If specified, this replaces all existing environment variables. If not specified, the existing value is retained.

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

The ARN of the IAM role that the harness assumes when running. If not specified, the existing value is retained.

harness_id class-attribute instance-attribute
harness_id: str | None = ...

The ID of the harness to update.

hooks class-attribute instance-attribute
hooks: list[HarnessHook] | None = ...

The lifecycle hooks to run at defined points in the agent loop. If specified, this replaces all existing hooks. If not specified, the existing hooks are retained.

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

The maximum number of iterations the agent loop can execute per invocation. If not specified, the existing value is retained.

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

The maximum total number of output tokens the agent can generate across all model calls within a single invocation. If not specified, the existing value is retained.

memory class-attribute instance-attribute
memory: UpdatedHarnessMemoryConfiguration | None = ...

The AgentCore Memory configuration. Use the optionalValue wrapper to set a new value, or set it to null to clear the existing configuration.

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

The model configuration for the harness. If not specified, the existing value is retained.

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

The skills available to the agent. If specified, this replaces all existing skills. If not specified, the existing value is retained.

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

The system prompt that defines the agent's behavior. If not specified, the existing value is retained.

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

The maximum duration in seconds for the agent loop execution per invocation. If not specified, the existing value is retained.

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

The tools available to the agent. If specified, this replaces all existing tools. If not specified, the existing value is retained.

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

The truncation configuration for managing conversation context. If not specified, the existing value is retained.

Output

UpdateHarnessOutput dataclass

Bases: _SerdeShape

Dataclass for UpdateHarnessOutput structure.

Attributes

harness instance-attribute
harness: Harness

The updated harness.

response_metadata class-attribute instance-attribute
response_metadata: ResponseMetadata = ...

Metadata about the response that produced this output. Use this to recover the request identifiers a service's support team needs in order to investigate a call. Members of the metadata are individually optional.