> For the complete documentation index, see [llms.txt](https://developer.harness.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.harness.io/resilience-testing/load-testing/analyze-results/ai-insights.md).

# AI Insights

Read the AI Insights card on a load test run, understand what the analysis reads and how it is generated, and generate insights for an older run in Harness Resilience Testing

**AI Insights** is a short performance analysis that Harness writes for a load test run after it ends. It sits at the top of the **Run detail** page and tells you, in a few lines, what the run showed: the most important number, what stood out, what to do next, and what the run could not answer. Use it to decide where to look first, then confirm in the charts and tables below it.

{% hint style="info" %}
**LOAD TESTING IS BEHIND A FEATURE FLAG**

Load Testing is behind a feature flag (`CHAOS_LOAD_TESTING_ENABLED`). Contact [Harness Support](mailto:support@harness.io) to enable it.
{% endhint %}

## What you will learn from this topic <a href="#what-you-will-learn-from-this-topic" id="what-you-will-learn-from-this-topic"></a>

* What each part of the **AI Insights** card means.
* What the analysis reads, and how it judges small runs and comparisons with earlier runs.
* When insights are generated, and how to generate them for a run that has none.
* What each state of the card means and what to do about it.

***

## Before you begin <a href="#before-you-begin" id="before-you-begin"></a>

* **Load Testing enabled:** Your account has the `CHAOS_LOAD_TESTING_ENABLED` feature flag.
* **AI features enabled:** Your account has the `CHAOS_AI_RECOMMENDATION_DEV` feature flag, and Harness AI is turned on for the account. When either is off, the **Run detail** page and the run report leave the **AI Insights** card out.
* **A finished run:** Insights describe a run that has ended with **Finished**, **Stopped**, or **Failed** status. Go to [Get started with load testing](https://developer.harness.io/resilience-testing/load-testing/get-started.md) to create and run a load test.

***

## Read the card <a href="#read-the-card" id="read-the-card"></a>

Open a run from **Resilience Testing** > **Load Tests** > **Executions**. The **AI Insights** card is the first section in the main panel, above **Summary**.

![The AI Insights card for a five-user run, showing the headline, a two-sentence summary, two findings under What stood out with their risk, recommendation, and evidence, three items under What to do next, one item under What this could not tell you, and the disclaimer](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-c21e8cc4a99ebba93b627d81020cdf18a93767ca%2Fload-test-ai-insights-card.png?alt=media)

The card reads top to bottom.

| Part                             | What it tells you                                                                                                                                                                                                                                                                                                                                                                                 |
| -------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| **Headline**                     | The single most important result of the run, with its number, such as `18 errors occurred at peak load of 5 users, with 3.67% error rate.`                                                                                                                                                                                                                                                        |
| **Summary**                      | At most two sentences on what ran, how it held up, and what it means.                                                                                                                                                                                                                                                                                                                             |
| **What stood out**               | Up to five findings, most serious first. The dot and title color give the severity: red for critical, orange for a warning, and grey for information. Each finding has a **Risk** (what it costs if left alone), a **Recommendation** (the fix for that risk), and a line of evidence in small grey text with the numbers behind it. Critical and warning findings always carry a recommendation. |
| **What to do next**              | One to four next steps for the test itself, such as the larger or longer run that would answer a question this one could not.                                                                                                                                                                                                                                                                     |
| **What this could not tell you** | Up to three caveats, such as an unknown intended load, a run too small to judge capacity, or no earlier run to compare against.                                                                                                                                                                                                                                                                   |

The card closes with `Generated from this run's recorded metrics. Review the charts below before acting on it.` Select the chevron next to **AI Insights** to collapse the card to its headline and summary.

{% hint style="warning" %}
**CONFIRM A FINDING BEFORE YOU ACT ON IT**

The analysis is generated by a language model from the run's recorded metric samples. It is told to state only numbers it was given, but it can still misstate a figure or draw a conclusion that the data does not support. Check the **Summary** cards, **Thresholds**, **Charts**, and **Endpoint Statistics** before you change a release decision.
{% endhint %}

***

## What the analysis reads <a href="#what-the-analysis-reads" id="what-the-analysis-reads"></a>

Harness builds a digest of the run and sends it to the model. The digest holds:

* **The run:** the load that was requested and the peak load that was reached, throughput, duration, and how the run ended.
* **A timeline:** samples across the run for users, throughput, latency, and errors, so the analysis can describe trends, not only final values.
* **Errors:** the error rate and its pattern, that is, whether failures grew as the run went on, appeared as a brief spike, or held at a steady rate.
* **Run incidents:** errors recorded against the run itself, with the phase in which they happened. A setup-phase incident, such as a bad target URL or an invalid script, means the test never properly exercised the system, and the card says so. An infrastructure incident, such as an evicted worker pod, is attributed to the load generator rather than the system under test.
* **Endpoints:** per-endpoint totals, worst first, including any endpoint that broke a configured limit on its own.
* **Checks:** for a JavaScript (k6) run, each named check with its passes and failures.
* **Thresholds:** each configured threshold, what the run measured, and the headroom left before it would breach.
* **Saturation:** the load level at which throughput stopped scaling while latency kept rising, for the whole run and per endpoint, when one was detected.
* **A comparison with earlier runs:** described in [Comparison with earlier runs](#comparison-with-earlier-runs).

The digest is built from the run's metrics and run record. It does not include your script, the console logs, or response bodies. It does include the test name, endpoint and check names, and the messages of errors recorded against the run.

### Small runs <a href="#small-runs" id="small-runs"></a>

Harness treats a run as validation scale, rather than a capacity test, when it peaked at five users or fewer, ran for less than two minutes, or sent fewer than 500 requests. When a validation-scale run completes cleanly, the card reports that the script and target work end to end, adds a caveat that the run does not show behavior under real load, and suggests a larger or longer run. It does not call the system production-ready on that evidence. A small run that failed, stopped on a threshold, or hit a setup problem is reported the same way as a full-size run.

### Comparison with earlier runs <a href="#comparison-with-earlier-runs" id="comparison-with-earlier-runs"></a>

When earlier runs are comparable, the card can report whether latency, throughput, or errors are drifting. Harness compares the run with the average of up to five recent runs of the same load test that ended with **Finished** status, used the same Load Test Engine, and targeted a load within 20% of this run. A metric counts as a trend only when it moved by 10% or more, or by one percentage point or more for the error rate. When no earlier run is comparable, the card describes nothing as a regression and may list the missing baseline under **What this could not tell you**.

{% hint style="info" %}
**RUN THE SAME TEST AT THE SAME LOAD TO BUILD A BASELINE**

Changing the user count by more than 20%, or switching the engine, starts a new baseline. Keep the load steady across runs you want to compare.
{% endhint %}

***

## When insights are generated <a href="#when-insights-are-generated" id="when-insights-are-generated"></a>

Harness starts the analysis automatically when a run ends with **Finished**, **Stopped**, or **Failed** status. While it runs, the card shows `Analysing your data to generate some insights.` The analysis can take up to two minutes. Leave the page open and the card updates when the analysis is ready.

The analysis needs at least two metric samples. A run that recorded fewer, for example one that failed before it generated any load, is skipped.

Each run is analyzed once. When an analysis is ready, Harness keeps it and does not generate a new one for that run. To see insights for a changed test, run it again.

***

## Generate insights for a run <a href="#generate-insights-for-a-run" id="generate-insights-for-a-run"></a>

A run that ended before AI Insights was available, or while AI features were turned off, has no analysis. Its card shows a **Generate insights** button.

![The AI Insights card for an older run, with the Generate insights button](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-82adce9d76ffdc1e023604cd1be422ade59a1445%2Fload-test-ai-insights-generate.png?alt=media)

Select **Generate insights**. The card switches to `Analysing your data to generate some insights.` and shows the analysis when it is ready. You can generate insights only for a run that has ended. A run that already has an analysis, or one that is still being analyzed, does not offer the button.

***

## Card states <a href="#card-states" id="card-states"></a>

| What the card shows                                                                      | What it means                                                                                       | What to do                                                                                                         |
| ---------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------ |
| A headline, a summary, and sections                                                      | The analysis is ready.                                                                              | Read it, then confirm it in the charts below.                                                                      |
| `Analysing your data to generate some insights.`                                         | The analysis is in progress.                                                                        | Wait. The card updates on its own.                                                                                 |
| **Generate insights**                                                                    | The run has no analysis, usually because it predates the feature or ran while AI features were off. | Select **Generate insights**.                                                                                      |
| `There is not enough data to generate insights for this run.` with **Generate insights** | The run recorded too few metric samples, so the automatic analysis was skipped.                     | Select **Generate insights** to try again. If the run produced little load, fix the test and run it again instead. |
| `There is not enough data to generate insights for this run.` with no button             | The run recorded no metrics at all.                                                                 | Open the run logs to find why it produced no load.                                                                 |
| `AI insights could not be generated for this run.` with **Retry**                        | The analysis failed.                                                                                | Select **Retry**.                                                                                                  |
| `AI Insights could not be loaded for this run.` with **Retry**                           | The page could not fetch the analysis.                                                              | Select **Retry**, or reload the page.                                                                              |
| No **AI Insights** card                                                                  | AI features are off for the account, or you do not have access to the insights.                     | Go to [Before you begin](#before-you-begin) to check the requirements.                                             |

A run that failed before generating load shows the empty state with no button.

![The AI Insights card for a run that recorded no metrics, reading There is not enough data to generate insights for this run.](https://3217710372-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FRmV5EkLS9r45VPaoUnJZ%2Fuploads%2Fgit-blob-8f47e6d1adf2271ea1ead91f04f07eed7e34f60b%2Fload-test-ai-insights-no-data.png?alt=media)

***

## Troubleshooting <a href="#troubleshooting" id="troubleshooting"></a>

<details>

<summary>The card stays on Analysing your data for more than a few minutes</summary>

The analysis has a two-minute limit. Reload the page. If the card still shows the same message after the limit has passed, contact [Harness Support](mailto:support@harness.io) with the run ID shown under the run name.

</details>

<details>

<summary>The card reports a different number than the Summary cards</summary>

The card is written by a language model, which can misstate a figure. Treat the **Summary** cards, **Thresholds**, and **Endpoint Statistics** as the source of truth.

</details>

<details>

<summary>The card says the run was at validation scale</summary>

The run peaked at five users or fewer, ran for less than two minutes, or sent fewer than 500 requests. Increase the users or the duration in the **Load Test Studio** and run the test again to get a capacity answer.

</details>

<details>

<summary>The card never mentions a trend against earlier runs</summary>

No earlier run is comparable. Harness compares only with runs of the same test that ended with **Finished** status, used the same engine, and targeted a load within 20% of this run. Run the test a few times at the same load to build a baseline.

</details>

<details>

<summary>There is no AI Insights card on the run</summary>

Check that your account has the `CHAOS_AI_RECOMMENDATION_DEV` feature flag and that Harness AI is turned on for the account. Contact [Harness Support](mailto:support@harness.io) to enable the feature flag.

</details>

***

## Next steps <a href="#next-steps" id="next-steps"></a>

* Go to [Analyze load test results](https://developer.harness.io/resilience-testing/load-testing/analyze-results.md) to read the charts, thresholds, and endpoint statistics that the card summarizes.
* Go to [JavaScript](https://developer.harness.io/resilience-testing/load-testing/create-a-load-test/k6.md#gate-a-release-with-passfail-thresholds) to declare thresholds, so the card can report the headroom left before each one breaches.
* Go to [Load testing key concepts](https://developer.harness.io/resilience-testing/load-testing/key-concepts.md) to review virtual users, load profiles, and thresholds.

{% @harness-feedback/feedback %}
