Skip to main content

GitLab Integration

Connect GitLab to enable agents to access code, merge requests, and CI/CD pipeline information during investigations and remediation runs.

Used by: Incident Response, Vulnerability Remediation, AI Coding Cost Efficiency, and custom agents.

Capabilities​

Once connected, agents can:

CapabilityDescription
Browse CodeView repository files
Merge RequestsReview MRs and changes
PipelinesCheck CI/CD pipeline status
CommitsView commit history
IssuesAccess issue tracking
note

This integration has write tools: create branches, commit file changes, open and merge merge requests, and create repositories. These tools are available only to agents granted write access to it. They also need a token with the api scope. A governance policy on write operations pauses each write for a person to approve. Every call is recorded in the Audit Trail.

Prerequisites​

  • A GitLab account (Cloud or self-hosted)
  • A Personal Access Token
  • Read access to relevant projects

Setup​

1
Create a Personal Access Token
  1. Go to GitLab User Settings → Access Tokens
  2. Enter a token name (e.g., "Autoheal Integration")
  3. Set an expiration date
  4. Select scopes: read_api, read_repository
  5. Create the token. Then copy it
2
Add Integration in Autoheal
  1. Go to Integrations in Autoheal
  2. Click GitLab
  3. Enter a name (e.g., "Production GitLab")
3
Configure Credentials

Enter the following:

  • Token: Your GitLab Personal Access Token
  • URL: GitLab URL (default: https://gitlab.com)
4
Test and Save

Click Test Connection to check the connection. Then click Save.

Required Scopes​

ScopeWhy It's Needed
read_apiAccess GitLab API endpoints
read_repositoryView repository contents

Self-Hosted GitLab​

For self-hosted GitLab instances:

https://gitlab.your-company.com

Ensure the URL is accessible from Autoheal.

Example Queries​

What pipelines failed in the last 24 hours?
Show me the latest merge requests for the backend project
What commits were deployed yesterday?

Troubleshooting​

401 Unauthorized
  • Check that the token is correct and not expired
  • Check that required scopes are granted
Connection Failed (Self-Hosted)
  • Check that the GitLab URL is correct
  • Check network/firewall accessibility