GitLab Duo Chat (Agentic)

  • Tier: Premium, Ultimate
  • Add-on: GitLab Duo Core, Pro, or Enterprise
  • Offering: GitLab.com, GitLab Self-Managed, GitLab Dedicated
  • Status: Beta

The availability of this feature is controlled by feature flags. For more information, see the history.

GitLab Duo Chat (Agentic) is an enhanced version of GitLab Duo Chat (Classic). This new Chat can autonomously perform actions on your behalf, to help you answer complex questions more comprehensively.

While the classic Chat answers questions based on a single context, the agentic Chat searches, retrieves, and combines information from multiple sources across your GitLab projects to provide more thorough and relevant answers. The agentic Chat can also create and edit files for you.

“Agentic” means that Chat:

  • Autonomously uses a large language model to determine what information is needed.
  • Executes a sequence of operations to gather that information.
  • Formulates a response to your questions.
  • Can create and change local files.

For larger problems, like understanding a codebase or generating an implementation plan, use the software development flow of the GitLab Duo Agent Platform.

For examples of how you can use Chat, see Ask GitLab Duo Chat.

For an overview, see GitLab Duo Chat (Agentic).

Use GitLab Duo Chat

You can use GitLab Duo Chat in:

  • The GitLab UI.
  • VS Code.
  • A JetBrains IDE.
  • Visual Studio for Windows.

Use GitLab Duo Chat in the GitLab UI

The availability of the new navigation and GitLab Duo sidebar is controlled by a feature flag. For more information, see the history.

Prerequisites:

Instructions are provided for the new navigation and classic navigation. Select the tab for your navigation type, or learn how to switch.

  1. On the top bar, select Search or go to and find your project.
  2. On the GitLab Duo sidebar, select either New GitLab Duo Chat ( pencil-square ) or Current GitLab Duo Chat ( duo-chat ). A Chat conversation opens in the GitLab Duo sidebar on the right side of your screen.
  3. Under the chat text box, turn on the Agentic mode (Beta) toggle.
  4. Enter your question in the chat text box and press Enter or select Send.
    • You can provide additional context for your chat.
    • It might take a few seconds for the interactive AI chat to produce an answer.
  5. Optional. You can:
  1. On the left sidebar, select Search or go to and find your project.
  2. In the upper-right corner, select Open GitLab Duo Chat ( duo-chat ). A drawer opens on the right side of your screen.
  3. Under the chat text box, turn on the Agentic mode (Beta) toggle.
  4. Enter your question in the chat text box and press Enter or select Send.
    • You can provide additional context for your chat.
    • It might take a few seconds for the interactive AI chat to produce an answer.
  5. Optional. You can:

If you reload the webpage you are on, or go to another webpage, Chat remembers your most recent conversation, and that conversation is still active in the Chat drawer.

Use GitLab Duo Chat in VS Code

Prerequisites:

Turn on GitLab Duo Chat:

  1. In VS Code, go to Settings > Settings.
  2. Search for agent platform.
  3. Under GitLab > Duo Agent Platform: Enabled, select the Enable GitLab Duo Agent Platform checkbox.

Then, to use GitLab Duo Chat:

  1. On the left sidebar, select GitLab Duo Agent Platform (Beta) ( duo-agentic-chat ).
  2. Select the Chat tab.
  3. Select Refresh page if prompted.
  4. In the message box, enter your question and press Enter or select Send.

Use GitLab Duo Chat in JetBrains IDEs

Prerequisites:

Turn on GitLab Duo Chat:

  1. In your JetBrains IDE, go to Settings > Tools > GitLab Duo.
  2. Under GitLab Duo Agent Platform (Beta), select the Enable GitLab Duo Agent Platform checkbox.
  3. Restart your IDE if prompted.

Then, to use GitLab Duo Chat:

  1. On the left sidebar, select GitLab Duo Agent Platform (Beta) ( duo-agentic-chat ).
  2. Select the Chat tab.
  3. In the message box, enter your question and press Enter or select Send.

