Skip to content

Operation to create a harness

Description

Operation to create a harness.

Usage

bedrockagentcorecontrol_create_harness(harnessName, clientToken,
  executionRoleArn, environment, environmentArtifact,
  environmentVariables, authorizerConfiguration, model, systemPrompt,
  tools, skills, allowedTools, memory, truncation, hooks, maxIterations,
  maxTokens, timeoutSeconds, tags)

Arguments

  • harnessName

    [required] The name of the harness. Must start with a letter and contain only alphanumeric characters and underscores.

  • clientToken

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

  • executionRoleArn

    [required] 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

    The compute environment configuration for the harness, including network and lifecycle settings.

  • environmentArtifact

    The environment artifact for the harness, such as a custom container image containing additional dependencies.

  • environmentVariables

    Environment variables to set in the harness runtime environment.

  • authorizerConfiguration

    Represents inbound authorization configuration options used to authenticate incoming requests.

  • model

    The model configuration for the harness. Supports Amazon Bedrock, OpenAI, and Google Gemini model providers.

  • systemPrompt

    The system prompt that defines the agent's behavior and instructions.

  • tools

    The tools available to the agent, such as remote MCP servers, AgentCore Gateway, AgentCore Browser, Code Interpreter, or inline functions.

  • skills

    The skills available to the agent. Skills are bundles of files that the agent can pull into its context on demand.

  • allowedTools

    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

    The AgentCore Memory configuration for persisting conversation context across sessions.

  • truncation

    The truncation configuration for managing conversation context when it exceeds model limits.

  • hooks

    The lifecycle hooks to run at defined points in the agent loop.

  • maxIterations

    The maximum number of iterations the agent loop can execute per invocation.

  • maxTokens

    The maximum total number of output tokens the agent can generate across all model calls within a single invocation.

  • timeoutSeconds

    The maximum duration in seconds for the agent loop execution per invocation.

  • tags

    Tags to apply to the harness resource.

Value

A list with the following syntax:

