> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sureops.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# ArgoCD

> Connect ArgoCD for GitOps deployment context and rollback actions during resolution

The ArgoCD integration gives sureops agents read access to your ArgoCD applications for deployment state and history — and, with approval, the ability to trigger rollbacks as part of the resolution stage.

***

## What this integration enables

* **Deployment context** — agents can read current application sync status, recent deployment history, and which image tags are deployed per service
* **Change correlation** — agents cross-reference recent ArgoCD sync events with incident timing during diagnosis to identify deployment-correlated failures
* **Rollback actions** — with explicit HITL approval, the resolution specialist can trigger an ArgoCD rollback to the previous healthy revision (always gated by Human-in-the-Loop, regardless of control mode)

***

## Prerequisites

* A running ArgoCD instance
* Admin access to ArgoCD to generate an API token

***

## Setup

<Steps>
  <Step title="Generate an API Token">
    In ArgoCD, go to **Settings → Accounts** and generate a new API token for a service account.

    The token needs read access to applications and, if you want rollback support, the ability to sync/rollback applications. Scope the token to the minimum permissions your policy allows.
  </Step>

  <Step title="Enter credentials">
    In sureops, go to **Settings → Integrations** and click **Connect** next to ArgoCD.

    Fill in:

    * **API Token** — the token generated in step 1
    * **ArgoCD Server URL** — the base URL of your ArgoCD instance (e.g. `https://argocd.company.com`)

    Click **Verify connection** to confirm sureops can reach ArgoCD with the provided credentials.
  </Step>
</Steps>

***

## Required credentials

| Field             | Required | Description                                                           |
| ----------------- | -------- | --------------------------------------------------------------------- |
| API Token         | Yes      | ArgoCD API token with read (and optionally sync/rollback) permissions |
| ArgoCD Server URL | Yes      | Base URL of your ArgoCD instance (e.g. `https://argocd.company.com`)  |

***

## Customer-hosted option

If your ArgoCD instance is inside your private network and not accessible from sureops directly, use the customer-hosted MCP mode instead of entering credentials directly.

| Field               | Required | Description                                                |
| ------------------- | -------- | ---------------------------------------------------------- |
| MCP Server Endpoint | Yes      | URL of your customer-hosted ArgoCD MCP server              |
| Connection Token    | Yes      | Bearer token for authenticating sureops to your MCP server |

***

## Common errors

| Error                   | Fix                                                                                                                                                                            |
| ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| "401 Unauthorized"      | The API token is incorrect, expired, or the ArgoCD service account it belongs to has been removed. Regenerate the token in ArgoCD → Settings → Accounts.                       |
| "Connection refused"    | ArgoCD is not reachable from sureops at the provided URL. Check that the URL is correct and that the ArgoCD API port (typically 443 or 8080) is accessible.                    |
| "Application not found" | The agent referenced an application that doesn't exist in this ArgoCD instance. Verify that your services' ArgoCD application names match the service names in your landscape. |

***

## Official documentation

* [ArgoCD documentation](https://argo-cd.readthedocs.io/en/stable/)
* [ArgoCD API token management](https://argo-cd.readthedocs.io/en/stable/user-guide/projects/)
