Does GitLab Duo train on your code? No, but some model vendors keep it
The Morse teamPublished 11 min read
As of November 2026, GitLab Duo doesn't train AI on your code. GitLab says it "does not train generative AI models" and that all of its model sub-processors "are restricted from using model input and output to train models" (GitLab). But your code still goes to outside model vendors, some of them keep it for a while, and GitLab keeps your chat history on its own servers.
We read GitLab's Duo documentation on data usage, model selection, turning Duo on and off, the AI Gateway, self-hosted models, Agentic Chat, external agents, and Code Suggestions, plus its sub-processor list, AI Transparency Center, GitLab Duo AI Terms, pricing page, and an archived 2024 copy of the data usage page, on November 15, 2026. GitLab deserves credit here. It flags which models carry vendor-side retention, dates every change to its default models, and states outright that its AI Gateway "is not a data residency solution."
GitLab Duo data handling at a glance
Read on November 15, 2026, from GitLab's own pages.
| Setting or data | Default | How long it's kept | Source |
|---|---|---|---|
| Training on your prompts and code, by GitLab or its model vendors | Not done | Not applicable | GitLab |
| GitLab Duo itself, for a group or instance | On | Not applicable | GitLab |
| Requests to Fireworks AI-hosted models | Zero data retention | Discarded after the reply, unless prompt caching applies | GitLab |
| Requests to flagged Anthropic and OpenAI models | Limited vendor-side retention | No period published | GitLab |
| Prompt caching at the model vendor | On; can't be turned off for OpenAI models | In memory only, never logged to persistent storage | GitLab |
| Non-agentic Duo Chat conversation | Kept | Deleted after 30 days of inactivity, unless an admin changes it | GitLab |
| Agentic Chat conversation | Kept | Archived 30 days after you create it | GitLab |
| Collect usage data (full prompt and response text) | Off until a group owner or admin checks it | Not stated; not used for training | GitLab |
Does GitLab Duo use your code to train AI models?
No, on any tier. GitLab's data usage page says "GitLab does not train generative AI models," and its vendors are under data protection agreements "that prohibit the use of customer content for their own purposes, except to perform their independent legal obligations" (GitLab). GitLab's blog repeated it on April 20, 2026: "GitLab does not train AI models on customer code at any tier" (GitLab).
GitLab's AI Transparency Center puts the same promise in the present tense. Its answer to "Will my data be used to train models?" is that GitLab "does not currently train its own models," and that no Duo inputs or outputs "are currently used to train any GitLab models" (GitLab). The same page says vendors may not use prompts or output "associated with GitLab's customer ID" for their own purposes.
There's no training switch in GitLab Duo because there's nothing to switch off. The closest thing is the Collect usage data checkbox under Settings > GitLab Duo, added in GitLab 18.9.1. When a top-level group owner checks it, GitLab logs the "full prompt and response text," tool calls and their results, and session context from every project in the group, and says the data is used "exclusively for service improvement and debugging, and not for training AI models" (GitLab). GitLab doesn't remove names or emails you typed into a prompt, so ask your group owner whether that box is checked.
Which AI companies get your code through GitLab Duo?
Anthropic, Google, OpenAI, and Fireworks AI, depending on the feature and the model your group picked. GitLab's data usage page names Anthropic Claude, Fireworks AI-hosted Codestral, Gemini Enterprise Agent Platform models, and OpenAI models (GitLab). GitLab's sub-processor list adds Amazon Web Services for "AI-Powered Product Features," and HiddenLayer for "Prompt Injection Security" (GitLab).
The default changed recently. Since October 7, 2026, Agentic Chat, the GitLab Duo Developer agent, and all other agents default to Claude Sonnet 5.5 running on Google's Gemini Enterprise Agent Platform (GitLab). A group owner can pick another model, including GPT-6.1 Sol, Gemini 4 Argon, Kimi K3.1 Pro, or GLM 5.3, and can restrict Agentic Chat to an allowed list. GitLab also says it "might change the default model without notifying the user" if you stay on the default.
Do GitLab's model vendors keep your code?
One doesn't, and some models do. GitLab says it has "a zero data retention policy with Fireworks AI," which "discards model input and output data immediately after the output is provided" (GitLab). The same page says "certain Anthropic and OpenAI models, including when hosted on Amazon Bedrock and Gemini Enterprise Agent Platform, are subject to limited vendor-side data retention."
GitLab's model table marks which ones. As of November 15, 2026, the flag sits on Claude Fable 5, 5.1, and 5.2, Claude Mythos 5.1 and 5.2, GPT-5.5, the three GPT-5.6 models, GPT-6 Astra, Sol, and Luna, and GPT-6.1 Sol and Terra (GitLab). The default Claude Sonnet 5.5 doesn't carry it. GitLab doesn't publish how long "limited" retention lasts for any of them.
Prompt caching is a second exception, held in memory only. It's on by default, the vendor "temporarily stores prompt data in memory," and "for OpenAI models, you cannot turn off prompt caching" (GitLab). A group owner can clear Turn on prompt caching under Settings > GitLab Duo, in the Data and privacy section.
Some third-party guides still describe the 2024 arrangement. Fast.io's GitLab and GitHub comparison says GitLab's providers, "including Anthropic and Google, are contractually bound by zero data retention policies" (Fast.io). GitLab's current page names zero retention with Fireworks AI only.
How GitLab's promises changed since 2024
Built from GitLab's own pages and its archived docs, read November 15, 2026.
| When | What GitLab said | Source |
|---|---|---|
| March 25, 2024 | A GitLab AI product manager on its forum: "We will not use customer data to train models without explicit opt-in consent from customers." | GitLab Forum |
| GitLab 17.2 docs (2024) | Anthropic and Google discard input and output "immediately"; zero data retention with Anthropic; caching disabled for Duo requests; no training on "private (non-public) data" | GitLab archive |
| April 20, 2026 | No training "on customer code at any tier" | GitLab |
| October 7, 2026 | Default for Agentic Chat and agents becomes Claude Sonnet 5.5 on Gemini Enterprise Agent Platform | GitLab |
| November 15, 2026 | No training at all; zero retention with Fireworks AI only; limited vendor-side retention on flagged Anthropic and OpenAI models; prompt caching on by default | GitLab |
The training promise got broader, since the 2024 page limited it to private code and today's page has no such limit. The retention promise got narrower, from zero data retention arranged with Anthropic and Google discarding data immediately, to zero retention named for Fireworks AI alone.
What does GitLab itself keep from Duo?
Your chat history, and anything kept for abuse checks. GitLab says Duo Chat and the Agent Platform "retain chat and workflow history," that on GitLab.com it keeps that history "for anti-abuse purposes," and that it doesn't otherwise retain input and output "unless customers provide consent through a GitLab Support ticket" (GitLab). It publishes no period for the anti-abuse copy.
The two chats expire differently. A non-agentic Duo Chat conversation is "automatically deleted after 30 days of inactivity," and administrators can change that period (GitLab). Agentic Chat archives a conversation "30 days after you create them, even if you used them more recently," after which you can't view its messages but can still delete it (GitLab). Archived isn't the same word as deleted, so delete a conversation yourself if you want it gone.
Duo's telemetry records sizes and counts. GitLab's Snowplow collector counts unique users, prompt and suffix lengths, the model used, and response times, and Code Suggestions adds the language, the editor, and how many suggestions you accepted or rejected (GitLab).
Does GitLab Duo remove secrets before sending your code?
Usually, but not in the web chat. GitLab says Duo scans your code with Gitleaks and removes detected API keys, credentials, and tokens before the request reaches a model, in code completion, Agentic Chat input, and workflow tool results (GitLab). The same page says "secret scanning does not occur when you interact with GitLab Duo Chat through the web interface." Secret false positive detection, an opt-in security feature, deliberately sends the code around a detected secret to a model.
The GitLab MCP server works the other way round on a self-managed instance. GitLab says it "does not transmit, store, retain, or process any data" when that server is used, and that repository data isn't sent to GitLab (GitLab). The AI client you connect to it follows its own retention rules.
Does GitLab Duo keep your code in your region?
No promise. GitLab's AI Gateway page says the multi-region gateway "does not enforce strict data sovereignty," that requests "are not guaranteed to go to or remain in a particular region," and that "this service is not a data residency solution" (GitLab). GitLab.com requests go to us-east4 "in almost all cases." The gateway also runs in Europe and Asia Pacific regions, but the models behind it "are not guaranteed to reside in the same geographical regions."
Web search adds another hop. Agentic Chat's web search sends a query written from your conversation to a search service, and GitLab warns that it "might not respect your data residency choices," naming an Amazon Bedrock connector that "runs only in the AWS us-east-1 region" (GitLab). On self-managed instances, web search is off until an admin allows it.
Where your code goes, by GitLab Duo setup
Read on November 15, 2026, from GitLab's self-hosted models, AI Gateway, and external agents docs.
| Setup | Who runs the AI Gateway | Where prompts and code go | Model vendor rules apply? | Source |
|---|---|---|---|---|
| GitLab.com, or self-managed with GitLab-managed models | GitLab, in the cloud | GitLab's gateway, then Anthropic, Google, OpenAI, or Fireworks AI | Yes, including flagged retention | GitLab |
| Hybrid (your gateway for some features) | You and GitLab | Your models for some features, GitLab's gateway for the rest | Yes, for the GitLab-managed features | GitLab |
| Fully self-hosted gateway and models | You | Stays in your network; only billing metadata goes to GitLab | Only those of a cloud backend you choose | GitLab |
| External agents (Claude Code, Codex) with GitLab-managed credentials | GitLab's gateway | The agent's provider, under that provider's practices | Yes, and GitLab's prompt injection scanning doesn't cover them | GitLab |
The fully self-hosted route is the only one where, in GitLab's words, "inference data, including code inputs, model prompts, and model responses, does not leave the customer network" (GitLab). It's for GitLab Self-Managed and GitLab Dedicated for Government, and GitLab Duo Self-Hosted needs the Duo Enterprise add-on. The billing metadata it sends is an instance ID, a hashed user ID, a call count, and a timestamp.
For how Claude Code and Codex treat code outside GitLab, see does Claude Code train on your code and does Codex train on your code. GitLab's warning about prompt injection is the attack we explain in what is prompt injection.
How do admins turn GitLab Duo off?
From the group, subgroup, project, or instance settings. GitLab says "GitLab Duo is on by default" (GitLab).
- Top-level group on GitLab.com: as an Owner, open the group, select Settings > GitLab Duo, then Change configuration, and choose an option under GitLab Duo availability. The change reaches every subgroup and project.
- Subgroup: open Settings > General, expand GitLab Duo features, and choose an option under GitLab Duo availability.
- Project: as a Maintainer or Owner, open Settings > General, expand GitLab Duo, and turn the toggle off.
- Self-managed instance: as an administrator, select Admin, then GitLab Duo, then Change configuration.
Turning Duo off for a group doesn't take away anyone's seat. GitLab says members "can still use GitLab Duo with projects in other groups where it is turned on" (GitLab). Experiment and beta features start off, and a group owner who sets Always on still has to turn those on separately.
GitLab's Free tier gets Duo only through paid credits. GitLab's Agent Platform docs say features on the Free tier "require the purchase of GitLab Credits" (GitLab), and its pricing page sets the standard rate at $1 a credit, with Premium and Ultimate including 12 and 24 credits per user a month "for a limited time" (GitLab).
Asking a code question on Morse
Every answer above depends on choices made inside GitLab: which model a group owner picked, whether usage data collection is checked, how long chats last, and which region the gateway chose that day. Morse is a chat app in your browser. Morse doesn't train AI on your chats, sells no data, and shows no ads, and Morse's servers don't keep messages or log message content. The Free plan includes coding, file, and other chat tools.
- Private, for questions you'd rather no host kept. New chats start in Private. Open-weight models like DeepSeek, Kimi, and GLM, plus xAI's Grok, answer with your account, email, and IP address taken off. Morse has zero data retention agreements with its inference, search, and other providers, so they've agreed to keep nothing, and where a provider confirms zero retention on each reply, Morse checks it and refuses a reply that doesn't. Read what zero data retention means.
- E2EE, for anything no one else should read. Your browser checks the enclave's hardware attestation before anything leaves your device, then encrypts the message so only that enclave can open it, and Morse's servers relay ciphertext they can't read. This rests on the enclave hardware and attestation working as designed. E2EE runs open-weight models with no web search or image generation, and it's part of Pro at $19 a month. Here's how end-to-end encrypted AI chat works.
- Anonymous, for Claude, GPT, or Gemini without your identity on the request. Morse's proxy removes your account, email, and IP address and sends the message under Morse's own account. The provider sees the message without knowing it's you and may keep it for a limited time to check for abuse, under its own policy, so swap tokens and internal hostnames for placeholders before you paste.
Your chat history is stored in your browser, encrypted, not on Morse's servers. Clearing your browser deletes those chats for good, and Morse can't recover them, so save any answer you'll need. The Morse privacy policy has the details.
What to check in GitLab Duo before you rely on it
- Training: nothing to change. GitLab and its vendors don't train on Duo prompts or output.
- Vendor retention: ask your group owner which model each feature uses, and avoid the flagged Claude Fable, Claude Mythos, GPT-5.5, GPT-5.6, GPT-6, and GPT-6.1 models for code you'd rather no vendor kept.
- Logging: ask whether Collect usage data is checked, since it logs full prompts and responses.
- Region: if you need data to stay in one place, GitLab's own answer is a fully self-hosted gateway and models.
- A code question you'd rather no model vendor kept: ask it on Morse in Private or E2EE, if your employer's policy allows it.
You can start free with no card, or send a first message from the Morse home page without an account.
Common questions
Can you use GitLab Duo on GitLab's Free tier?
Only by paying for it. GitLab's Agent Platform docs say features on the Free tier require the purchase of GitLab Credits, and GitLab's pricing page sets the standard rate at $1 a credit. Premium and Ultimate include 12 and 24 credits per user a month for a limited time.
Does GitLab Duo strip API keys out of your code before the model sees it?
In most places. GitLab says Duo scans code with Gitleaks and removes detected secrets before the request goes to a model, in code completion, Agentic Chat input, and tool results. It also says that scan does not run when you use GitLab Duo Chat through the web interface.
Does the GitLab MCP server send your repository to GitLab?
Not on a self-managed instance. GitLab says that when its MCP server is used there, GitLab doesn't transmit, store, or process any data, and repository data stays between your MCP client and your instance. The client you connect, such as another AI tool, has its own retention rules.
Do Claude Code and Codex inside GitLab follow GitLab's rules?
Not fully. GitLab calls them external agents and says data sent to those providers is subject to their own security policies and data handling practices. GitLab's prompt injection scanning also doesn't cover them.