list(
  harness = list(
    harnessId = "string",
    harnessName = "string",
    arn = "string",
    status = "CREATING"|"CREATE_FAILED"|"UPDATING"|"UPDATE_FAILED"|"READY"|"DELETING"|"DELETE_FAILED",
    harnessVersion = "string",
    executionRoleArn = "string",
    createdAt = as.POSIXct(
      "2015-01-01"
    ),
    updatedAt = as.POSIXct(
      "2015-01-01"
    ),
    model = list(
      bedrockModelConfig = list(
        modelId = "string",
        maxTokens = 123,
        temperature = 123.0,
        topP = 123.0,
        apiFormat = "converse_stream"|"responses"|"chat_completions",
        additionalParams = list()
      ),
      openAiModelConfig = list(
        modelId = "string",
        apiKeyArn = "string",
        apiBase = "string",
        maxTokens = 123,
        temperature = 123.0,
        topP = 123.0,
        apiFormat = "chat_completions"|"responses",
        additionalParams = list()
      ),
      geminiModelConfig = list(
        modelId = "string",
        apiKeyArn = "string",
        maxTokens = 123,
        temperature = 123.0,
        topP = 123.0,
        topK = 123,
        additionalParams = list()
      ),
      liteLlmModelConfig = list(
        modelId = "string",
        apiKeyArn = "string",
        apiBase = "string",
        maxTokens = 123,
        temperature = 123.0,
        topP = 123.0,
        additionalParams = list()
      )
    ),
    systemPrompt = list(
      list(
        text = "string"
      )
    ),
    tools = list(
      list(
        type = "remote_mcp"|"agentcore_browser"|"agentcore_gateway"|"inline_function"|"agentcore_code_interpreter",
        name = "string",
        config = list(
          remoteMcp = list(
            url = "string",
            headers = list(
              "string"
            )
          ),
          agentCoreBrowser = list(
            browserArn = "string"
          ),
          agentCoreGateway = list(
            gatewayArn = "string",
            outboundAuth = list(
              awsIam = list(),
              none = list(),
              oauth = list(
                providerArn = "string",
                scopes = list(
                  "string"
                ),
                customParameters = list(
                  "string"
                ),
                grantType = "CLIENT_CREDENTIALS"|"AUTHORIZATION_CODE"|"TOKEN_EXCHANGE",
                defaultReturnUrl = "string"
              )
            )
          ),
          inlineFunction = list(
            description = "string",
            inputSchema = list()
          ),
          agentCoreCodeInterpreter = list(
            codeInterpreterArn = "string"
          )
        )
      )
    ),
    skills = list(
      list(
        path = "string",
        s3 = list(
          uri = "string"
        ),
        git = list(
          url = "string",
          path = "string",
          auth = list(
            credentialArn = "string",
            username = "string"
          )
        ),
        awsSkills = list(
          paths = list(
            "string"
          )
        )
      )
    ),
    allowedTools = list(
      "string"
    ),
    truncation = list(
      strategy = "sliding_window"|"summarization"|"none",
      config = list(
        slidingWindow = list(
          messagesCount = 123
        ),
        summarization = list(
          summaryRatio = 123.0,
          preserveRecentMessages = 123,
          summarizationSystemPrompt = "string"
        )
      )
    ),
    environment = list(
      agentCoreRuntimeEnvironment = list(
        agentRuntimeArn = "string",
        agentRuntimeName = "string",
        agentRuntimeId = "string",
        lifecycleConfiguration = list(
          idleRuntimeSessionTimeout = 123,
          maxLifetime = 123
        ),
        networkConfiguration = list(
          networkMode = "PUBLIC"|"VPC",
          networkModeConfig = list(
            securityGroups = list(
              "string"
            ),
            subnets = list(
              "string"
            ),
            requireServiceS3Endpoint = TRUE|FALSE
          )
        ),
        filesystemConfigurations = list(
          list(
            sessionStorage = list(
              mountPath = "string"
            ),
            s3FilesAccessPoint = list(
              accessPointArn = "string",
              mountPath = "string"
            ),
            efsAccessPoint = list(
              accessPointArn = "string",
              mountPath = "string"
            ),
            capacityProviderVolume = list(
              volumeName = "string",
              mountPath = "string"
            )
          )
        )
      )
    ),
    environmentArtifact = list(
      containerConfiguration = list(
        containerUri = "string"
      )
    ),
    environmentVariables = list(
      "string"
    ),
    authorizerConfiguration = list(
      customJWTAuthorizer = list(
        discoveryUrl = "string",
        allowedAudience = list(
          "string"
        ),
        allowedClients = list(
          "string"
        ),
        allowedScopes = list(
          "string"
        ),
        advertisedScopeMapping = list(
          "string"
        ),
        customClaims = list(
          list(
            inboundTokenClaimName = "string",
            inboundTokenClaimValueType = "STRING"|"STRING_ARRAY",
            authorizingClaimMatchValue = list(
              claimMatchValue = list(
                matchValueString = "string",
                matchValueStringList = list(
                  "string"
                )
              ),
              claimMatchOperator = "EQUALS"|"CONTAINS"|"CONTAINS_ANY"
            )
          )
        ),
        privateEndpoint = list(
          selfManagedLatticeResource = list(
            resourceConfigurationIdentifier = "string"
          ),
          managedVpcResource = list(
            vpcIdentifier = "string",
            subnetIds = list(
              "string"
            ),
            endpointIpAddressType = "IPV4"|"IPV6",
            securityGroupIds = list(
              "string"
            ),
            tags = list(
              "string"
            ),
            routingDomain = "string"
          )
        ),
        privateEndpointOverrides = list(
          list(
            domain = "string",
            privateEndpoint = list(
              selfManagedLatticeResource = list(
                resourceConfigurationIdentifier = "string"
              ),
              managedVpcResource = list(
                vpcIdentifier = "string",
                subnetIds = list(
                  "string"
                ),
                endpointIpAddressType = "IPV4"|"IPV6",
                securityGroupIds = list(
                  "string"
                ),
                tags = list(
                  "string"
                ),
                routingDomain = "string"
              )
            )
          )
        ),
        allowedWorkloadConfiguration = list(
          hostingEnvironments = list(
            list(
              arn = "string"
            )
          ),
          workloadIdentities = list(
            "string"
          )
        )
      )
    ),
    memory = list(
      agentCoreMemoryConfiguration = list(
        arn = "string",
        actorId = "string",
        messagesCount = 123,
        retrievalConfig = list(
          list(
            topK = 123,
            relevanceScore = 123.0,
            strategyId = "string"
          )
        )
      ),
      managedMemoryConfiguration = list(
        arn = "string",
        strategies = list(
          "SEMANTIC"|"SUMMARIZATION"|"USER_PREFERENCE"|"EPISODIC"
        ),
        eventExpiryDuration = 123,
        encryptionKeyArn = "string"
      ),
      disabled = list()
    ),
    hooks = list(
      list(
        beforeInvocation = list(
          name = "string",
          target = list(
            lambda = list(
              arn = "string",
              timeoutSeconds = 123,
              failureMode = "allow"|"deny"
            ),
            sns = list(
              arn = "string"
            ),
            eventBridge = list(
              arn = "string"
            )
          )
        ),
        afterInvocation = list(
          name = "string",
          target = list(
            lambda = list(
              arn = "string",
              timeoutSeconds = 123,
              failureMode = "allow"|"deny"
            ),
            sns = list(
              arn = "string"
            ),
            eventBridge = list(
              arn = "string"
            )
          )
        ),
        beforeToolCall = list(
          name = "string",
          target = list(
            lambda = list(
              arn = "string",
              timeoutSeconds = 123,
              failureMode = "allow"|"deny"
            ),
            sns = list(
              arn = "string"
            ),
            eventBridge = list(
              arn = "string"
            )
          )
        ),
        afterToolCall = list(
          name = "string",
          target = list(
            lambda = list(
              arn = "string",
              timeoutSeconds = 123,
              failureMode = "allow"|"deny"
            ),
            sns = list(
              arn = "string"
            ),
            eventBridge = list(
              arn = "string"
            )
          )
        )
      )
    ),
    maxIterations = 123,
    maxTokens = 123,
    timeoutSeconds = 123,
    failureReason = "string"
  )
)