Use GitLab Duo Chat in Visual Studio

Prerequisites:

Turn on GitLab Duo Chat:

  1. In Visual Studio, go to Tools > Options > GitLab.
  2. Under GitLab, select General.
  3. For Enable Agentic Duo Chat (experimental), select True, and then OK.

Then, to use GitLab Duo Chat:

  1. Select Extensions > GitLab > Open Agentic Chat.
  2. In the message box, enter your question and press Enter.

View the chat history

To view your chat history:

  • In the GitLab UI:

    On the GitLab Duo sidebar, select GitLab Duo Chat history ( history ).

    In the upper-right corner of the Chat, select Chat history ( history ).

  • In your IDE, in the upper-right corner of the message box, select Chat history ( history ).

In the GitLab UI, all of the conversations in your chat history are visible.

In your IDE, the last 20 conversations are visible. Issue 1308 proposes to change this.

Have multiple conversations

You can have an unlimited number of simultaneous conversations with GitLab Duo Chat.

Your conversations synchronize across GitLab Duo Chat in the GitLab UI and your IDE.

  1. Open GitLab Duo Chat in the GitLab UI or your IDE.

  2. Enter your question and press Enter or select Send.

  3. Create a new Chat conversation:

    • In the GitLab UI:

      You can do either of the following:

      • On the GitLab Duo sidebar, select New GitLab Duo Chat ( pencil-square ).
      • In the message box, type /new and press Enter or select Send. A new Chat conversation replaces the previous one.
      1. In the upper-right corner, select Open GitLab Duo Chat ( duo-chat ). A drawer opens on the right side of your screen.
      2. Create a new Chat conversation by doing either of the following:
        • In the upper-right corner of an existing conversation, select New chat ( duo-chat-new ).
        • In the message box, type /new and press Enter or select Send. A new Chat conversation replaces the previous one.
    • In your IDE: In the upper-right corner of the message box, select New chat ( plus ).

  4. Enter your question and press Enter or select Send.

  5. To view all of your conversations, look at your chat history.

  6. To switch between conversations, in your chat history, select the appropriate conversation.

  7. IDE only: To search for a specific conversation in the chat history, in the Search chats text box, enter your search term.

Because of LLM context window limits, conversations are truncated to 200,000 tokens (roughly 800,000 characters) each.

Delete a conversation

  1. In the GitLab UI or your IDE, select the chat history.
  2. In the history, select Delete this chat ( remove ).

Individual conversations expire and are automatically deleted after 30 days of inactivity.

Create custom rules

Use custom rules to specify instructions for GitLab Duo Chat to follow for every conversation in your IDE.

You can create custom rules at two levels:

  • User-level rules: Apply to all of your projects and workspaces.
  • Workspace-level rules: Apply only to a specific project or workspace.

If both user-level and workspace-level rules exist, GitLab Duo Chat applies both to conversations.

Prerequisites:

Conversations that existed before you created any custom rules do not follow those rules.

Create user-level custom rules

User-level custom rules apply to all of your projects and workspaces.

  1. Create a custom rules file in your user configuration directory:

    • If you have set the GLAB_CONFIG_DIR environment variable, create the file at: $GLAB_CONFIG_DIR/chat-rules.md
    • Otherwise, create the file in your platform’s default configuration directory:
      • macOS: ~/Library/Application Support/glab-cli/chat-rules.md
      • Linux: ~/.config/glab-cli/chat-rules.md
      • Windows: %LOCALAPPDATA%\glab-cli\chat-rules.md
  2. Add custom rules to the file. For example:

    - Don't put comments in the generated code
    - Be brief in your explanations
    - Always use single quotes for JavaScript strings
  3. Save the file.

  4. To apply the new custom rules, start a new GitLab Duo conversation.

    You must do this every time you change the custom rules.

Create workspace-level custom rules

