Code Review Flow
- Tier: Premium, Ultimate
- Offering: GitLab.com, GitLab Self-Managed
Depending on your add-on, you might have access to GitLab Duo Code Review (Classic) instead. Learn how the two features compare.
The Code Review Flow helps you streamline code reviews with agentic AI.
This flow:
- Analyzes code changes, merge request comments, and linked issues.
- Provides enhanced contextual understanding of repository structure and cross-file dependencies.
- Delivers detailed review comments with actionable feedback.
- Supports custom review instructions tailored to your project.
This flow is available in the GitLab UI only.
Use the flow
Prerequisites:
- Ensure you meet the Agent Platform prerequisites.
- Ensure that Allow foundational flows and Code Review are turned on for the top-level group.
To use the Code Review Flow on a merge request:
- On the left sidebar, select Code > Merge requests and find your merge request.
- Use one of these methods to request a review:
- Assign
@GitLabDuoas a reviewer. - In a comment box, enter the quick action
/assign_reviewer @GitLabDuo.
- Assign
After you request a review, Code Review Flow starts a session that you can monitor until the review is complete.
Interact with GitLab Duo in reviews
In addition to assigning GitLab Duo as a reviewer, you can interact with GitLab Duo by:
- Replying to its review comments to ask for clarification or alternative approaches.
- Mentioning
@GitLabDuoin any discussion thread to ask follow-up questions.
Interactions with GitLab Duo can help to improve the suggestions and feedback as you work to improve your merge request.
Feedback provided to GitLab Duo does not influence later reviews of other merge requests. There is a feature request to add this functionality, see issue 560116.
Custom code review instructions
Customize the behavior of Code Review Flow with repository-specific review instructions. You can guide GitLab Duo to:
- Focus on specific code quality aspects (such as security, performance, and maintainability).
- Enforce coding standards and best practices unique to your project.
- Target specific file patterns with tailored review criteria.
- Provide more detailed explanations for certain types of changes.
To configure custom instructions, see customize instructions for GitLab Duo.
Automatic reviews from GitLab Duo for a project
Automatic reviews from GitLab Duo ensure that all merge requests in your project receive an initial review. After a merge request is created, GitLab Duo reviews it unless:
- It’s marked as draft. For GitLab Duo to review the merge request, mark it ready.
- It contains no changes. For GitLab Duo to review the merge request, add changes to it.
Prerequisites:
- You must have at least the Maintainer role in a project.
To enable @GitLabDuo to automatically review merge requests:
- On the top bar, select Search or go to and find your project.
- Select Settings > Merge requests.
- In the GitLab Duo Code Review section, select Enable automatic reviews by GitLab Duo.
- Select Save changes.
Automatic reviews from GitLab Duo for groups and applications
Use group or application settings to enable automatic reviews for multiple projects.
Prerequisites:
- To turn on automatic reviews for groups, have the Owner role for the group.
- To turn on automatic reviews for all projects, be an administrator.
To enable automatic reviews for groups:
- On the top bar, select Search or go to and find your group.
- Select Settings > General.
- Expand the Merge requests section.
- In the GitLab Duo Code Review section, select Enable automatic reviews by GitLab Duo.
- Select Save changes.
To enable automatic reviews for all projects:
- In the upper-right corner, select Admin.
- Select Settings > General.
- In the GitLab Duo Code Review section, select Enable automatic reviews by GitLab Duo.
- Select Save changes.
Settings cascade from application to group to project. More specific settings override broader ones.
Troubleshooting
Error DCR4000
You might get an error that states
Code Review Flow is not enabled. Contact your group administrator to enable the foundational flow in the top-level group. Error code: DCR4000.
This error occurs when either foundational flows or Code Review Flow are turned off.
Contact your administrator and ask them to turn on Code Review Flow for your top-level group.
Error DCR4001
You might get an error that states
Code Review Flow is enabled but the service account needs to be verified. Contact your administrator. Error code: DCR4001.
This error occurs when Code Review Flow is turned on, but the service account for the top-level group is not ready or is still being created.
Wait a few minutes for the service account to activate, then try again. If the error persists, contact your administrator.
Error DCR4002
You might get an error that states
No GitLab Credits remain for this billing period. To continue using Code Review Flow, contact your administrator. Error code: DCR4002.
This error occurs when you have used all of your allocated GitLab Credits for the current billing period.
Contact your administrator to purchase additional credits or wait for your credits to reset at the start of the next billing period.
Error DCR5000
You might get an error that states
Something went wrong while starting Code Review Flow. Please try again later. Error code: DCR5000.
This error occurs when GitLab Duo Agent Platform is unable to start Code Review Flow due to an internal error.
Try to restart the review. If the error persists, contact your administrator.