The steps on this page are identical for GitLab Cloud and self-hosted GitLab. Substitute your own GitLab base URL where applicable.
Choose an access token type
CodeAnt AI supports three kinds of tokens. Pick whichever fits your organization best.Personal access token
Issued from your own GitLab user. Fastest to set up, but reviews are attributed to you and access breaks if you leave the org.
Service-account PAT
Recommended. A PAT from a dedicated bot user like
codeant-ai-bot. Clean attribution, easy to rotate, works on every GitLab tier.Group access token
Scoped to a single GitLab group and auto-creates a bot user. Requires GitLab Premium or Ultimate.
Best practices for the service account
If you go with a service account, set it up like a real user before generating the token:- Create a new GitLab user with a name like
CodeAnt AIand a dedicated email address. - Add the service account to your group with Maintainer role on the projects you want reviewed.
- Generate the personal access token from inside the service-account session.
Generate the access token
- Personal / service-account PAT
- Group access token
Sign in as the user (your own account or the service account) and go to:User settings → Access tokens → Add new tokenFill in the details:
Click Create personal access token and copy the value before closing the page; GitLab won’t show it again.
| Field | Value |
|---|---|
| Token name | CodeAnt AI |
| Expiry date | Ideally 1 year |
| Scopes | api, write_repository |
Save the token in CodeAnt AI
- Sign in to app.codeant.ai with GitLab.
- Open Settings → Configure Token.
- Click Configure token (or Reconfigure if you’re replacing an existing one) and paste the access token you generated above.
- Click Save & Configure Webhooks. CodeAnt AI scans your projects, lists the ones missing webhooks, and lets you select which to install — no manual webhook setup in GitLab is required for the default per-project flow.
Rotating or replacing the token
When the token is close to expiring, or you need to revoke access:- Generate a new token in GitLab using the steps above.
- In CodeAnt AI, open Settings → Configure Token and click Reconfigure.
- Paste the new token and save. The old token can now be revoked in GitLab.