Workspace-level custom rules apply only to a specific project or workspace.

  1. In your IDE workspace, create a custom rules file: .gitlab/duo/chat-rules.md.

  2. Add custom rules to the file. For example:

    - Don't put comments in the generated code
    - Be brief in your explanations
    - Always use single quotes for JavaScript strings
  3. Save the file.

  4. To apply the new custom rules, start a new GitLab Duo conversation.

    You must do this every time you change the custom rules.

For more information, see the Custom rules in GitLab Duo Agentic Chat blog.

Update custom rules

To update your custom rules, edit and save the custom rules file. Then, start a new GitLab Duo conversation to apply the updated rules.

You cannot use Chat to edit your custom rules file directly.

To manage who must approve any changes to custom rules, use Code Owners.

Select a model

  • Offering: GitLab.com, GitLab Self-Managed
  • Status: Beta

When you use Chat in the GitLab UI, VS Code, or a JetBrains IDE, you can select the model to use for conversations.

If you open a previous chat from the chat history and continue that conversation, Chat uses the model that you previously selected.

If you select a new model when in an existing conversation, Chat creates a new conversation.

Prerequisites:

  • The Owner of the top-level group has not selected a model for the GitLab Duo Agent Platform. If a model has been selected for the group, you cannot change the model for Chat.
  • You must be using Chat in the top-level group. You cannot change the model if you access Chat in the organization.
  • The administrator has not selected a model for the instance. If a model has been selected for the instance, you cannot change the model for Chat.
  • Your instance must be connected to the GitLab AI gateway.

To select a model:

  • In the GitLab UI:

    1. Under the chat text box, ensure that the Agentic mode (Beta) toggle is turned on.
    2. Select a model from the dropdown list.
  • In your IDE:

    1. On the left sidebar, select GitLab Duo Agent Platform (Beta) ( duo-agentic-chat ).
    2. Select the Chat tab.
    3. Select a model from the dropdown list.

Select an agent

When you use Chat in a project in the GitLab UI, VS Code, or a JetBrains IDE, you can select a specific agent for Chat to use.

Prerequisites:

To select an agent:

  1. In the GitLab UI or your IDE, open a new conversation in GitLab Duo Chat.
  2. In the dropdown list, select an agent. If you have not set up any agents, there is no dropdown list, and Chat uses the default GitLab Duo agent.
  3. Enter your question and press Enter or select Send.

After you create a conversation with an agent:

  • The conversation remembers the agent you selected. You cannot select a different agent for that conversation.
  • If you use the chat history to go back to the same conversation, it uses the same agent.
  • If you go back to a conversation and the associated agent is no longer available, you cannot continue that conversation.

Prompt caching

Prompt caching is enabled by default to improve GitLab Duo Chat (Agentic) latency. When prompt caching is enabled, chat prompt data is temporarily stored in memory by the model vendor (Anthropic or VertexAI). Prompt caching significantly improves latency by avoiding the re-processing of cached prompt and input data.

Turn off prompt caching

You can turn off prompt caching for top-level groups in the GitLab Duo settings. This also turns off prompt caching for Code Suggestions.

GitLab Duo Chat capabilities

GitLab Duo Chat (Agentic) extends GitLab Duo Chat (Classic) capabilities with the following features:

  • Project search: Can search through your projects to find relevant issues, merge requests, and other artifacts using keyword-based search. Agentic Chat does not have semantic search capability.
  • File access: Can read and list files in your local project without you needing to manually specify file paths.
  • Create and edit files: Can create files and edit multiple files in multiple locations. This affects the local files.
  • Resource retrieval: Can automatically retrieve detailed information about issues, merge requests, and pipeline logs of your current project.
  • Multi-source analysis: Can combine information from multiple sources to provide more complete answers to complex questions. You can use Model Context Protocol to connect GitLab Duo Chat (Agentic) to external data sources and tools.
  • Custom rules: Conversations can follow any customized rules that you specify.
  • GitLab Duo Chat (Agentic) in the GitLab UI only - Commit creation: Can create and push commits.

