{
  "typeName" : "AWS::BedrockAgentCore::Harness",
  "description" : "Resource Type definition for AWS::BedrockAgentCore::Harness - a managed agentic loop service that provides a turnkey solution for running stateful, tool-equipped AI agents.",
  "definitions" : {
    "HarnessStatus" : {
      "type" : "string",
      "enum" : [ "CREATING", "CREATE_FAILED", "UPDATING", "UPDATE_FAILED", "READY", "DELETING", "DELETE_FAILED" ]
    },
    "HarnessEnvironmentArtifact" : {
      "type" : "object",
      "properties" : {
        "ContainerConfiguration" : {
          "$ref" : "#/definitions/ContainerConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "ContainerConfiguration" : {
      "type" : "object",
      "properties" : {
        "ContainerUri" : {
          "type" : "string",
          "description" : "The ECR URI of the container.",
          "minLength" : 1,
          "maxLength" : 1024,
          "pattern" : "^(([0-9]{12})\\.dkr\\.ecr\\.([a-z0-9-]+)\\.amazonaws\\.com(\\.cn)?|public\\.ecr\\.aws)/((?:[a-z0-9]+(?:[._-][a-z0-9]+)*/)*[a-z0-9]+(?:[._-][a-z0-9]+)*)(?::([^:@]{1,300}))?(?:@(.+))?$"
        }
      },
      "required" : [ "ContainerUri" ],
      "additionalProperties" : false
    },
    "HarnessEnvironmentProvider" : {
      "type" : "object",
      "properties" : {
        "AgentCoreRuntimeEnvironment" : {
          "$ref" : "#/definitions/HarnessAgentCoreRuntimeEnvironment"
        }
      },
      "additionalProperties" : false
    },
    "HarnessAgentCoreRuntimeEnvironment" : {
      "type" : "object",
      "properties" : {
        "AgentRuntimeArn" : {
          "type" : "string",
          "description" : "The ARN of the underlying AgentCore Runtime.",
          "minLength" : 20,
          "maxLength" : 1011
        },
        "AgentRuntimeName" : {
          "type" : "string",
          "description" : "The name of the underlying AgentCore Runtime."
        },
        "AgentRuntimeId" : {
          "type" : "string",
          "description" : "The ID of the underlying AgentCore Runtime."
        },
        "LifecycleConfiguration" : {
          "$ref" : "#/definitions/LifecycleConfiguration"
        },
        "NetworkConfiguration" : {
          "$ref" : "#/definitions/NetworkConfiguration"
        },
        "FilesystemConfigurations" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/FilesystemConfiguration"
          },
          "minItems" : 0,
          "maxItems" : 5
        }
      },
      "additionalProperties" : false
    },
    "LifecycleConfiguration" : {
      "type" : "object",
      "properties" : {
        "IdleRuntimeSessionTimeout" : {
          "type" : "integer",
          "minimum" : 60,
          "maximum" : 28800
        },
        "MaxLifetime" : {
          "type" : "integer",
          "minimum" : 60,
          "maximum" : 28800
        }
      },
      "additionalProperties" : false
    },
    "NetworkConfiguration" : {
      "type" : "object",
      "properties" : {
        "NetworkMode" : {
          "type" : "string",
          "enum" : [ "PUBLIC", "VPC" ]
        },
        "NetworkModeConfig" : {
          "$ref" : "#/definitions/VpcConfig"
        }
      },
      "required" : [ "NetworkMode" ],
      "additionalProperties" : false
    },
    "VpcConfig" : {
      "type" : "object",
      "properties" : {
        "SecurityGroups" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "pattern" : "^sg-[0-9a-zA-Z]{8,17}$"
          },
          "minItems" : 1,
          "maxItems" : 16
        },
        "Subnets" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "pattern" : "^subnet-[0-9a-zA-Z]{8,17}$"
          },
          "minItems" : 1,
          "maxItems" : 16
        }
      },
      "required" : [ "SecurityGroups", "Subnets" ],
      "additionalProperties" : false
    },
    "FilesystemConfiguration" : {
      "type" : "object",
      "properties" : {
        "SessionStorage" : {
          "$ref" : "#/definitions/SessionStorageConfiguration"
        },
        "S3FilesAccessPoint" : {
          "$ref" : "#/definitions/S3FilesAccessPointConfiguration"
        },
        "EfsAccessPoint" : {
          "$ref" : "#/definitions/EfsAccessPointConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "SessionStorageConfiguration" : {
      "type" : "object",
      "properties" : {
        "MountPath" : {
          "type" : "string",
          "minLength" : 6,
          "maxLength" : 200,
          "pattern" : "^/mnt/[a-zA-Z0-9._-]+/?$"
        }
      },
      "required" : [ "MountPath" ],
      "additionalProperties" : false
    },
    "S3FilesAccessPointConfiguration" : {
      "type" : "object",
      "description" : "Configuration for an Amazon S3 Files access point to mount into the AgentCore Runtime.",
      "properties" : {
        "AccessPointArn" : {
          "type" : "string",
          "maxLength" : 256,
          "pattern" : "^arn:aws[-a-z]*:s3files:[0-9a-z-:]+:file-system/fs-[0-9a-f]{17,40}/access-point/fsap-[0-9a-f]{17,40}$"
        },
        "MountPath" : {
          "type" : "string",
          "minLength" : 6,
          "maxLength" : 200,
          "pattern" : "^/mnt/[a-zA-Z0-9._-]+/?$"
        }
      },
      "required" : [ "AccessPointArn", "MountPath" ],
      "additionalProperties" : false
    },
    "EfsAccessPointConfiguration" : {
      "type" : "object",
      "description" : "Configuration for an Amazon EFS access point to mount into the AgentCore Runtime.",
      "properties" : {
        "AccessPointArn" : {
          "type" : "string",
          "maxLength" : 128,
          "pattern" : "^arn:aws[-a-z]*:elasticfilesystem:[0-9a-z-:]+:access-point/fsap-[0-9a-f]{8,40}$"
        },
        "MountPath" : {
          "type" : "string",
          "minLength" : 6,
          "maxLength" : 200,
          "pattern" : "^/mnt/[a-zA-Z0-9._-]+/?$"
        }
      },
      "required" : [ "AccessPointArn", "MountPath" ],
      "additionalProperties" : false
    },
    "HarnessModelConfiguration" : {
      "type" : "object",
      "properties" : {
        "BedrockModelConfig" : {
          "$ref" : "#/definitions/HarnessBedrockModelConfig"
        },
        "OpenAiModelConfig" : {
          "$ref" : "#/definitions/HarnessOpenAiModelConfig"
        },
        "GeminiModelConfig" : {
          "$ref" : "#/definitions/HarnessGeminiModelConfig"
        },
        "LiteLlmModelConfig" : {
          "$ref" : "#/definitions/HarnessLiteLlmModelConfig"
        }
      },
      "oneOf" : [ {
        "required" : [ "BedrockModelConfig" ]
      }, {
        "required" : [ "OpenAiModelConfig" ]
      }, {
        "required" : [ "GeminiModelConfig" ]
      }, {
        "required" : [ "LiteLlmModelConfig" ]
      } ],
      "additionalProperties" : false
    },
    "HarnessBedrockModelConfig" : {
      "type" : "object",
      "properties" : {
        "ModelId" : {
          "type" : "string"
        },
        "MaxTokens" : {
          "type" : "integer",
          "minimum" : 1
        },
        "Temperature" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 2
        },
        "TopP" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 1
        },
        "ApiFormat" : {
          "type" : "string",
          "enum" : [ "converse_stream", "responses", "chat_completions" ]
        },
        "AdditionalParams" : {
          "type" : "object",
          "description" : "Provider-specific parameters passed through to the model provider unchanged.",
          "additionalProperties" : false,
          "patternProperties" : {
            "^[\\s\\S]{1,256}$" : { }
          }
        }
      },
      "required" : [ "ModelId" ],
      "additionalProperties" : false
    },
    "HarnessOpenAiModelConfig" : {
      "type" : "object",
      "properties" : {
        "ModelId" : {
          "type" : "string"
        },
        "ApiKeyArn" : {
          "type" : "string",
          "pattern" : "^arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:token-vault/[a-zA-Z0-9-.]+/apikeycredentialprovider/[a-zA-Z0-9-.]+$"
        },
        "MaxTokens" : {
          "type" : "integer",
          "minimum" : 1
        },
        "Temperature" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 2
        },
        "TopP" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 1
        },
        "ApiFormat" : {
          "type" : "string",
          "enum" : [ "chat_completions", "responses" ]
        },
        "AdditionalParams" : {
          "type" : "object",
          "description" : "Provider-specific parameters passed through to the model provider unchanged.",
          "additionalProperties" : false,
          "patternProperties" : {
            "^[\\s\\S]{1,256}$" : { }
          }
        }
      },
      "required" : [ "ModelId", "ApiKeyArn" ],
      "additionalProperties" : false
    },
    "HarnessLiteLlmModelConfig" : {
      "type" : "object",
      "properties" : {
        "ModelId" : {
          "type" : "string"
        },
        "ApiKeyArn" : {
          "type" : "string",
          "pattern" : "^arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:token-vault/[a-zA-Z0-9-.]+/apikeycredentialprovider/[a-zA-Z0-9-.]+$"
        },
        "ApiBase" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 16383
        },
        "MaxTokens" : {
          "type" : "integer",
          "minimum" : 1
        },
        "Temperature" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 2
        },
        "TopP" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 1
        },
        "AdditionalParams" : {
          "type" : "object",
          "description" : "Provider-specific parameters passed through to LiteLLM unchanged.",
          "additionalProperties" : false,
          "patternProperties" : {
            "^[\\s\\S]{1,256}$" : { }
          }
        }
      },
      "required" : [ "ModelId" ],
      "additionalProperties" : false
    },
    "HarnessGeminiModelConfig" : {
      "type" : "object",
      "properties" : {
        "ModelId" : {
          "type" : "string"
        },
        "ApiKeyArn" : {
          "type" : "string",
          "pattern" : "^arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:token-vault/[a-zA-Z0-9-.]+/apikeycredentialprovider/[a-zA-Z0-9-.]+$"
        },
        "MaxTokens" : {
          "type" : "integer",
          "minimum" : 1
        },
        "Temperature" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 2
        },
        "TopP" : {
          "type" : "number",
          "minimum" : 0,
          "maximum" : 1
        },
        "TopK" : {
          "type" : "integer",
          "minimum" : 0,
          "maximum" : 500
        }
      },
      "required" : [ "ModelId", "ApiKeyArn" ],
      "additionalProperties" : false
    },
    "AuthorizerConfiguration" : {
      "type" : "object",
      "properties" : {
        "CustomJWTAuthorizer" : {
          "$ref" : "#/definitions/CustomJWTAuthorizerConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "CustomJWTAuthorizerConfiguration" : {
      "type" : "object",
      "properties" : {
        "DiscoveryUrl" : {
          "type" : "string",
          "pattern" : "^.+/\\.well-known/openid-configuration$"
        },
        "AllowedAudience" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "minItems" : 1
        },
        "AllowedClients" : {
          "type" : "array",
          "items" : {
            "type" : "string"
          },
          "minItems" : 1
        },
        "AllowedScopes" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "minLength" : 1,
            "maxLength" : 255,
            "pattern" : "^[\\x21\\x23-\\x5B\\x5D-\\x7E]+$"
          },
          "minItems" : 1
        },
        "CustomClaims" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/CustomClaimValidationType"
          },
          "minItems" : 1
        },
        "PrivateEndpoint" : {
          "$ref" : "#/definitions/PrivateEndpoint"
        },
        "PrivateEndpointOverrides" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/definitions/PrivateEndpointOverride"
          },
          "maxItems" : 5
        }
      },
      "required" : [ "DiscoveryUrl" ],
      "additionalProperties" : false
    },
    "PrivateEndpoint" : {
      "type" : "object",
      "description" : "Private endpoint configuration for connecting to the OpenID Connect discovery endpoint over a private network.",
      "properties" : {
        "SelfManagedLatticeResource" : {
          "$ref" : "#/definitions/SelfManagedLatticeResource"
        },
        "ManagedVpcResource" : {
          "$ref" : "#/definitions/ManagedVpcResource"
        }
      },
      "additionalProperties" : false
    },
    "SelfManagedLatticeResource" : {
      "type" : "object",
      "description" : "Configuration for connecting to a private resource using a self-managed VPC Lattice resource configuration.",
      "properties" : {
        "ResourceConfigurationIdentifier" : {
          "type" : "string",
          "minLength" : 20,
          "maxLength" : 2048,
          "pattern" : "^((rcfg-[0-9a-z]{17})|(arn:[a-z0-9\\-]+:vpc-lattice:[a-zA-Z0-9\\-]+:\\d{12}:resourceconfiguration/rcfg-[0-9a-z]{17}))$"
        }
      },
      "required" : [ "ResourceConfigurationIdentifier" ],
      "additionalProperties" : false
    },
    "ManagedVpcResource" : {
      "type" : "object",
      "description" : "Configuration for a service-managed VPC endpoint.",
      "properties" : {
        "VpcIdentifier" : {
          "type" : "string",
          "pattern" : "^vpc-(([0-9a-z]{8})|([0-9a-z]{17}))$"
        },
        "SubnetIds" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "pattern" : "^subnet-[0-9a-zA-Z]{8,17}$"
          }
        },
        "EndpointIpAddressType" : {
          "type" : "string",
          "enum" : [ "IPV4", "IPV6" ]
        },
        "SecurityGroupIds" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "pattern" : "^sg-(([0-9a-z]{8})|([0-9a-z]{17}))$"
          },
          "minItems" : 0,
          "maxItems" : 5
        },
        "Tags" : {
          "type" : "object",
          "maxProperties" : 50,
          "additionalProperties" : false,
          "patternProperties" : {
            "^[a-zA-Z0-9\\s_.:/=+\\-@]{1,128}$" : {
              "type" : "string",
              "maxLength" : 256,
              "pattern" : "^[a-zA-Z0-9\\s_.:/=+\\-@]*$"
            }
          }
        },
        "RoutingDomain" : {
          "type" : "string",
          "minLength" : 3,
          "maxLength" : 255
        }
      },
      "required" : [ "VpcIdentifier", "SubnetIds", "EndpointIpAddressType" ],
      "additionalProperties" : false
    },
    "PrivateEndpointOverride" : {
      "type" : "object",
      "description" : "Maps a domain to a private endpoint for resolving that domain over a private network.",
      "properties" : {
        "Domain" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 253
        },
        "PrivateEndpoint" : {
          "$ref" : "#/definitions/PrivateEndpoint"
        }
      },
      "required" : [ "Domain", "PrivateEndpoint" ],
      "additionalProperties" : false
    },
    "CustomClaimValidationType" : {
      "type" : "object",
      "properties" : {
        "InboundTokenClaimName" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255,
          "pattern" : "^[A-Za-z0-9_.-:]+$"
        },
        "InboundTokenClaimValueType" : {
          "type" : "string",
          "enum" : [ "STRING", "STRING_ARRAY" ]
        },
        "AuthorizingClaimMatchValue" : {
          "$ref" : "#/definitions/AuthorizingClaimMatchValueType"
        }
      },
      "required" : [ "InboundTokenClaimName", "InboundTokenClaimValueType", "AuthorizingClaimMatchValue" ],
      "additionalProperties" : false
    },
    "AuthorizingClaimMatchValueType" : {
      "type" : "object",
      "properties" : {
        "ClaimMatchValue" : {
          "$ref" : "#/definitions/ClaimMatchValueType"
        },
        "ClaimMatchOperator" : {
          "type" : "string",
          "enum" : [ "EQUALS", "CONTAINS", "CONTAINS_ANY" ]
        }
      },
      "required" : [ "ClaimMatchValue", "ClaimMatchOperator" ],
      "additionalProperties" : false
    },
    "ClaimMatchValueType" : {
      "type" : "object",
      "properties" : {
        "MatchValueString" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 255,
          "pattern" : "^[A-Za-z0-9_.-]+$"
        },
        "MatchValueStringList" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "minLength" : 1,
            "maxLength" : 255,
            "pattern" : "^[A-Za-z0-9_.-]+$"
          },
          "minItems" : 1
        }
      },
      "oneOf" : [ {
        "required" : [ "MatchValueString" ]
      }, {
        "required" : [ "MatchValueStringList" ]
      } ],
      "additionalProperties" : false
    },
    "HarnessSystemContentBlock" : {
      "type" : "object",
      "properties" : {
        "Text" : {
          "type" : "string",
          "description" : "The text content of the system prompt block.",
          "minLength" : 1
        }
      },
      "required" : [ "Text" ],
      "additionalProperties" : false
    },
    "HarnessTool" : {
      "type" : "object",
      "properties" : {
        "Type" : {
          "type" : "string",
          "enum" : [ "remote_mcp", "agentcore_browser", "agentcore_gateway", "inline_function", "agentcore_code_interpreter" ]
        },
        "Name" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 64,
          "pattern" : "^[a-zA-Z0-9_-]+$"
        },
        "Config" : {
          "$ref" : "#/definitions/HarnessToolConfiguration"
        }
      },
      "required" : [ "Type" ],
      "additionalProperties" : false
    },
    "HarnessToolConfiguration" : {
      "type" : "object",
      "properties" : {
        "RemoteMcp" : {
          "$ref" : "#/definitions/HarnessRemoteMcpConfig"
        },
        "AgentCoreBrowser" : {
          "$ref" : "#/definitions/HarnessAgentCoreBrowserConfig"
        },
        "AgentCoreGateway" : {
          "$ref" : "#/definitions/HarnessAgentCoreGatewayConfig"
        },
        "InlineFunction" : {
          "$ref" : "#/definitions/HarnessInlineFunctionConfig"
        },
        "AgentCoreCodeInterpreter" : {
          "$ref" : "#/definitions/HarnessAgentCoreCodeInterpreterConfig"
        }
      },
      "oneOf" : [ {
        "required" : [ "RemoteMcp" ]
      }, {
        "required" : [ "AgentCoreBrowser" ]
      }, {
        "required" : [ "AgentCoreGateway" ]
      }, {
        "required" : [ "InlineFunction" ]
      }, {
        "required" : [ "AgentCoreCodeInterpreter" ]
      } ],
      "additionalProperties" : false
    },
    "HarnessRemoteMcpConfig" : {
      "type" : "object",
      "properties" : {
        "Url" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 16383
        },
        "Headers" : {
          "type" : "object",
          "patternProperties" : {
            "^[\\s\\S]*$" : {
              "type" : "string",
              "minLength" : 1,
              "maxLength" : 16383
            }
          },
          "additionalProperties" : false
        }
      },
      "required" : [ "Url" ],
      "additionalProperties" : false
    },
    "HarnessAgentCoreBrowserConfig" : {
      "type" : "object",
      "properties" : {
        "BrowserArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(-[^:]+)?:bedrock-agentcore:[a-z0-9-]+:(aws|[0-9]{12}):browser(-custom)?/(aws\\.browser\\.v1|[a-zA-Z][a-zA-Z0-9_]{0,47}-[a-zA-Z0-9]{10})$"
        }
      },
      "additionalProperties" : false
    },
    "HarnessAgentCoreGatewayConfig" : {
      "type" : "object",
      "properties" : {
        "GatewayArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(|-cn|-us-gov):bedrock-agentcore:[a-z0-9-]{1,20}:[0-9]{12}:gateway/([0-9a-z][-]?){1,48}-[a-z0-9]{10}$"
        },
        "OutboundAuth" : {
          "$ref" : "#/definitions/HarnessGatewayOutboundAuth"
        }
      },
      "required" : [ "GatewayArn" ],
      "additionalProperties" : false
    },
    "HarnessGatewayOutboundAuth" : {
      "type" : "object",
      "properties" : {
        "AwsIam" : {
          "type" : "object",
          "additionalProperties" : false
        },
        "None" : {
          "type" : "object",
          "additionalProperties" : false
        },
        "Oauth" : {
          "$ref" : "#/definitions/OAuthCredentialProvider"
        }
      },
      "oneOf" : [ {
        "required" : [ "AwsIam" ]
      }, {
        "required" : [ "None" ]
      }, {
        "required" : [ "Oauth" ]
      } ],
      "additionalProperties" : false
    },
    "OAuthCredentialProvider" : {
      "type" : "object",
      "properties" : {
        "ProviderArn" : {
          "type" : "string",
          "pattern" : "^arn:([^:]*):([^:]*):([^:]*):([0-9]{12})?:(.+)$"
        },
        "Scopes" : {
          "type" : "array",
          "items" : {
            "type" : "string",
            "minLength" : 1,
            "maxLength" : 64
          },
          "maxItems" : 100
        },
        "CustomParameters" : {
          "type" : "object",
          "patternProperties" : {
            "^[\\s\\S]*$" : {
              "type" : "string",
              "minLength" : 1,
              "maxLength" : 2048
            }
          },
          "additionalProperties" : false,
          "minProperties" : 1,
          "maxProperties" : 10
        },
        "GrantType" : {
          "type" : "string",
          "enum" : [ "CLIENT_CREDENTIALS", "AUTHORIZATION_CODE" ]
        },
        "DefaultReturnUrl" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 2048,
          "pattern" : "^\\w+:(\\/?\\/?)[^\\s]+$"
        }
      },
      "required" : [ "ProviderArn", "Scopes" ],
      "additionalProperties" : false
    },
    "HarnessInlineFunctionConfig" : {
      "type" : "object",
      "properties" : {
        "Description" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 4096
        },
        "InputSchema" : {
          "type" : "object",
          "description" : "JSON Schema describing the tool's input parameters."
        }
      },
      "required" : [ "Description", "InputSchema" ],
      "additionalProperties" : false
    },
    "HarnessAgentCoreCodeInterpreterConfig" : {
      "type" : "object",
      "properties" : {
        "CodeInterpreterArn" : {
          "type" : "string",
          "pattern" : "^arn:aws(-[^:]+)?:bedrock-agentcore:[a-z0-9-]+:(aws|[0-9]{12}):code-interpreter(-custom)?/(aws\\.codeinterpreter\\.v1|[a-zA-Z][a-zA-Z0-9_]{0,47}-[a-zA-Z0-9]{10})$"
        }
      },
      "additionalProperties" : false
    },
    "HarnessSkill" : {
      "type" : "object",
      "properties" : {
        "Path" : {
          "type" : "string",
          "description" : "The filesystem path to the skill definition.",
          "minLength" : 1
        },
        "S3" : {
          "$ref" : "#/definitions/HarnessSkillS3Source"
        },
        "Git" : {
          "$ref" : "#/definitions/HarnessSkillGitSource"
        },
        "AwsSkills" : {
          "$ref" : "#/definitions/HarnessSkillAwsSkillsSource"
        }
      },
      "additionalProperties" : false
    },
    "HarnessSkillAwsSkillsSource" : {
      "type" : "object",
      "description" : "AWS Skills baked into the Harness's underlying Runtime.",
      "properties" : {
        "Paths" : {
          "type" : "array",
          "description" : "Optionally filter allowed skills with glob syntax, e.g., ['core-skills/*'].",
          "items" : {
            "type" : "string",
            "minLength" : 1,
            "maxLength" : 4096,
            "pattern" : "^([^*?\\[\\]]|\\*)+$"
          }
        }
      },
      "additionalProperties" : false
    },
    "HarnessSkillS3Source" : {
      "type" : "object",
      "description" : "An S3 source containing the skill.",
      "properties" : {
        "Uri" : {
          "type" : "string",
          "description" : "The S3 URI pointing to the skill directory (e.g., s3://bucket/skills/my-skill/).",
          "minLength" : 5,
          "pattern" : "^s3://"
        }
      },
      "required" : [ "Uri" ],
      "additionalProperties" : false
    },
    "HarnessSkillGitSource" : {
      "type" : "object",
      "description" : "A git repository containing the skill, cloned over HTTPS.",
      "properties" : {
        "Url" : {
          "type" : "string",
          "description" : "The HTTPS URL of the git repository.",
          "minLength" : 8,
          "pattern" : "^https://"
        },
        "Path" : {
          "type" : "string",
          "description" : "Subdirectory within the repository containing the skill."
        },
        "Auth" : {
          "$ref" : "#/definitions/HarnessSkillGitAuth"
        }
      },
      "required" : [ "Url" ],
      "additionalProperties" : false
    },
    "HarnessSkillGitAuth" : {
      "type" : "object",
      "description" : "Authentication configuration for accessing a private git repository.",
      "properties" : {
        "CredentialArn" : {
          "type" : "string",
          "description" : "The ARN of the credential in AgentCore Identity containing the password or personal access token.",
          "pattern" : "^arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:token-vault/[a-zA-Z0-9-.]+/apikeycredentialprovider/[a-zA-Z0-9-.]+$"
        },
        "Username" : {
          "type" : "string",
          "description" : "Username for authentication. Defaults to 'oauth2' if not specified."
        }
      },
      "required" : [ "CredentialArn" ],
      "additionalProperties" : false
    },
    "HarnessMemoryConfiguration" : {
      "type" : "object",
      "properties" : {
        "AgentCoreMemoryConfiguration" : {
          "$ref" : "#/definitions/HarnessAgentCoreMemoryConfiguration"
        },
        "ManagedMemoryConfiguration" : {
          "$ref" : "#/definitions/HarnessManagedMemoryConfiguration"
        },
        "Disabled" : {
          "$ref" : "#/definitions/HarnessDisabledMemoryConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "HarnessManagedMemoryConfiguration" : {
      "type" : "object",
      "description" : "Configuration for managed memory. The harness creates and manages a memory resource in the customer's account.",
      "properties" : {
        "Arn" : {
          "type" : "string",
          "description" : "The ARN of the managed memory resource. Read-only, populated by the service.",
          "pattern" : "^arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:memory/[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}$"
        },
        "Strategies" : {
          "type" : "array",
          "description" : "Strategy types to enable. Defaults to [SEMANTIC, SUMMARIZATION].",
          "items" : {
            "type" : "string",
            "enum" : [ "SEMANTIC", "SUMMARIZATION", "USER_PREFERENCE", "EPISODIC" ]
          },
          "minItems" : 1,
          "maxItems" : 4,
          "uniqueItems" : true
        },
        "EventExpiryDuration" : {
          "type" : "integer",
          "description" : "Event retention in days. Defaults to 30.",
          "minimum" : 3,
          "maximum" : 365
        },
        "EncryptionKeyArn" : {
          "type" : "string",
          "description" : "Customer-managed KMS key ARN. Defaults to AWS-owned key. Not updatable after creation."
        }
      },
      "additionalProperties" : false
    },
    "HarnessDisabledMemoryConfiguration" : {
      "type" : "object",
      "description" : "Explicitly opt out of memory.",
      "additionalProperties" : false
    },
    "HarnessAgentCoreMemoryConfiguration" : {
      "type" : "object",
      "properties" : {
        "Arn" : {
          "type" : "string",
          "pattern" : "^arn:aws:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:memory/[a-zA-Z][a-zA-Z0-9-_]{0,99}-[a-zA-Z0-9]{10}$"
        },
        "ActorId" : {
          "type" : "string"
        },
        "MessagesCount" : {
          "type" : "integer"
        },
        "RetrievalConfig" : {
          "type" : "object",
          "patternProperties" : {
            "^[\\s\\S]*$" : {
              "$ref" : "#/definitions/HarnessAgentCoreMemoryRetrievalConfig"
            }
          },
          "additionalProperties" : false
        }
      },
      "required" : [ "Arn" ],
      "additionalProperties" : false
    },
    "HarnessAgentCoreMemoryRetrievalConfig" : {
      "type" : "object",
      "properties" : {
        "TopK" : {
          "description" : "Maximum number of memory records to retrieve. Typed as both integer and string because CloudFormation marshals scalars nested in dynamic-key (patternProperties) maps as strings, while direct API/CDK callers send a JSON integer; both forms must validate.",
          "type" : [ "integer", "string" ]
        },
        "RelevanceScore" : {
          "description" : "Minimum relevance score for retrieved memories. Typed as both number and string because CloudFormation marshals scalars nested in dynamic-key (patternProperties) maps as strings, while direct API/CDK callers send a JSON number; both forms must validate.",
          "type" : [ "number", "string" ]
        },
        "StrategyId" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "HarnessTruncationConfiguration" : {
      "type" : "object",
      "properties" : {
        "Strategy" : {
          "type" : "string",
          "enum" : [ "sliding_window", "summarization", "none" ]
        },
        "Config" : {
          "$ref" : "#/definitions/HarnessTruncationStrategyConfiguration"
        }
      },
      "required" : [ "Strategy" ],
      "additionalProperties" : false
    },
    "HarnessTruncationStrategyConfiguration" : {
      "type" : "object",
      "properties" : {
        "SlidingWindow" : {
          "$ref" : "#/definitions/HarnessSlidingWindowConfiguration"
        },
        "Summarization" : {
          "$ref" : "#/definitions/HarnessSummarizationConfiguration"
        }
      },
      "additionalProperties" : false
    },
    "HarnessSlidingWindowConfiguration" : {
      "type" : "object",
      "properties" : {
        "MessagesCount" : {
          "type" : "integer"
        }
      },
      "additionalProperties" : false
    },
    "HarnessSummarizationConfiguration" : {
      "type" : "object",
      "properties" : {
        "SummaryRatio" : {
          "type" : "number"
        },
        "PreserveRecentMessages" : {
          "type" : "integer"
        },
        "SummarizationSystemPrompt" : {
          "type" : "string"
        }
      },
      "additionalProperties" : false
    },
    "Tag" : {
      "type" : "object",
      "properties" : {
        "Key" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 128,
          "pattern" : "^[a-zA-Z0-9\\s_.:/=+\\-@]*$"
        },
        "Value" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 256,
          "pattern" : "^[a-zA-Z0-9\\s_.:/=+\\-@]*$"
        }
      },
      "required" : [ "Key", "Value" ],
      "additionalProperties" : false
    }
  },
  "properties" : {
    "Arn" : {
      "type" : "string",
      "description" : "The Amazon Resource Name (ARN) of the harness.",
      "pattern" : "^arn:([^:]+)?:bedrock-agentcore:[a-z0-9-]+:[0-9]{12}:harness/[a-zA-Z][a-zA-Z0-9_]{0,39}-[a-zA-Z0-9]{10}$"
    },
    "HarnessId" : {
      "type" : "string",
      "description" : "The unique identifier of the harness.",
      "pattern" : "^[a-zA-Z][a-zA-Z0-9_]{0,39}-[a-zA-Z0-9]{10}$"
    },
    "HarnessName" : {
      "type" : "string",
      "description" : "The name of the harness.",
      "pattern" : "^[a-zA-Z][a-zA-Z0-9_]{0,39}$"
    },
    "Status" : {
      "$ref" : "#/definitions/HarnessStatus",
      "description" : "The current status of the harness."
    },
    "Version" : {
      "type" : "string",
      "description" : "The version of the harness. Incremented on every successful update.",
      "pattern" : "^([1-9][0-9]{0,4})$",
      "minLength" : 1,
      "maxLength" : 5
    },
    "ExecutionRoleArn" : {
      "type" : "string",
      "description" : "The ARN of the IAM role that the harness assumes when running.",
      "minLength" : 1,
      "maxLength" : 2048,
      "pattern" : "^arn:aws(-[^:]+)?:iam::[0-9]{12}:role/.+$"
    },
    "Environment" : {
      "$ref" : "#/definitions/HarnessEnvironmentProvider",
      "description" : "The compute environment configuration for the harness, including underlying runtime information."
    },
    "EnvironmentArtifact" : {
      "$ref" : "#/definitions/HarnessEnvironmentArtifact",
      "description" : "The environment artifact for the harness, such as a custom container image."
    },
    "EnvironmentVariables" : {
      "type" : "object",
      "description" : "Environment variables to set in the harness runtime environment.",
      "patternProperties" : {
        "^[\\s\\S]*$" : {
          "type" : "string",
          "minLength" : 0,
          "maxLength" : 5000
        }
      },
      "additionalProperties" : false,
      "maxProperties" : 50
    },
    "AuthorizerConfiguration" : {
      "$ref" : "#/definitions/AuthorizerConfiguration",
      "description" : "The inbound authorization configuration for authenticating incoming requests."
    },
    "Model" : {
      "$ref" : "#/definitions/HarnessModelConfiguration",
      "description" : "The model configuration for the harness."
    },
    "SystemPrompt" : {
      "type" : "array",
      "description" : "The system prompt that defines the agent's behavior.",
      "items" : {
        "$ref" : "#/definitions/HarnessSystemContentBlock"
      }
    },
    "Tools" : {
      "type" : "array",
      "description" : "The tools available to the agent.",
      "items" : {
        "$ref" : "#/definitions/HarnessTool"
      }
    },
    "Skills" : {
      "type" : "array",
      "description" : "The skills available to the agent.",
      "items" : {
        "$ref" : "#/definitions/HarnessSkill"
      }
    },
    "AllowedTools" : {
      "type" : "array",
      "description" : "The tools that the agent is allowed to use.",
      "items" : {
        "type" : "string",
        "minLength" : 1,
        "maxLength" : 64,
        "pattern" : "^(\\*|@?[^/]+(/[^/]+)?)$"
      }
    },
    "Memory" : {
      "$ref" : "#/definitions/HarnessMemoryConfiguration",
      "description" : "The AgentCore Memory configuration for persisting conversation context."
    },
    "Truncation" : {
      "$ref" : "#/definitions/HarnessTruncationConfiguration",
      "description" : "The truncation configuration for managing conversation context."
    },
    "MaxIterations" : {
      "type" : "integer",
      "description" : "The maximum number of iterations the agent loop can execute per invocation."
    },
    "MaxTokens" : {
      "type" : "integer",
      "description" : "The maximum number of tokens the agent can generate per iteration."
    },
    "TimeoutSeconds" : {
      "type" : "integer",
      "description" : "The maximum duration in seconds for the agent loop execution per invocation."
    },
    "CreatedAt" : {
      "type" : "string",
      "description" : "The timestamp when the harness was created.",
      "format" : "date-time"
    },
    "UpdatedAt" : {
      "type" : "string",
      "description" : "The timestamp when the harness was last updated.",
      "format" : "date-time"
    },
    "Tags" : {
      "type" : "array",
      "description" : "Tags to apply to the harness resource.",
      "items" : {
        "$ref" : "#/definitions/Tag"
      },
      "maxItems" : 50,
      "insertionOrder" : false
    }
  },
  "additionalProperties" : false,
  "required" : [ "HarnessName", "ExecutionRoleArn", "Model" ],
  "readOnlyProperties" : [ "/properties/Arn", "/properties/HarnessId", "/properties/Status", "/properties/Version", "/properties/CreatedAt", "/properties/UpdatedAt", "/properties/Memory/ManagedMemoryConfiguration/Arn", "/properties/Environment/AgentCoreRuntimeEnvironment/AgentRuntimeArn", "/properties/Environment/AgentCoreRuntimeEnvironment/AgentRuntimeName", "/properties/Environment/AgentCoreRuntimeEnvironment/AgentRuntimeId" ],
  "createOnlyProperties" : [ "/properties/HarnessName", "/properties/Memory/ManagedMemoryConfiguration/EncryptionKeyArn" ],
  "primaryIdentifier" : [ "/properties/Arn" ],
  "additionalIdentifiers" : [ [ "/properties/HarnessId" ] ],
  "tagging" : {
    "taggable" : true,
    "tagOnCreate" : true,
    "tagUpdatable" : true,
    "tagProperty" : "/properties/Tags",
    "cloudFormationSystemTags" : true,
    "permissions" : [ "bedrock-agentcore:TagResource", "bedrock-agentcore:UntagResource", "bedrock-agentcore:ListTagsForResource" ]
  },
  "handlers" : {
    "create" : {
      "permissions" : [ "bedrock-agentcore:CreateAgentRuntime", "bedrock-agentcore:CreateAgentRuntimeEndpoint", "bedrock-agentcore:CreateHarness", "bedrock-agentcore:CreateMemory", "bedrock-agentcore:GetMemory", "bedrock-agentcore:DeleteMemory", "bedrock-agentcore:CreateWorkloadIdentity", "bedrock-agentcore:DeleteAgentRuntime", "bedrock-agentcore:DeleteAgentRuntimeEndpoint", "bedrock-agentcore:DeleteWorkloadIdentity", "bedrock-agentcore:GetAgentRuntime", "bedrock-agentcore:GetAgentRuntimeEndpoint", "bedrock-agentcore:GetHarness", "bedrock-agentcore:TagResource", "bedrock-agentcore:UpdateAgentRuntime", "bedrock-agentcore:UpdateAgentRuntimeEndpoint", "iam:CreateServiceLinkedRole", "iam:PassRole" ]
    },
    "read" : {
      "permissions" : [ "bedrock-agentcore:GetHarness", "bedrock-agentcore:ListTagsForResource" ]
    },
    "update" : {
      "permissions" : [ "bedrock-agentcore:CreateAgentRuntime", "bedrock-agentcore:CreateAgentRuntimeEndpoint", "bedrock-agentcore:CreateMemory", "bedrock-agentcore:GetMemory", "bedrock-agentcore:UpdateMemory", "bedrock-agentcore:DeleteMemory", "bedrock-agentcore:CreateWorkloadIdentity", "bedrock-agentcore:DeleteAgentRuntime", "bedrock-agentcore:DeleteAgentRuntimeEndpoint", "bedrock-agentcore:DeleteWorkloadIdentity", "bedrock-agentcore:GetAgentRuntime", "bedrock-agentcore:GetAgentRuntimeEndpoint", "bedrock-agentcore:GetHarness", "bedrock-agentcore:ListTagsForResource", "bedrock-agentcore:TagResource", "bedrock-agentcore:UntagResource", "bedrock-agentcore:UpdateAgentRuntime", "bedrock-agentcore:UpdateAgentRuntimeEndpoint", "bedrock-agentcore:UpdateHarness", "iam:CreateServiceLinkedRole", "iam:PassRole" ]
    },
    "delete" : {
      "permissions" : [ "bedrock-agentcore:CreateAgentRuntime", "bedrock-agentcore:CreateAgentRuntimeEndpoint", "bedrock-agentcore:CreateWorkloadIdentity", "bedrock-agentcore:DeleteAgentRuntime", "bedrock-agentcore:DeleteAgentRuntimeEndpoint", "bedrock-agentcore:DeleteHarness", "bedrock-agentcore:DeleteMemory", "bedrock-agentcore:GetMemory", "bedrock-agentcore:DeleteWorkloadIdentity", "bedrock-agentcore:GetAgentRuntime", "bedrock-agentcore:GetAgentRuntimeEndpoint", "bedrock-agentcore:GetHarness", "bedrock-agentcore:UpdateAgentRuntime", "bedrock-agentcore:UpdateAgentRuntimeEndpoint" ]
    },
    "list" : {
      "permissions" : [ "bedrock-agentcore:ListHarnesses" ]
    }
  }
}