UpdateHarness
Operation to update a Harness.
Request Syntax
PATCH /harnesses/harnessId HTTP/1.1
Content-type: application/json
{
"allowedTools": [ "string" ],
"authorizerConfiguration": {
"optionalValue": { ... }
},
"clientToken": "string",
"environment": { ... },
"environmentArtifact": {
"optionalValue": { ... }
},
"environmentVariables": {
"string" : "string"
},
"executionRoleArn": "string",
"maxIterations": number,
"maxTokens": number,
"memory": {
"optionalValue": { ... }
},
"model": { ... },
"skills": [
{ ... }
],
"systemPrompt": [
{ ... }
],
"timeoutSeconds": number,
"tools": [
{
"config": { ... },
"name": "string",
"type": "string"
}
],
"truncation": {
"config": { ... },
"strategy": "string"
}
}
URI Request Parameters
The request uses the following URI parameters.
- harnessId
-
The ID of the harness to update.
Pattern:
[a-zA-Z][a-zA-Z0-9_]{0,39}-[a-zA-Z0-9]{10}Required: Yes
Request Body
The request accepts the following data in JSON format.
- allowedTools
-
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.
Type: Array of strings
Length Constraints: Minimum length of 1. Maximum length of 64.
Pattern:
(\*|@?[^/]+(/[^/]+)?)Required: No
-
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.
Type: UpdatedAuthorizerConfiguration object
Required: No
- clientToken
-
A unique, case-sensitive identifier to ensure idempotency of the request.
Type: String
Length Constraints: Minimum length of 33. Maximum length of 256.
Pattern:
[a-zA-Z0-9](-*[a-zA-Z0-9]){0,256}Required: No
- environment
-
The compute environment configuration for the harness. If not specified, the existing value is retained.
Type: HarnessEnvironmentProviderRequest object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: No
- environmentArtifact
-
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.
Type: UpdatedHarnessEnvironmentArtifact object
Required: No
- environmentVariables
-
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.
Type: String to string map
Map Entries: Minimum number of 0 items. Maximum number of 50 items.
Key Length Constraints: Minimum length of 1. Maximum length of 100.
Value Length Constraints: Minimum length of 0. Maximum length of 5000.
Required: No
- executionRoleArn
-
The ARN of the IAM role that the harness assumes when running. If not specified, the existing value is retained.
Type: String
Length Constraints: Minimum length of 1. Maximum length of 2048.
Pattern:
arn:aws(-[^:]+)?:iam::([0-9]{12})?:role/.+Required: No
- maxIterations
-
The maximum number of iterations the agent loop can execute per invocation. If not specified, the existing value is retained.
Type: Integer
Required: No
- maxTokens
-
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.
Type: Integer
Required: No
- memory
-
The AgentCore Memory configuration. Use the optionalValue wrapper to set a new value, or set it to null to clear the existing configuration.
Type: UpdatedHarnessMemoryConfiguration object
Required: No
- model
-
The model configuration for the harness. If not specified, the existing value is retained.
Type: HarnessModelConfiguration object
Note: This object is a Union. Only one member of this object can be specified or returned.
Required: No
- skills
-
The skills available to the agent. If specified, this replaces all existing skills. If not specified, the existing value is retained.
Type: Array of HarnessSkill objects
Required: No
- systemPrompt
-
The system prompt that defines the agent's behavior. If not specified, the existing value is retained.
Type: Array of HarnessSystemContentBlock objects
Required: No
- timeoutSeconds
-
The maximum duration in seconds for the agent loop execution per invocation. If not specified, the existing value is retained.
Type: Integer
Required: No
- tools
-
The tools available to the agent. If specified, this replaces all existing tools. If not specified, the existing value is retained.
Type: Array of HarnessTool objects
Required: No
- truncation
-
The truncation configuration for managing conversation context. If not specified, the existing value is retained.
Type: HarnessTruncationConfiguration object
Required: No
Response Syntax
HTTP/1.1 200
Content-type: application/json
{
"harness": {
"allowedTools": [ "string" ],
"arn": "string",
"authorizerConfiguration": { ... },
"createdAt": "string",
"environment": { ... },
"environmentArtifact": { ... },
"environmentVariables": {
"string" : "string"
},
"executionRoleArn": "string",
"failureReason": "string",
"harnessId": "string",
"harnessName": "string",
"maxIterations": number,
"maxTokens": number,
"memory": { ... },
"model": { ... },
"skills": [
{ ... }
],
"status": "string",
"systemPrompt": [
{ ... }
],
"timeoutSeconds": number,
"tools": [
{
"config": { ... },
"name": "string",
"type": "string"
}
],
"truncation": {
"config": { ... },
"strategy": "string"
},
"updatedAt": "string"
}
}
Response Elements
If the action is successful, the service sends back an HTTP 200 response.
The following data is returned in JSON format by the service.
Errors
For information about the errors that are common to all actions, see Common Error Types.
- AccessDeniedException
-
This exception is thrown when a request is denied per access permissions
HTTP Status Code: 403
- ConflictException
-
This exception is thrown when there is a conflict performing an operation
HTTP Status Code: 409
- InternalServerException
-
This exception is thrown if there was an unexpected error during processing of request
HTTP Status Code: 500
- ResourceNotFoundException
-
This exception is thrown when a resource referenced by the operation does not exist
HTTP Status Code: 404
- ThrottlingException
-
This exception is thrown when the number of requests exceeds the limit
HTTP Status Code: 429
- ValidationException
-
The input fails to satisfy the constraints specified by the service.
HTTP Status Code: 400
See Also
For more information about using this API in one of the language-specific AWS SDKs, see the following: