create_harness
¶
create_harness(
harness_name: HarnessName,
execution_role_arn: RoleArn,
*,
config_overrides: Optional[BedrockAgentCoreControlClientConfig] = 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/bedrock_agent_core_control.py
8223 8224 8225 8226 8227 8228 8229 8230 8231 8232 8233 8234 8235 8236 8237 8238 8239 8240 8241 8242 8243 8244 8245 8246 8247 8248 8249 8250 8251 8252 8253 8254 8255 8256 8257 8258 8259 8260 8261 8262 8263 8264 8265 8266 8267 8268 8269 8270 8271 8272 8273 8274 8275 8276 8277 8278 8279 8280 8281 8282 8283 8284 8285 8286 8287 8288 8289 8290 8291 8292 8293 8294 8295 8296 8297 8298 8299 8300 8301 8302 8303 8304 8305 8306 8307 8308 8309 8310 8311 8312 8313 8314 8315 8316 8317 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 | |