Docs
Integrations

GitLab

Connect repositories and manage GitLab integrations

We recommend enabling branch protection rules on your default branch in your GitLab project settings. This ensures agent-created merge requests go through code review before merging.

Overview

coSPEC supports both gitlab.com and self-hosted GitLab instances. Once connected, the agent can clone repositories, create branches, open merge requests, and file issues — just like with GitHub.

We recommend creating a dedicated GitLab user (e.g. cospec-bot) for the integration rather than using a personal account. This:

  • Keeps agent activity clearly attributed
  • Avoids permission issues when team members leave
  • Makes it easy to audit agent actions

Connecting gitlab.com

In the dashboard, go to Integrations → GitLab and click Connect Account.

You'll be redirected to GitLab's authorization page (OAuth with PKCE). Grant access to the repositories you want coSPEC to work with. The integration can access repositories where you have Developer-level access or higher.

Connecting Self-Hosted GitLab

In the dashboard, go to Integrations → GitLab and select Self-hosted instance.

  1. Enter your GitLab instance URL (e.g. https://gitlab.company.com)
  2. Create a Personal Access Token:
    1. Create a dedicated user (e.g. cospec-bot) via Admin Area → Users → New User
    2. Grant the user Developer role on the projects you want to use
    3. Sign in as the bot user, go to Preferences → Access Tokens → Add new token
    4. Select scopes: api, read_user
    5. Set an expiration date
    6. Copy the token
  3. Paste the token and click Connect

Firewall & IP Whitelisting

Your GitLab instance must be reachable from coSPEC infrastructure so that sandboxes can clone repositories, push branches, and create merge requests.

If your instance is behind a firewall or restricts access by IP, whitelist coSPEC's static egress IP. Contact support for the current IP address.

The self-hosted GitLab domain is automatically added to the sandbox's egress allowlist for every run that uses a repository from that instance.

Repository Cloning

When a run starts, the repository is cloned into the sandbox. The default branch is used unless a specific branch is specified in the run configuration.

Merge Requests and Issues

During a run, the agent can create branches, open merge requests, and file issues on your repository. These outputs are detected automatically based on what the agent does — see Runs — Outputs.

Managing Installations

View your connected GitLab accounts in Integrations → GitLab.

You can connect multiple accounts simultaneously — for example, a gitlab.com account and one or more self-hosted instances. Each account can be disconnected individually.

Other Git Providers

Looking for GitHub? See the GitHub Integration guide.

On this page