create_harness
async
¶
create_harness(
harness_name: HarnessName,
execution_role_arn: RoleArn,
*,
config_overrides: Optional[AsyncBedrockAgentCoreControlClientConfig] = None,
client_token: Optional[ClientToken] = None,
environment: Optional[HarnessEnvironmentProviderRequest] = None,
environment_artifact: Optional[HarnessEnvironmentArtifact] = None,
environment_variables: Optional[EnvironmentVariablesMap] = None,
authorizer_configuration: Optional[AuthorizerConfiguration] = None,
model: Optional[HarnessModelConfiguration] = None,
system_prompt: Optional[HarnessSystemPrompt] = None,
tools: Optional[HarnessTools] = None,
skills: Optional[HarnessSkills] = None,
allowed_tools: Optional[HarnessAllowedTools] = None,
memory: Optional[HarnessMemoryConfiguration] = None,
truncation: Optional[HarnessTruncationConfiguration] = None,
hooks: Optional[HarnessHooks] = None,
max_iterations: Optional[int] = None,
max_tokens: Optional[int] = None,
timeout_seconds: Optional[int] = None,
tags: Optional[TagsMap] = None,
) -> CreateHarnessResponse
Operation to create a harness.
Parameters:
-
harness_name(HarnessName) –The name of the harness. Must start with a letter and contain only alphanumeric characters and underscores.
-
client_token(Optional[ClientToken], default:None) –A unique, case-sensitive identifier to ensure idempotency of the request.
-
execution_role_arn(RoleArn) –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.
-
environment(Optional[HarnessEnvironmentProviderRequest], default:None) –The compute environment configuration for the harness, including network and lifecycle settings.
-
environment_artifact(Optional[HarnessEnvironmentArtifact], default:None) –The environment artifact for the harness, such as a custom container image containing additional dependencies.
-
environment_variables(Optional[EnvironmentVariablesMap], default:None) –Environment variables to set in the harness runtime environment.
-
model(Optional[HarnessModelConfiguration], default:None) –The model configuration for the harness. Supports Amazon Bedrock, OpenAI, and Google Gemini model providers.
-
system_prompt(Optional[HarnessSystemPrompt], default:None) –The system prompt that defines the agent's behavior and instructions.
-
tools(Optional[HarnessTools], default:None) –The tools available to the agent, such as remote MCP servers, AgentCore Gateway, AgentCore Browser, Code Interpreter, or inline functions.
-
skills(Optional[HarnessSkills], default:None) –The skills available to the agent. Skills are bundles of files that the agent can pull into its context on demand.
-
allowed_tools(Optional[HarnessAllowedTools], default: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.
-
memory(Optional[HarnessMemoryConfiguration], default:None) –The AgentCore Memory configuration for persisting conversation context across sessions.
-
truncation(Optional[HarnessTruncationConfiguration], default:None) –The truncation configuration for managing conversation context when it exceeds model limits.
-
hooks(Optional[HarnessHooks], default:None) –The lifecycle hooks to run at defined points in the agent loop.
-
max_iterations(Optional[int], default:None) –The maximum number of iterations the agent loop can execute per invocation.
-
max_tokens(Optional[int], default:None) –The maximum total number of output tokens the agent can generate across all model calls within a single invocation.
-
timeout_seconds(Optional[int], default:None) –The maximum duration in seconds for the agent loop execution per invocation.
-
tags(Optional[TagsMap], default:None) –Tags to apply to the harness resource.
Raises:
-
AccessDeniedException–This exception is thrown when a request is denied per access permissions
-
ConflictException–This exception is thrown when there is a conflict performing an operation
-
InternalServerException–This exception is thrown if there was an unexpected error during processing of request
-
ServiceQuotaExceededException–This exception is thrown when a request is made beyond the service quota
-
ThrottlingException–This exception is thrown when the number of requests exceeds the limit
-
ValidationException–The input fails to satisfy the constraints specified by the service.
-
UnknownServiceError–The service returned an error code this client does not model.
Source code in docs_src/capo_bedrock_agentcore_control/_services/async_bedrock_agent_core_control.py
8318 8319 8320 8321 8322 8323 8324 8325 8326 8327 8328 8329 8330 8331 8332 8333 8334 8335 8336 8337 8338 8339 8340 8341 8342 8343 8344 8345 8346 8347 8348 8349 8350 8351 8352 8353 8354 8355 8356 8357 8358 8359 8360 8361 8362 8363 8364 8365 8366 8367 8368 8369 8370 8371 8372 8373 8374 8375 8376 8377 8378 8379 8380 8381 8382 8383 8384 8385 8386 8387 8388 8389 8390 8391 8392 8393 8394 8395 8396 8397 8398 8399 8400 8401 8402 8403 8404 8405 8406 8407 8408 8409 8410 8411 8412 8413 8414 8415 8416 8417 8418 8419 8420 8421 8422 8423 8424 8425 8426 8427 8428 8429 8430 8431 8432 8433 8434 8435 8436 8437 8438 8439 8440 8441 8442 8443 8444 8445 8446 8447 8448 8449 8450 8451 8452 8453 8454 8455 8456 8457 8458 8459 8460 8461 8462 8463 8464 8465 8466 8467 8468 8469 8470 8471 8472 8473 8474 8475 8476 8477 8478 8479 8480 8481 8482 8483 8484 8485 8486 8487 | |