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

# GitGuardian

> Connect GitGuardian so agents can triage secret incidents, trace exposed credentials to their sources, and check honeytokens

Connect a GitGuardian workspace to let CloudThinker agents list and triage secret incidents, trace each exposed credential to its sources and occurrences, and review honeytokens. The connection signs in with a GitGuardian **Personal Access Token (PAT)** plus your dashboard URL, so the same setup works for the US, EU, and self-hosted instances.

## Prerequisites

* A GitGuardian workspace that holds the incidents you want agents to read.
* Permission to create a Personal Access Token in that workspace.
* The **Admin** role in your CloudThinker workspace, which can add and edit connections. See [Roles](https://docs.cloudthinker.io/guide/security/roles.md).
* Your dashboard URL. Use the address you sign in at:

| Instance | GitGuardian URL |
| - | - |
| US (SaaS) | `https://dashboard.gitguardian.com` |
| EU (SaaS) | `https://dashboard.eu1.gitguardian.com` |
| Self-hosted | Your instance URL, for example `https://gitguardian.example.com` |

## Setup

**1. Create a Personal Access Token**

Sign in to GitGuardian. In the sidebar, open **Settings → API → Personal Access Tokens** and click **Create token**:

* **Name**: `cloudthinker`
* **Expiration**: pick a date that matches your rotation policy
* **Scopes**: tick the read variant of `incidents`, `secrets`, and `sources` (for example `incidents:read`). That covers the verify and example prompts. Add others from [Required permissions](#required-permissions) only if you need them.

Copy the token right away. GitGuardian shows it once.

**2. Add the connection in CloudThinker**

In the sidebar, click **More → Workspace settings → Connections**, stay on the **Builtin Connections** tab, and select **GitGuardian**. Fill in:

* **GITGUARDIAN\_URL**: your dashboard or instance URL from the table above
* **GITGUARDIAN\_PERSONAL\_ACCESS\_TOKEN**: the token you just created

Click **Connect**.

**Success state:** GitGuardian shows **Connected** in the Connections list. Then open a new chat and send the [verify prompt](#verify-the-connection) to confirm the token's scopes.

> [!WARNING]
>
> If you lose the token, you can't view it again. Create a new one in GitGuardian and paste it into the connection.

## Connection details

| Field | Description | Example |
| - | - | - |
| **GITGUARDIAN\_URL** | Dashboard or self-hosted instance URL. CloudThinker works out the API endpoint from it. | `https://dashboard.eu1.gitguardian.com` |
| **GITGUARDIAN\_PERSONAL\_ACCESS\_TOKEN** | Personal Access Token from the workspace | `<your-token>` |

To reach a second GitGuardian workspace, add it as a separate connection with its own token.

## Required permissions

Each PAT scope unlocks one family of agent capabilities. Where GitGuardian offers a `:read` and a `:write` variant, pick `:read`. If an agent says it can't do something, the token is usually missing that scope.

| Scope | Enables |
| - | - |
| `incidents` | List, inspect, and triage secret incidents. Minimum set. |
| `secrets` | Read detected secrets and where each one occurs. Minimum set. |
| `sources` | List and inspect the monitored sources (repositories). Minimum set. |
| `scan` | Scan content for secrets on request |
| `honeytokens` | Read to list honeytokens. Write to create them. |
| `custom_tags` | Read and manage custom tags |
| `audit_logs` | Read the workspace audit log |

> [!TIP]
>
> A PAT also inherits the workspace role of the person who creates it. Create it from the least-privileged member who still has the access you need, and pick read access whenever a scope offers it.

## Agent capabilities

| Capability | What agents can do | Scope needed | Approval |
| - | - | - | - |
| **Incident triage** | List and inspect secret incidents with their status and severity | `incidents` | No |
| **Incident investigation** | Show the sources and occurrences behind an exposed credential | `incidents`, `secrets`, `sources` | No |
| **Token inspection** | Report the scopes the connected token carries | Any | No |
| **Honeytokens** | List honeytokens and their status | `honeytokens` read | No |
| **Honeytoken creation** | Create a new honeytoken | `honeytokens` write | Through Approvals |

Reads run without asking. Creating a honeytoken needs `honeytokens:write` and a token created by a **Manager**, and it only happens when you ask for it.

Every change an agent makes goes through your workspace's [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md) first. On the default **Auto · Rules + AI · Ask me** mode, AI judgment can let a safe change run without asking — and an Allow Rule can too, once CloudThinker turns on [Rule enforcement](https://docs.cloudthinker.io/guide/approvals/rules.md#troubleshooting) for your workspace. Choose **Manual** to approve every change yourself.

To be asked before every honeytoken is created, choose **Manual**. Once CloudThinker turns on [Rule enforcement](https://docs.cloudthinker.io/guide/approvals/rules.md#troubleshooting) for your workspace, an **Ask first** [Rule](https://docs.cloudthinker.io/guide/approvals/rules.md) can single out honeytoken creation.

### Verify the connection

```text theme={null}
Check the GitGuardian connection, list the scopes on the token, and count open secret incidents
```

Expect the list of scopes on the token and a count of open incidents, meaning incidents in **Triggered** or **Assigned** status. A scope you expected but don't see means the token needs updating.

### Example prompts

```text theme={null}
List open GitGuardian incidents sorted by severity, with the repository for each one
Investigate the newest GitGuardian incident and summarize the exposed credential and its sources
```

## Troubleshooting

> [accordion] Connect fails or requests return 401
>
> The token is wrong, expired, or revoked. Create a new Personal Access Token. In **More → Workspace settings → Connections**, open **GitGuardian**, click the pencil icon on the connection's row, click **Replace…**, paste the token into **GITGUARDIAN\_PERSONAL\_ACCESS\_TOKEN**, and click **Save and test**.

> [accordion] Requests return 403
>
> The token lacks the scope for that request, or its creator's workspace role is too low. Add the scope in GitGuardian (honeytoken creation needs **Manager**), then update the connection with the new token.

> [accordion] An agent says a capability isn't available
>
> The token is missing the matching scope. Compare the request against [Required permissions](#required-permissions), create a token with that scope, and update the connection.

> [accordion] No incidents, or the endpoint can't be reached
>
> **GITGUARDIAN\_URL** points at the wrong region or instance. A US token doesn't work against the EU dashboard. Use the exact address you sign in at.

## Security

* **Least privilege** — grant only the permissions the agents need for your use case; start read-only and widen later.
* **Read-only by default** — use read-only credentials unless you want agents to make changes through this connection.
* **Rotate credentials** — rotate keys and tokens on your normal schedule; CloudThinker picks up the new value when you update the connection.
* **Revoke on offboarding** — remove the credential at the provider when you delete a connection or a teammate leaves.

- **Read scopes first**: add `honeytokens:write` or a Manager-role token only if you want agents to create honeytokens.
- **Dedicated token**: name it `cloudthinker` so you can revoke it in GitGuardian without breaking other tools.

## Related

> [card] [Semgrep Connection](https://docs.cloudthinker.io/guide/connections/semgrep.md)
>
> Scan files and read your Semgrep code findings.

> [card] [Approvals](https://docs.cloudthinker.io/guide/approvals/overview.md)
>
> Control which GitGuardian changes wait for a person.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.