Request syntax

svc$create_harness(
  harnessName = "string",
  clientToken = "string",
  executionRoleArn = "string",
  environment = list(
    agentCoreRuntimeEnvironment = list(
      lifecycleConfiguration = list(
        idleRuntimeSessionTimeout = 123,
        maxLifetime = 123
      ),
      networkConfiguration = list(
        networkMode = "PUBLIC"|"VPC",
        networkModeConfig = list(
          securityGroups = list(
            "string"
          ),
          subnets = list(
            "string"
          ),
          requireServiceS3Endpoint = TRUE|FALSE
        )
      ),
      filesystemConfigurations = list(
        list(
          sessionStorage = list(
            mountPath = "string"
          ),
          s3FilesAccessPoint = list(
            accessPointArn = "string",
            mountPath = "string"
          ),
          efsAccessPoint = list(
            accessPointArn = "string",
            mountPath = "string"
          ),
          capacityProviderVolume = list(
            volumeName = "string",
            mountPath = "string"
          )
        )
      )
    )
  ),
  environmentArtifact = list(
    containerConfiguration = list(
      containerUri = "string"
    )
  ),
  environmentVariables = list(
    "string"
  ),
  authorizerConfiguration = list(
    customJWTAuthorizer = list(
      discoveryUrl = "string",
      allowedAudience = list(
        "string"
      ),
      allowedClients = list(
        "string"
      ),
      allowedScopes = list(
        "string"
      ),
      advertisedScopeMapping = list(
        "string"
      ),
      customClaims = list(
        list(
          inboundTokenClaimName = "string",
          inboundTokenClaimValueType = "STRING"|"STRING_ARRAY",
          authorizingClaimMatchValue = list(
            claimMatchValue = list(
              matchValueString = "string",
              matchValueStringList = list(
                "string"
              )
            ),
            claimMatchOperator = "EQUALS"|"CONTAINS"|"CONTAINS_ANY"
          )
        )
      ),
      privateEndpoint = list(
        selfManagedLatticeResource = list(
          resourceConfigurationIdentifier = "string"
        ),
        managedVpcResource = list(
          vpcIdentifier = "string",
          subnetIds = list(
            "string"
          ),
          endpointIpAddressType = "IPV4"|"IPV6",
          securityGroupIds = list(
            "string"
          ),
          tags = list(
            "string"
          ),
          routingDomain = "string"
        )
      ),
      privateEndpointOverrides = list(
        list(
          domain = "string",
          privateEndpoint = list(
            selfManagedLatticeResource = list(
              resourceConfigurationIdentifier = "string"
            ),
            managedVpcResource = list(
              vpcIdentifier = "string",
              subnetIds = list(
                "string"
              ),
              endpointIpAddressType = "IPV4"|"IPV6",
              securityGroupIds = list(
                "string"
              ),
              tags = list(
                "string"
              ),
              routingDomain = "string"
            )
          )
        )
      ),
      allowedWorkloadConfiguration = list(
        hostingEnvironments = list(
          list(
            arn = "string"
          )
        ),
        workloadIdentities = list(
          "string"
        )
      )
    )
  ),
  model = list(
    bedrockModelConfig = list(
      modelId = "string",
      maxTokens = 123,
      temperature = 123.0,
      topP = 123.0,
      apiFormat = "converse_stream"|"responses"|"chat_completions",
      additionalParams = list()
    ),
    openAiModelConfig = list(
      modelId = "string",
      apiKeyArn = "string",
      apiBase = "string",
      maxTokens = 123,
      temperature = 123.0,
      topP = 123.0,
      apiFormat = "chat_completions"|"responses",
      additionalParams = list()
    ),
    geminiModelConfig = list(
      modelId = "string",
      apiKeyArn = "string",
      maxTokens = 123,
      temperature = 123.0,
      topP = 123.0,
      topK = 123,
      additionalParams = list()
    ),
    liteLlmModelConfig = list(
      modelId = "string",
      apiKeyArn = "string",
      apiBase = "string",
      maxTokens = 123,
      temperature = 123.0,
      topP = 123.0,
      additionalParams = list()
    )
  ),
  systemPrompt = list(
    list(
      text = "string"
    )
  ),
  tools = list(
    list(
      type = "remote_mcp"|"agentcore_browser"|"agentcore_gateway"|"inline_function"|"agentcore_code_interpreter",
      name = "string",
      config = list(
        remoteMcp = list(
          url = "string",
          headers = list(
            "string"
          )
        ),
        agentCoreBrowser = list(
          browserArn = "string"
        ),
        agentCoreGateway = list(
          gatewayArn = "string",
          outboundAuth = list(
            awsIam = list(),
            none = list(),
            oauth = list(
              providerArn = "string",
              scopes = list(
                "string"
              ),
              customParameters = list(
                "string"
              ),
              grantType = "CLIENT_CREDENTIALS"|"AUTHORIZATION_CODE"|"TOKEN_EXCHANGE",
              defaultReturnUrl = "string"
            )
          )
        ),
        inlineFunction = list(
          description = "string",
          inputSchema = list()
        ),
        agentCoreCodeInterpreter = list(
          codeInterpreterArn = "string"
        )
      )
    )
  ),
  skills = list(
    list(
      path = "string",
      s3 = list(
        uri = "string"
      ),
      git = list(
        url = "string",
        path = "string",
        auth = list(
          credentialArn = "string",
          username = "string"
        )
      ),
      awsSkills = list(
        paths = list(
          "string"
        )
      )
    )
  ),
  allowedTools = list(
    "string"
  ),
  memory = list(
    agentCoreMemoryConfiguration = list(
      arn = "string",
      actorId = "string",
      messagesCount = 123,
      retrievalConfig = list(
        list(
          topK = 123,
          relevanceScore = 123.0,
          strategyId = "string"
        )
      )
    ),
    managedMemoryConfiguration = list(
      arn = "string",
      strategies = list(
        "SEMANTIC"|"SUMMARIZATION"|"USER_PREFERENCE"|"EPISODIC"
      ),
      eventExpiryDuration = 123,
      encryptionKeyArn = "string"
    ),
    disabled = list()
  ),
  truncation = list(
    strategy = "sliding_window"|"summarization"|"none",
    config = list(
      slidingWindow = list(
        messagesCount = 123
      ),
      summarization = list(
        summaryRatio = 123.0,
        preserveRecentMessages = 123,
        summarizationSystemPrompt = "string"
      )
    )
  ),
  hooks = list(
    list(
      beforeInvocation = list(
        name = "string",
        target = list(
          lambda = list(
            arn = "string",
            timeoutSeconds = 123,
            failureMode = "allow"|"deny"
          ),
          sns = list(
            arn = "string"
          ),
          eventBridge = list(
            arn = "string"
          )
        )
      ),
      afterInvocation = list(
        name = "string",
        target = list(
          lambda = list(
            arn = "string",
            timeoutSeconds = 123,
            failureMode = "allow"|"deny"
          ),
          sns = list(
            arn = "string"
          ),
          eventBridge = list(
            arn = "string"
          )
        )
      ),
      beforeToolCall = list(
        name = "string",
        target = list(
          lambda = list(
            arn = "string",
            timeoutSeconds = 123,
            failureMode = "allow"|"deny"
          ),
          sns = list(
            arn = "string"
          ),
          eventBridge = list(
            arn = "string"
          )
        )
      ),
      afterToolCall = list(
        name = "string",
        target = list(
          lambda = list(
            arn = "string",
            timeoutSeconds = 123,
            failureMode = "allow"|"deny"
          ),
          sns = list(
            arn = "string"
          ),
          eventBridge = list(
            arn = "string"
          )
        )
      )
    )
  ),
  maxIterations = 123,
  maxTokens = 123,
  timeoutSeconds = 123,
  tags = list(
    "string"
  )
)