> 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/harness-ai/untitled-1/use-harness-ai/use-cases/ci-agent.md).

# Troubleshoot builds and deployments with Harness AI

[Harness AI](https://harness.io/products/harness-ai) analyzes log files and correlates error messages with known issues. This feature enables developers to troubleshoot and resolve deployment failures quickly, saving them from sifting through millions of log lines. Harness AI also suggests fixes and predicts potential errors in the code before the build is initiated. This feature works across Harness CI and CD modules.

{% embed url="<https://www.youtube.com/watch?v=b-l0Ig4HHBQ>" %}

***

## What you will learn in this topic

By the end of this topic, you will be able to:

* [Enable Harness AI for CI in your account](#get-started-with-harness-ai-for-ci).
* [Use Harness AI to analyze and troubleshoot build and deployment failures](#get-started-with-harness-ai-for-ci).

***

## Before you begin

Before you troubleshoot builds and deployments with Harness AI, ensure you have the following:

* **Harness account access**: Access to your Harness account with permissions to view pipelines and enable account settings.
* **CI or CD module access**: Access to the Continuous Integration (CI) or Continuous Deployment (CD) module where you want to use AI-driven error analysis.
* **Failed pipeline execution**: At least one pipeline execution with a failed step or stage to analyze (optional for initial setup, required to test AI troubleshooting).

***

## Get started with Harness AI for CI

To enable Harness AI for CI in your Harness account, perform the following steps:

1. Navigate to **Account Settings**.
2. Select **Default Settings**.
3. Expand the **Harness AI** section.
4. Enable the **Harness AI** setting.
5. Click **Save**.

After enabling Harness AI, AI-driven error analysis and remediation become available when a step fails or when an empty stage (a stage with no steps) encounters a failure.

When viewing the logs for the failed step or stage, select the **Harness AI** dialog to review error analysis and troubleshooting suggestions.

![An example of Harness AI dialog.](/files/YPXkNTlyO3yzYAvuwJHb)

Step logs are available on the [Build details](/continuous-integration/use-harness-ci/use-harness-ci/viewing-builds.md) page.

***

## Next steps

* [View builds](/continuous-integration/use-harness-ci/use-harness-ci/viewing-builds.md): Access build logs and execution details.
* [Harness AI overview](https://developer.harness.io/docs/platform/harness-ai/overview): AI capabilities across Harness modules.
* [Harness AI Terms](https://www.harness.io/legal/aida-terms): Legal terms.
* [Harness AI Data Privacy](https://www.harness.io/legal/harness-ai-data-privacy): Data privacy policies.
