Disable GitLab AI Gateway Features Until Patch
In this article
If your GitLab instance is affected by a vulnerability in the AI Gateway or you simply want to temporarily disable AI-powered features (like suggested reviewers, code suggestions, or chat) until a patch is applied, this guide walks you through the process. You'll learn how to turn off these features at the instance, group, and project levels, and how to fully disable the AI Gateway if needed.
What You'll Need
- Administrator access to your GitLab instance (for instance-level settings).
- Owner or Maintainer role for group/project-level changes (if you only need to disable for specific groups/projects).
- Access to the GitLab Rails console (if you need to disable the AI Gateway entirely).
- Basic familiarity with GitLab's settings UI and configuration files.
Step-by-Step
1. Disable AI Features at the Instance Level
- Log in to GitLab as an administrator.
- Go to Admin Area (the wrench icon) > Settings > General.
- Expand the AI-powered features section.
- Uncheck the boxes for each AI feature you want to disable, such as:
- Code Suggestions
- Suggested Reviewers
- Chat
- Summarize Changes
- Click Save changes.
2. Disable AI Features at the Group Level
- Navigate to your group's page.
- Go to Settings > General.
- Scroll to the AI-powered features section.
- Toggle off the features you want to disable for this group.
- Click Save changes.
3. Disable AI Features at the Project Level
- Open the project you want to modify.
- Go to Settings > General.
- Find the AI-powered features section.
- Uncheck the boxes for the features you want off.
- Click Save changes.
4. Disable the AI Gateway Entirely (If Needed)
If you want to completely block GitLab from communicating with the AI Gateway (for example, during a security incident), you can disable the feature flag or set the environment variable:
- Open a Rails console on your GitLab server:
sudo gitlab-rails console - Disable the AI Gateway feature flag:
Feature.disable(:ai_gateway) - Exit the console by typing
exit. - Alternatively, set the environment variable
GITLAB_AI_GATEWAY_ENABLED=falsein yourgitlab.rbconfiguration and reconfigure:sudo editor /etc/gitlab/gitlab.rbAdd the line:
gitlab_rails['env'] = { 'GITLAB_AI_GATEWAY_ENABLED' => 'false' }Then run:
sudo gitlab-ctl reconfigure
5. Verify the Changes
- Log out and log back in as a regular user.
- Navigate to a project that previously showed AI features.
- Confirm that the AI buttons (e.g., “Suggest code”, “Ask AI”) are no longer visible.
- If you still see them, try a hard refresh (Ctrl+F5) or clear your browser cache.
Common Mistakes
- Only disabling at one level: If you disable at the instance level, group and project settings can still override. Make sure you disable at all levels if you want a complete block.
- Forgetting to save: After unchecking boxes, you must click “Save changes”. It's easy to navigate away without saving.
- Using the wrong console: The Rails console command may differ if you're using a source installation. Use
bundle exec rails consolein that case. - Not reconfiguring after editing gitlab.rb: If you set the environment variable, you must run
gitlab-ctl reconfigurefor it to take effect.
Tips
- Before disabling, take note of which features were enabled so you can re-enable them after the patch is applied.
- Consider disabling at the instance level first, then selectively re-enable for trusted groups/projects if needed.
- If you're using GitLab.com, you cannot disable AI features at the instance level; contact support to request temporary disablement.
- Keep an eye on GitLab's security releases page for the patch announcement.
Troubleshooting
AI features still appear after disabling
- Clear your browser cache and hard refresh the page.
- Check if the feature is enabled via a feature flag. Run
Feature.enabled?(:ai_gateway)in the Rails console to confirm. - Ensure you are looking at the correct level (instance vs group vs project).
Rails console not available
- Make sure you are on the GitLab server itself, not a GitLab Runner.
- If you're using Docker, run:
docker exec -it <container_name> gitlab-rails console.
Changes revert after a restart
- If you used the Rails console to disable a feature flag, it might not persist across restarts. Use the
gitlab.rbenvironment variable method for a persistent change.
Frequently Asked Questions
Will disabling AI features affect other GitLab functionality?
No, AI features are separate from core GitLab functionality like repositories, CI/CD, and issue tracking. Disabling them only removes the AI-powered buttons and suggestions.
Can I re-enable AI features after the patch is applied?
Yes, simply re-check the boxes in the settings or remove the environment variable and reconfigure. The features will work as before.
Does this stop data from being sent to the AI Gateway?
Yes, when AI features are disabled, GitLab should not send any code or user data to the AI Gateway. However, to be fully certain, you can block network access to the AI Gateway URL in your firewall.
What if I only want to disable one feature, like Code Suggestions?
You can uncheck only that specific feature in the settings. The other AI features will remain active.
Is there a way to disable AI features for a single user?
GitLab does not currently offer per-user AI feature toggles. You can only disable at the instance, group, or project level.
How do I know if the AI Gateway is actually disabled?
Check the GitLab logs for any attempts to connect to the AI Gateway. You can also verify by checking the feature flag status in the Rails console with Feature.enabled?(:ai_gateway).