<a id="cli-aws-cloudwatchomni-stop-experiment-run"></a>

# stop-experiment-run

## Description

Stops a run.

Applies to runs reported from the caller’s code and to hosted runs. The run ends as DID_NOT_FINISH with statusReason STOPPED; a hosted run is STOPPING until its batch evaluation has stopped. Stopping a run that is STOPPING or has ended returns its current state.

Fails with a ConflictException (RUN_TERMINAL) while a CompleteExperimentRun call is finishing the run; retry CompleteExperimentRun instead.

See also: [AWS API Documentation](https://docs.aws.amazon.com/goto/WebAPI/cloudwatchomni-2025-01-01/StopExperimentRun)

## Synopsis

```
  stop-experiment-run
--experiment-id <value>
--run-id <value>
[--detail <value>]
[--cli-input-json | --cli-input-yaml]
[--generate-cli-skeleton <value>]
[--debug]
[--endpoint-url <value>]
[--no-verify-ssl]
[--no-paginate]
[--output <value>]
[--query <value>]
[--profile <value>]
[--region <value>]
[--version <value>]
[--color <value>]
[--no-sign-request]
[--ca-bundle <value>]
[--cli-read-timeout <value>]
[--cli-connect-timeout <value>]
[--cli-binary-format <value>]
[--no-cli-pager]
[--cli-auto-prompt]
[--no-cli-auto-prompt]
[--cli-error-format <value>]
[--help]
```

## Options

`--experiment-id` (string) [required]

> The ID of the experiment the run belongs to.

> Constraints:

> * min: `30`
> * max: `30`
> * pattern: `exp-[0-9A-Z]{26}`

`--run-id` (string) [required]

> The ID of the run to stop.

> Constraints:

> * min: `1`
> * max: `128`
> * pattern: `[a-zA-Z0-9_.-]+`

`--detail` (string)

> An optional reason for stopping the run, stored as the run’s statusDetail. For example, “agent unreachable after 5 consecutive errors”.

> Constraints:

> * min: `0`
> * max: `1024`

`--cli-input-json` | `--cli-input-yaml` (string)
Reads arguments from the JSON string provided. The JSON string follows the format provided by `--generate-cli-skeleton`. If other arguments are provided on the command line, those values will override the JSON-provided values. It is not possible to pass arbitrary binary values using a JSON-provided value as the string will be taken literally. This may not be specified along with `--cli-input-yaml`.

`--generate-cli-skeleton` (string)
Prints a JSON skeleton to standard output without sending an API request. If provided with no value or the value `input`, prints a sample input JSON that can be used as an argument for `--cli-input-json`. Similarly, if provided `yaml-input` it will print a sample input YAML that can be used with `--cli-input-yaml`. If provided with the value `output`, it validates the command inputs and returns a sample output JSON for that command. The generated JSON skeleton is not stable between versions of the AWS CLI and there are no backwards compatibility guarantees in the JSON skeleton generated.

## Global Options

`--debug` (boolean)

Turn on debug logging.

`--endpoint-url` (string)

Override command’s default URL with the given URL.

`--no-verify-ssl` (boolean)

By default, the AWS CLI uses SSL when communicating with AWS services. For each SSL connection, the AWS CLI will verify SSL certificates. This option overrides the default behavior of verifying SSL certificates.

`--no-paginate` (boolean)

Disable automatic pagination. If automatic pagination is disabled, the AWS CLI will only make one call, for the first page of results.

`--output` (string)

The formatting style for command output.

* json
* text
* table
* yaml
* yaml-stream
* off

`--query` (string)

A JMESPath query to use in filtering the response data.

`--profile` (string)

Use a specific profile from your credential file.

`--region` (string)

The region to use. Overrides config/env settings.

`--version` (string)

Display the version of this tool.

`--color` (string)

Turn on/off color output.

* on
* off
* auto

`--no-sign-request` (boolean)

Do not sign requests. Credentials will not be loaded if this argument is provided.

`--ca-bundle` (string)

The CA certificate bundle to use when verifying SSL certificates. Overrides config/env settings.

`--cli-read-timeout` (int)

The maximum socket read time in seconds. If the value is set to 0, the socket read will be blocking and not timeout. The default value is 60 seconds.

`--cli-connect-timeout` (int)

The maximum socket connect time in seconds. If the value is set to 0, the socket connect will be blocking and not timeout. The default value is 60 seconds.

`--cli-binary-format` (string)

The formatting style to be used for binary blobs. The default format is base64. The base64 format expects binary blobs to be provided as a base64 encoded string. The raw-in-base64-out format preserves compatibility with AWS CLI V1 behavior and binary values must be passed literally. When providing contents from a file that map to a binary blob `fileb://` will always be treated as binary and use the file contents directly regardless of the `cli-binary-format` setting. When using `file://` the file contents will need to properly formatted for the configured `cli-binary-format`.

* base64
* raw-in-base64-out

`--no-cli-pager` (boolean)

Disable cli pager for output.

`--cli-auto-prompt` (boolean)

Automatically prompt for CLI input parameters.

`--no-cli-auto-prompt` (boolean)

Disable automatically prompt for CLI input parameters.

`--cli-error-format` (string)

The formatting style for error output. By default, errors are displayed in enhanced format.

* legacy
* json
* yaml
* text
* table
* enhanced

`--help` (boolean)

Display help for the command/subcommand.

## Output

run -> (structure)

> The details of the run after the stop request.

> experimentId -> (string) [required]

> > The ID of the experiment the run belongs to.

> > Constraints:

> > * min: `30`
> > * max: `30`
> > * pattern: `exp-[0-9A-Z]{26}`

> runId -> (string) [required]

> > The ID of the run.

> > Constraints:

> > * min: `1`
> > * max: `128`
> > * pattern: `[a-zA-Z0-9_.-]+`

> source -> (string) [required]

> > Whether the run is reported by the caller’s code or hosted by the service.

> > Possible values:

> > * `REPORTED`
> > * `HOSTED`

> status -> (string) [required]

> > The status of the run.

> > Possible values:

> > * `RUNNING`
> > * `STOPPING`
> > * `COMPLETED`
> > * `DID_NOT_FINISH`

> statusReason -> (string)

> > Why the run did not finish. Present when status is DID_NOT_FINISH.

> > Possible values:

> > * `STOPPED`
> > * `RUNNER_FAILED`
> > * `RESULTS_WRITE_DENIED`
> > * `INTERNAL_ERROR`
> > * `RESULTS_WRITE_FAILED`

> statusDetail -> (string)

> > Additional detail about the status: the StopExperimentRun detail, or for RUNNER_FAILED, the AgentCore error details as one string of up to 1,000 characters.

> > Constraints:

> > * min: `0`
> > * max: `1024`

> producer -> (structure)

> > The producer that reports the run. Reported runs only.

> > kind -> (string) [required]

> > > The kind of producer.

> > > Possible values:

> > > * `SDK`
> > > * `CUSTOM`

> > name -> (string) [required]

> > > The name of the producer, from 1 to 128 characters.

> > > Constraints:

> > > * min: `1`
> > > * max: `128`
> > > * pattern: `[^\p{C}]+`

> > version -> (string)

> > > The version of the producer, from 1 to 64 characters.

> > > Constraints:

> > > * min: `1`
> > > * max: `64`
> > > * pattern: `[^\p{C}]+`

> > externalId -> (string)

> > > The ID of the job in the producing system, such as a CI run ID.

> > > Constraints:

> > > * min: `1`
> > > * max: `256`
> > > * pattern: `[^\p{C}]+`

> producerPrincipal -> (string) [required]

> > The IAM principal that started the run, without the session name.

> > Constraints:

> > * min: `1`
> > * max: `2048`

> target -> (tagged union structure) [required]

> > The version of the experiment’s target that the run tested, as given when the run was started or created.

> > #### NOTE
> > This is a Tagged Union structure. Only one of the following top level keys can be set: `agentCoreRuntime`, `httpsEndpoint`, `custom`.

> > agentCoreRuntime -> (structure)

> > > An endpoint of the experiment’s AgentCore Runtime.

> > > endpointArn -> (string) [required]

> > > > The ARN of the runtime endpoint. Must belong to the experiment’s runtimeArn.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `2048`

> > > requestTemplate -> (string)

> > > > The request sent to the agent for each turn, in the AgentCore datasetExecutionConfig format: a JSON object containing exactly one {{turn.input}} as a complete string value. The AgentCore default is {“prompt”:”{{turn.input}}”}. An invalid template fails with a ValidationException.

> > > > Constraints:

> > > > * min: `0`
> > > > * max: `10240`

> > > version -> (string)

> > > > The runtime version the endpoint pointed to. For hosted runs, output only and resolved when the run starts. Optional for reported runs.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `128`
> > > > * pattern: `[^\p{C}]+`

> > httpsEndpoint -> (structure)

> > > A URL of the experiment’s HTTPS service.

> > > url -> (string)

> > > > The URL of the service that the run tests. Userinfo and the query string are removed when it is stored.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `2048`

> > > version -> (string)

> > > > The build or release deployed at url.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `128`
> > > > * pattern: `[^\p{C}]+`

> > custom -> (structure)

> > > A label for what was tried, for a custom target.

> > > version -> (string)

> > > > A label for the version that was tried, for example “sonnet-5.5 + prompt-v3”.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `128`
> > > > * pattern: `[^\p{C}]+`

> > > endpoint -> (string)

> > > > A free-form description of where or how the custom target was invoked, for example a URL or a prompt name.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `2048`
> > > > * pattern: `[^\p{C}]+`

> control -> (tagged union structure)

> > What the run is compared against, as given.

> > #### NOTE
> > This is a Tagged Union structure. Only one of the following top level keys can be set: `target`, `runId`, `latestPassed`.

> > target -> (tagged union structure)

> > > A version of the experiment’s target to run alongside the run as a live control. Hosted runs only. Must be the same kind as the experiment’s target (TARGET_MISMATCH); not supported on reported runs (CONTROL_TARGET_UNSUPPORTED).

> > > #### NOTE
> > > This is a Tagged Union structure. Only one of the following top level keys can be set: `agentCoreRuntime`, `httpsEndpoint`, `custom`.

> > > agentCoreRuntime -> (structure)

> > > > An endpoint of the experiment’s AgentCore Runtime.

> > > > endpointArn -> (string) [required]

> > > > > The ARN of the runtime endpoint. Must belong to the experiment’s runtimeArn.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `2048`

> > > > requestTemplate -> (string)

> > > > > The request sent to the agent for each turn, in the AgentCore datasetExecutionConfig format: a JSON object containing exactly one {{turn.input}} as a complete string value. The AgentCore default is {“prompt”:”{{turn.input}}”}. An invalid template fails with a ValidationException.

> > > > > Constraints:

> > > > > * min: `0`
> > > > > * max: `10240`

> > > > version -> (string)

> > > > > The runtime version the endpoint pointed to. For hosted runs, output only and resolved when the run starts. Optional for reported runs.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `128`
> > > > > * pattern: `[^\p{C}]+`

> > > httpsEndpoint -> (structure)

> > > > A URL of the experiment’s HTTPS service.

> > > > url -> (string)

> > > > > The URL of the service that the run tests. Userinfo and the query string are removed when it is stored.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `2048`

> > > > version -> (string)

> > > > > The build or release deployed at url.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `128`
> > > > > * pattern: `[^\p{C}]+`

> > > custom -> (structure)

> > > > A label for what was tried, for a custom target.

> > > > version -> (string)

> > > > > A label for the version that was tried, for example “sonnet-5.5 + prompt-v3”.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `128`
> > > > > * pattern: `[^\p{C}]+`

> > > > endpoint -> (string)

> > > > > A free-form description of where or how the custom target was invoked, for example a URL or a prompt name.

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `2048`
> > > > > * pattern: `[^\p{C}]+`

> > runId -> (string)

> > > The ID of an earlier run of this experiment. The run must be COMPLETED, must not be a CONTROL run, and must match this run: the same dataset at the same dataset version (a run with no version matches only a run with no version), and the same set of evaluator IDs, in any order. Fails with CONTROL_RUN_INVALID otherwise, naming what differs: the dataset version expected and found, or the evaluators the control is missing or has in extra.

> > > Constraints:

> > > * min: `1`
> > > * max: `128`
> > > * pattern: `[a-zA-Z0-9_.-]+`

> > latestPassed -> (structure)

> > > Uses the newest earlier run of this experiment with verdict PASSED that matches this run: the same dataset at the same dataset version (a run with no version matches only a run with no version), and the same set of evaluator IDs, in any order. Resolved when the run starts, with the endpointArn filter when given. Fails with CONTROL_RUN_NOT_FOUND if there is none.

> > > endpointArn -> (string)

> > > > The ARN of an endpoint of the experiment’s AgentCore runtime. Selects only runs whose target is this endpoint (TARGET_MISMATCH otherwise).

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `2048`

> controlRunId -> (string)

> > The ID of the run this run is compared with, resolved when the run starts: either the live control run or the earlier run.

> > Constraints:

> > * min: `1`
> > * max: `128`
> > * pattern: `[a-zA-Z0-9_.-]+`

> role -> (string) [required]

> > The role of the run: TARGET, or CONTROL for a live control run.

> > Possible values:

> > * `TARGET`
> > * `CONTROL`

> targetRunId -> (string)

> > For a CONTROL run, the ID of the run it is the control for.

> > Constraints:

> > * min: `1`
> > * max: `128`
> > * pattern: `[a-zA-Z0-9_.-]+`

> dataset -> (structure)

> > The dataset the run tested.

> > source -> (string) [required]

> > > Where the dataset comes from.

> > > Possible values:

> > > * `AGENTCORE`
> > > * `FILE`
> > > * `OTHER`

> > id -> (string)

> > > The ID of the dataset, from 1 to 256 characters. Required for AGENTCORE datasets. FILE and OTHER datasets require an id or a name (DATASET_ID_REQUIRED).

> > > Constraints:

> > > * min: `1`
> > > * max: `256`
> > > * pattern: `[A-Za-z0-9._:/-]+`

> > name -> (string)

> > > The name of the dataset, from 1 to 256 characters. FILE and OTHER datasets require an id or a name.

> > > Constraints:

> > > * min: `1`
> > > * max: `256`
> > > * pattern: `[^\p{C}]+`

> > version -> (string)

> > > The version of the dataset. For AGENTCORE datasets, a published version number. Required for hosted runs (FIELD_REQUIRED without it), and DRAFT is rejected. Optional and informational for reported runs.

> > > Constraints:

> > > * min: `1`
> > > * max: `128`
> > > * pattern: `[^\p{C}]+`

> > caseCount -> (integer)

> > > The number of cases the run will report. Cases that are never reported count as not run. Output only for hosted runs.

> > > Constraints:

> > > * min: `1`
> > > * max: `100000`

> > contentHash -> (string)

> > > A SHA-256 hash of the dataset’s content, in the form sha256:<64 hex digits>. Output only for hosted runs.

> > > Constraints:

> > > * pattern: `sha256:[0-9a-f]{64}`

> evaluators -> (list)

> > The evaluators the run is scored with, as given to StartExperimentRun for hosted runs or to the creating PutExperimentRunResults call for reported runs.

> > Constraints:

> > * min: `1`
> > * max: `20`

> > (structure)

> > > An evaluator that a run is scored with.

> > > evaluatorId -> (string) [required]

> > > > The ID of the evaluator, unique among the run’s evaluators. The run’s rule and case results refer to the evaluator by this ID.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `256`
> > > > * pattern: `[A-Za-z0-9._:/-]+`

> > > ratingScale -> (string)

> > > > The kind of result the evaluator produces. Must be NUMERIC when the run’s rule has an evaluatorAverage gate on this evaluator. When set, a case criterion’s threshold must match it: minScore or maxScore for NUMERIC, passLabels for CATEGORICAL.

> > > > Possible values:

> > > > * `NUMERIC`
> > > > * `CATEGORICAL`

> > > scoreDirection -> (string)

> > > > Whether a higher or a lower score is better for the evaluator. The default is HIGHER_IS_BETTER. A case criterion and an evaluatorAverage gate on this evaluator must follow it: minScore and min for HIGHER_IS_BETTER, maxScore and max for LOWER_IS_BETTER. When the run is compared with a control, a score that moves the other way counts as a regression. Not valid when ratingScale is CATEGORICAL.

> > > > Possible values:

> > > > * `HIGHER_IS_BETTER`
> > > > * `LOWER_IS_BETTER`

> rule -> (structure)

> > The rule the run is checked against, as given to StartExperimentRun for hosted runs or to the creating PutExperimentRunResults call for reported runs. Absent when the run has no rule, in which case the run has no verdict.

> > source -> (string) [required]

> > > The origin of the rule. Informational only; it does not change how the rule is applied.

> > > Possible values:

> > > * `FILE`
> > > * `INLINE`

> > name -> (string)

> > > The name of the rule, from 1 to 256 characters.

> > > Constraints:

> > > * min: `1`
> > > * max: `256`
> > > * pattern: `[^\p{C}]+`

> > caseCriteria -> (list)

> > > The conditions each case must meet to pass, up to 20. May be empty when the rule gates only on run-level metrics.

> > > Constraints:

> > > * min: `0`
> > > * max: `20`

> > > (tagged union structure)

> > > > A condition a case must meet to pass.

> > > > #### NOTE
> > > > This is a Tagged Union structure. Only one of the following top level keys can be set: `evaluator`.

> > > > evaluator -> (structure)

> > > > > A condition on the case’s result for one of the run’s evaluators.

> > > > > evaluatorId -> (string) [required]

> > > > > > The ID of the evaluator to check. Must be one of the run’s evaluators.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `256`
> > > > > > * pattern: `[A-Za-z0-9._:/-]+`

> > > > > threshold -> (tagged union structure) [required]

> > > > > > The minimum score, the maximum score or the passing labels for the evaluator.

> > > > > > #### NOTE
> > > > > > This is a Tagged Union structure. Only one of the following top level keys can be set: `minScore`, `maxScore`, `passLabels`.

> > > > > > minScore -> (double)

> > > > > > > The minimum passing score, for a numeric evaluator. A finite number from -1e9 to 1e9.

> > > > > > maxScore -> (double)

> > > > > > > The maximum passing score, for a numeric evaluator whose scoreDirection is LOWER_IS_BETTER. A finite number from -1e9 to 1e9.

> > > > > > passLabels -> (list)

> > > > > > > The labels that pass, for a categorical evaluator. From 1 to 16 labels, each up to 256 characters.

> > > > > > > Constraints:

> > > > > > > * min: `1`
> > > > > > > * max: `16`

> > > > > > > (string)

> > > > > > > > An evaluator’s categorical label, derived from model output over customer prompts.

> > > > > > > > Constraints:

> > > > > > > > * min: `1`
> > > > > > > > * max: `256`
> > > > > > > > * pattern: `[^\p{C}]+`

> > gates -> (list) [required]

> > > The run-level checks the run must meet to pass, from 1 to 20.

> > > Constraints:

> > > * min: `1`
> > > * max: `20`

> > > (structure)

> > > > A run-level check, made of a metric and the bound it must meet.

> > > > metric -> (tagged union structure) [required]

> > > > > The metric the gate measures over the run’s cases.

> > > > > #### NOTE
> > > > > This is a Tagged Union structure. Only one of the following top level keys can be set: `passRate`, `notScoredRate`, `evaluatorAverage`, `regressedCases`, `fixedCases`, `regressedScores`, `unpairedCaseRate`.

> > > > > passRate -> (structure)

> > > > > > The share of cases that pass. Higher is better.

> > > > > notScoredRate -> (structure)

> > > > > > The share of cases with no score. Lower is better. When no min or max gate names this metric, a max of 0.05 applies; a vsControl gate on it does not replace that default.

> > > > > evaluatorAverage -> (structure)

> > > > > > The average score of a numeric evaluator. Higher is better, so the gate takes min, unless the evaluator’s scoreDirection is LOWER_IS_BETTER, when it takes max.

> > > > > > evaluatorId -> (string) [required]

> > > > > > > The ID of the evaluator. Must be one of the run’s evaluators.

> > > > > > > Constraints:

> > > > > > > * min: `1`
> > > > > > > * max: `256`
> > > > > > > * pattern: `[A-Za-z0-9._:/-]+`

> > > > > regressedCases -> (structure)

> > > > > > The cases that pass on the control and fail on the target, of the cases both runs have, each judged on both sides by the rule’s criteria on the evaluators both runs have. Lower is better. Requires a control (RULE_CONTROL_REQUIRED).

> > > > > fixedCases -> (structure)

> > > > > > The cases that fail on the control and pass on the target, of the cases both runs have, each judged on both sides by the rule’s criteria on the evaluators both runs have. Higher is better. Requires a control (RULE_CONTROL_REQUIRED).

> > > > > regressedScores -> (structure)

> > > > > > Fails the run when, for any case that both runs scored, on any evaluator that both runs have, the target scored worse than the control: lower, or higher for an evaluator whose scoreDirection is LOWER_IS_BETTER on the target run. Requires a control (RULE_CONTROL_REQUIRED). Takes no bound.

> > > > > unpairedCaseRate -> (structure)

> > > > > > The share of cases that are not judged on both the target and the control. Lower is better. Requires a control (RULE_CONTROL_REQUIRED). Checked only when the rule has a gate on it: comparing with a control adds no gate.

> > > > bound -> (tagged union structure)

> > > > > The bound the metric must meet for the gate to hold. Required for every metric except regressedScores, which takes no bound (RULE_BOUND_INVALID if it has one, FIELD_REQUIRED if another metric has none).

> > > > > #### NOTE
> > > > > This is a Tagged Union structure. Only one of the following top level keys can be set: `min`, `max`, `vsControl`.

> > > > > min -> (double)

> > > > > > The minimum value of the metric. A finite number from 0 to 1 for a rate, or from -1e9 to 1e9 for an evaluator average.

> > > > > max -> (double)

> > > > > > The maximum value of the metric. A finite number from 0 to 1.

> > > > > vsControl -> (structure)

> > > > > > A bound relative to the control’s value of the same metric, both over the cases both runs have: passRate and notScoredRate judged by the rule’s criteria on the evaluators both runs have, evaluatorAverage over the cases both runs scored on it. A check with nothing to compare (an evaluator the control doesn’t have, or no such cases) is skipped and left out of the checks. Not valid on regressedCases, fixedCases, regressedScores or unpairedCaseRate, which already compare with the control (RULE_BOUND_INVALID). Requires a control (RULE_CONTROL_REQUIRED).

> > > > > > minDelta -> (double) [required]

> > > > > > > The least acceptable change, where positive is always better. For example, -0.02 allows at most 0.02 worse, 0 requires no worse, and 0.01 requires at least 0.01 better.

> > > > > > mode -> (string) [required]

> > > > > > > Whether minDelta is an absolute change or a change relative to the control’s value.

> > > > > > > Possible values:

> > > > > > > * `ABSOLUTE`
> > > > > > > * `RATIO`

> > contentHash -> (string)

> > > A SHA-256 hash of the rule’s caseCriteria and gates, in the form sha256:<64 hex digits>. Output only; ignored on input. Member order and explicit default values do not affect the hash; list order does.

> > > Constraints:

> > > * pattern: `sha256:[0-9a-f]{64}`

> metadata -> (map)

> > Key-value facts about what the run tested, as given when the run was created.

> > Constraints:

> > * min: `0`
> > * max: `50`

> > key -> (string)

> > > Constraints:

> > > * min: `1`
> > > * max: `128`
> > > * pattern: `[a-zA-Z0-9_.:/-]+`

> > value -> (string)

> > > A run metadata value. Customer content; never logged.

> > > Constraints:

> > > * min: `0`
> > > * max: `256`
> > > * pattern: `[^\p{C}]*`

> description -> (string)

> > The description of the run, as given to StartExperimentRun for hosted runs or to the creating PutExperimentRunResults call for reported runs. Absent when none was given.

> > Constraints:

> > * min: `0`
> > * max: `1024`
> > * pattern: `[^\p{C}]*`

> traceStats -> (structure)

> > Statistics from the agent’s spans for the run, read after the run ended. Present once collection has started, which happens for a run that ends while its experiment has collectTraceStats enabled. Absent otherwise, including while the run is open.

> > status -> (string) [required]

> > > The status of the stats. PENDING from the end of the run until they are computed, usually a minute or two and up to about 15 minutes while the run’s spans are still arriving.

> > > Possible values:

> > > * `PENDING`
> > > * `AVAILABLE`
> > > * `UNAVAILABLE`

> > statusReason -> (string)

> > > Why the stats are UNAVAILABLE. Absent otherwise.

> > > Possible values:

> > > * `NO_TRACES`
> > > * `SPANS_NOT_FOUND`
> > > * `ACCESS_DENIED`
> > > * `SCAN_LIMIT`
> > > * `QUERY_FAILED`
> > > * `INTERNAL_ERROR`

> > casesRead -> (integer)

> > > The number of cases with a traced turn that were read. All such cases, up to 1,000; beyond that, the 1,000 whose caseId has the smallest SHA-256 hash, or fewer when their turns exceed 10,000 traces.

> > > Constraints:

> > > * min: `0`
> > > * max: `1000`

> > sampled -> (boolean)

> > > Whether the run had more cases with a traced turn than casesRead.

> > casesWithSpans -> (integer)

> > > The number of cases read that had at least one of the agent’s spans. Every value in attributes and metrics is computed over these cases.

> > > Constraints:

> > > * min: `0`
> > > * max: `1000`

> > attributes -> (list)

> > > The values each span attribute took across the cases with spans, up to 20 attributes.

> > > Constraints:

> > > * min: `0`
> > > * max: `20`

> > > (structure)

> > > > The values one span attribute took across the cases with spans.

> > > > name -> (string) [required]

> > > > > The span attribute these values are for.

> > > > > Possible values:

> > > > > * `MODEL`
> > > > > * `TOOL_NAME`
> > > > > * `SYSTEM_INSTRUCTIONS`

> > > > version -> (integer) [required]

> > > > > The version of the attribute’s definition. Two runs’ stats are comparable only at equal versions.

> > > > > Constraints:

> > > > > * min: `1`

> > > > distinct -> (integer) [required]

> > > > > The number of distinct values across the cases.

> > > > > Constraints:

> > > > > * min: `0`

> > > > valuesHash -> (string) [required]

> > > > > A SHA-256 hash of the sorted distinct values, one per line, in the form sha256:<64 hex digits>. Equal sets of values have equal hashes, even when values is truncated.

> > > > > Constraints:

> > > > > * pattern: `sha256:[0-9a-f]{64}`

> > > > values -> (list) [required]

> > > > > The most common values, up to 10, ordered by number of cases (most first) and then by value.

> > > > > Constraints:

> > > > > * min: `0`
> > > > > * max: `10`

> > > > > (structure)

> > > > > > One value of a span attribute and the number of cases it appeared in.

> > > > > > value -> (string) [required]

> > > > > > > The value, as the spans carry it.

> > > > > > > Constraints:

> > > > > > > * min: `1`
> > > > > > > * max: `256`

> > > > > > cases -> (integer) [required]

> > > > > > > The number of cases with spans that had this value.

> > > > > > > Constraints:

> > > > > > > * min: `1`

> > metrics -> (list)

> > > Per-case metrics, with their statistics across the cases with spans, up to 20 metrics.

> > > Constraints:

> > > * min: `0`
> > > * max: `20`

> > > (structure)

> > > > A per-case metric, with its statistics across the cases with spans.

> > > > name -> (string) [required]

> > > > > The metric these statistics are for.

> > > > > Possible values:

> > > > > * `MODEL_CALLS`
> > > > > * `TOOL_CALLS`
> > > > > * `INPUT_TOKENS`
> > > > > * `OUTPUT_TOKENS`
> > > > > * `TURN_LATENCY_MS`
> > > > > * `FAILED`

> > > > version -> (integer) [required]

> > > > > The version of the metric’s definition. Two runs’ stats are comparable only at equal versions.

> > > > > Constraints:

> > > > > * min: `1`

> > > > count -> (integer) [required]

> > > > > The number of cases with spans that had a value. The statistics are computed over these cases.

> > > > > Constraints:

> > > > > * min: `0`

> > > > mean -> (double)

> > > > > The mean across the cases. Absent when count is 0.

> > > > p50 -> (double)

> > > > > The median across the cases. Absent when count is 0.

> > > > p90 -> (double)

> > > > > The 90th percentile across the cases. Absent when count is 0.

> > computedAt -> (timestamp)

> > > The time when the stats were computed.

> batchEvaluation -> (structure)

> > The progress of the hosted run’s batch evaluation. Hosted runs only.

> > batchEvaluationArn -> (string)

> > > The ARN of the AgentCore batch evaluation that runs the hosted run. Absent until AgentCore accepts the start of the hosted run.

> > > Constraints:

> > > * min: `1`
> > > * max: `2048`
> > > * pattern: `arn:aws[a-z-]*:.*`

> > totalSessions -> (integer)

> > > The total number of sessions in the batch evaluation.

> > sessionsCompleted -> (integer)

> > > The number of sessions that have completed.

> > sessionsInProgress -> (integer)

> > > The number of sessions in progress.

> > sessionsFailed -> (integer)

> > > The number of sessions that failed.

> > sessionsIgnored -> (integer)

> > > The number of sessions the batch evaluation ignored.

> summary -> (structure)

> > Case counts and rates for the run. Updated live for reported runs; for hosted runs, filled in when the AgentCore batch evaluation finishes.

> > casesTotal -> (integer)

> > > The total number of cases in the run.

> > casesReported -> (integer)

> > > The number of cases reported so far.

> > casesDone -> (integer)

> > > The number of cases that have reached a final status.

> > passed -> (integer)

> > > The number of cases with status PASSED.

> > failed -> (integer)

> > > The number of cases with status FAILED.

> > completed -> (integer)

> > > The number of cases with status COMPLETED.

> > targetError -> (integer)

> > > The number of cases with status TARGET_ERROR.

> > timedOut -> (integer)

> > > The number of cases with status TIMED_OUT.

> > notScored -> (integer)

> > > The number of cases with status NOT_SCORED.

> > notRun -> (integer)

> > > The number of cases with status NOT_RUN, including cases that were never reported.

> > passRate -> (double)

> > > The share of cases that passed, from 0 to 1. Present only for runs with a rule.

> > notScoredRate -> (double)

> > > The share of cases with no score, from 0 to 1.

> metrics -> (list)

> > Statistics for each of the run’s evaluators.

> > Constraints:

> > * min: `0`
> > * max: `20`

> > (structure)

> > > Statistics for one of the run’s evaluators across the run’s cases.

> > > evaluatorId -> (string) [required]

> > > > The ID of the evaluator.

> > > > Constraints:

> > > > * min: `1`
> > > > * max: `256`
> > > > * pattern: `[A-Za-z0-9._:/-]+`

> > > average -> (double)

> > > > The average score across the scored cases, for a numeric evaluator.

> > > min -> (double)

> > > > The lowest score across the scored cases, for a numeric evaluator.

> > > max -> (double)

> > > > The highest score across the scored cases, for a numeric evaluator.

> > > labelCounts -> (map)

> > > > The number of cases with each label, for a categorical evaluator.

> > > > Constraints:

> > > > * min: `0`
> > > > * max: `17`

> > > > key -> (string)

> > > > > Constraints:

> > > > > * min: `1`
> > > > > * max: `256`
> > > > > * pattern: `[^\p{C}]+`

> > > > value -> (integer)

> > > scoredCount -> (integer)

> > > > The number of cases the evaluator scored.

> > > passedCount -> (integer)

> > > > The number of cases that met the rule’s criterion for this evaluator. Runs with a rule only.

> caseRecordsWritten -> (integer)

> > The number of case records written, across every attempt and revision.

> verdict -> (string)

> > The verdict of the run. Present only for runs with a rule, once the run has ended.

> > Possible values:

> > * `PASSED`
> > * `FAILED`
> > * `DID_NOT_FINISH`

> verdictReasonCode -> (string)

> > The reason for the run’s verdict.

> > Possible values:

> > * `PASSED`
> > * `NOT_SCORED_RATE_ABOVE_MAX`
> > * `PASS_RATE_BELOW_MIN`
> > * `AVERAGE_BELOW_MIN`
> > * `AVERAGE_ABOVE_MAX`
> > * `STOPPED`
> > * `RUNNER_FAILED`
> > * `RESULTS_WRITE_DENIED`
> > * `INTERNAL_ERROR`
> > * `BELOW_CONTROL`
> > * `REGRESSED_CASES_ABOVE_MAX`
> > * `FIXED_CASES_BELOW_MIN`
> > * `UNPAIRED_CASE_RATE_ABOVE_MAX`
> > * `SCORE_REGRESSED`
> > * `CONTROL_DID_NOT_FINISH`
> > * `RESULTS_WRITE_FAILED`

> verdictReason -> (string)

> > A readable explanation of verdictReasonCode, such as “pass rate 82% (required 90%)”.

> > Constraints:

> > * min: `1`
> > * max: `1024`

> checks -> (list)

> > The result of checking each of the rule’s gates.

> > Constraints:

> > * min: `0`
> > * max: `22`

> > (structure)

> > > The result of checking one of the rule’s gates when the run ended.

> > > metric -> (tagged union structure) [required]

> > > > The gate’s metric.

> > > > #### NOTE
> > > > This is a Tagged Union structure. Only one of the following top level keys can be set: `passRate`, `notScoredRate`, `evaluatorAverage`, `regressedCases`, `fixedCases`, `regressedScores`, `unpairedCaseRate`.

> > > > passRate -> (structure)

> > > > > The share of cases that pass. Higher is better.

> > > > notScoredRate -> (structure)

> > > > > The share of cases with no score. Lower is better. When no min or max gate names this metric, a max of 0.05 applies; a vsControl gate on it does not replace that default.

> > > > evaluatorAverage -> (structure)

> > > > > The average score of a numeric evaluator. Higher is better, so the gate takes min, unless the evaluator’s scoreDirection is LOWER_IS_BETTER, when it takes max.

> > > > > evaluatorId -> (string) [required]

> > > > > > The ID of the evaluator. Must be one of the run’s evaluators.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `256`
> > > > > > * pattern: `[A-Za-z0-9._:/-]+`

> > > > regressedCases -> (structure)

> > > > > The cases that pass on the control and fail on the target, of the cases both runs have, each judged on both sides by the rule’s criteria on the evaluators both runs have. Lower is better. Requires a control (RULE_CONTROL_REQUIRED).

> > > > fixedCases -> (structure)

> > > > > The cases that fail on the control and pass on the target, of the cases both runs have, each judged on both sides by the rule’s criteria on the evaluators both runs have. Higher is better. Requires a control (RULE_CONTROL_REQUIRED).

> > > > regressedScores -> (structure)

> > > > > Fails the run when, for any case that both runs scored, on any evaluator that both runs have, the target scored worse than the control: lower, or higher for an evaluator whose scoreDirection is LOWER_IS_BETTER on the target run. Requires a control (RULE_CONTROL_REQUIRED). Takes no bound.

> > > > unpairedCaseRate -> (structure)

> > > > > The share of cases that are not judged on both the target and the control. Lower is better. Requires a control (RULE_CONTROL_REQUIRED). Checked only when the rule has a gate on it: comparing with a control adds no gate.

> > > bound -> (tagged union structure)

> > > > The gate’s bound. Absent for regressedScores, which takes none.

> > > > #### NOTE
> > > > This is a Tagged Union structure. Only one of the following top level keys can be set: `min`, `max`, `vsControl`.

> > > > min -> (double)

> > > > > The minimum value of the metric. A finite number from 0 to 1 for a rate, or from -1e9 to 1e9 for an evaluator average.

> > > > max -> (double)

> > > > > The maximum value of the metric. A finite number from 0 to 1.

> > > > vsControl -> (structure)

> > > > > A bound relative to the control’s value of the same metric, both over the cases both runs have: passRate and notScoredRate judged by the rule’s criteria on the evaluators both runs have, evaluatorAverage over the cases both runs scored on it. A check with nothing to compare (an evaluator the control doesn’t have, or no such cases) is skipped and left out of the checks. Not valid on regressedCases, fixedCases, regressedScores or unpairedCaseRate, which already compare with the control (RULE_BOUND_INVALID). Requires a control (RULE_CONTROL_REQUIRED).

> > > > > minDelta -> (double) [required]

> > > > > > The least acceptable change, where positive is always better. For example, -0.02 allows at most 0.02 worse, 0 requires no worse, and 0.01 requires at least 0.01 better.

> > > > > mode -> (string) [required]

> > > > > > Whether minDelta is an absolute change or a change relative to the control’s value.

> > > > > > Possible values:

> > > > > > * `ABSOLUTE`
> > > > > > * `RATIO`

> > > observed -> (double)

> > > > The metric’s value for this run.

> > > controlObserved -> (double)

> > > > The control’s value of the metric. Present for vsControl checks.

> > > delta -> (double)

> > > > The change from the control, in the bound’s mode, signed so that positive is better. Absent when the change is not finite, such as in RATIO mode against a control value of 0.

> > > passed -> (boolean) [required]

> > > > Whether the gate held.

> > > decisive -> (boolean) [required]

> > > > Whether this check decided a FAILED verdict.

> > > observedByEvaluator -> (list)

> > > > The regressed scores for each evaluator: one entry for each evaluator both runs have on which the target scored at least one case worse than the control. Present only on a regressedScores check, where it’s empty when nothing regressed.

> > > > Constraints:

> > > > * min: `0`
> > > > * max: `20`

> > > > (structure)

> > > > > A check’s count for one evaluator.

> > > > > evaluatorId -> (string) [required]

> > > > > > The ID of the evaluator.

> > > > > > Constraints:

> > > > > > * min: `1`
> > > > > > * max: `256`
> > > > > > * pattern: `[A-Za-z0-9._:/-]+`

> > > > > count -> (integer) [required]

> > > > > > For regressedScores, the number of cases the target scored worse than the control on this evaluator.

> createdAt -> (timestamp) [required]

> > The time when the run was created.

> startedAt -> (timestamp)

> > The time when the run started. For reported runs, the declared run.startedAt, or createdAt if none was declared. For hosted runs, the time when the batch evaluation was created.

> completedAt -> (timestamp)

> > The time when the run ended.

> updatedAt -> (timestamp) [required]

> > The time when the run was last updated.