Chat feature comparison

CapabilityGitLab Duo Chat (Classic)GitLab Duo Chat (Agentic)
Ask general programming questionsYesYes
Get answers about an open file in the editorYesYes. Provide the path of the file in your question.
Provide context about specified filesYes. Use /include to add a file to the conversation.Yes. Provide the path of the file in your question.
Autonomously search project contentsNoYes
Autonomously create files and change filesNoYes. Ask it to change files. Note, it may overwrite changes that you have made manually and have not committed, yet.
Retrieve issues and MRs without specifying IDsNoYes. Search by other criteria. For example, an MR or issue’s title or assignee.
Combine information from multiple sourcesNoYes
Analyze pipeline logsYes. Requires GitLab Duo Enterprise add-on.Yes
Restart a conversationYes. Use /new or /reset.Yes. Use /new or, if in the UI, /reset.
Delete a conversationYes, in the chat history.Yes, in the chat history
Create issues and MRsNoYes
Use Git read-only commandsNoYes
Use Git write commandsNoYes, UI only
Run Shell commandsNoYes, IDEs only
Run MCP toolsNoYes, IDEs only

Use cases

You might find GitLab Duo Chat particularly helpful when you:

  • Need answers that require information from multiple files or GitLab resources.
  • Want to ask questions about your codebase without having to specify exact file paths.
  • Are trying to understand the status of issues or merge requests across a project.
  • Want to have files created or edited for you.

Example prompts

GitLab Duo Chat works best with natural language questions. Here are some examples:

  • Read the project structure and explain it to me, or Explain the project.
  • Find the API endpoints that handle user authentication in this codebase.
  • Please explain the authorization flow for <application name>.
  • How do I add a GraphQL mutation in this repository?
  • Show me how error handling is implemented across our application.
  • Component <component name> has methods for <x> and <y>. Could you split it up into two components?
  • Could you add in-line documentation for all Java files in <directory>?
  • Do merge request <MR URL> and merge request <MR URL> fully address this issue <issue URL>?

Security

  • Tier: Ultimate
  • Add-on: GitLab Duo Core, Pro, or Enterprise
  • Offering: GitLab.com, GitLab Dedicated

You can use GitLab Duo Chat (Agentic) to triage, manage, and remediate vulnerabilities through natural language commands.

You can use the following security tools in GitLab Duo Chat (Agentic):

Vulnerability information and analysis:

  • List all vulnerabilities in a project with filtering by severity and report types.
  • Get detailed vulnerability information including CVE data, EPSS scores, and reachability analysis.

Vulnerability management actions:

  • Confirm vulnerabilities when verified as genuine security issues.
  • Dismiss false positives or acceptable risks with proper reasoning.
  • Update vulnerability severity levels based on security review.
  • Revert vulnerability status back to detected for re-assessment.

Issue management integration:

  • Create GitLab issues automatically linked to vulnerabilities.
  • Link existing issues to vulnerabilities for tracking.

Security example prompts

  • Show me all critical vulnerabilities in my project
  • List vulnerabilities with EPSS scores above 0.7 that are reachable
  • Dismiss all dependency scanning vulnerabilities marked as false positives with unreachable code
  • Create issues for all confirmed high-severity SAST vulnerabilities and assign them to recent committers
  • Update severity to HIGH for all vulnerabilities that cross trust boundaries
  • Show me vulnerabilities dismissed in the past week with their reasoning
  • Confirm all container scanning vulnerabilities with known exploits
  • Link vulnerability 123 to issue 456 for tracking remediation

For more information about these security capabilities, see epic 19639.

Troubleshooting

When working with GitLab Duo Chat, you might encounter issues.

For information on resolving these issues, see Troubleshooting.

Feedback

Because this is a beta feature, your feedback is valuable in helping us improve it. Share your experiences, suggestions, or issues in issue 542198.