Skip to content

Where Your Code Goes: Keys, Telemetry and Data Retention Across AI Extensions

For people

Every AI extension sends the code around your cursor to a model somewhere. What differs is where it goes, how long it is kept, and where the key that let it leave is stored — and the three common routes fail in three different ways.

Editorial team 7 min read

Share X LinkedIn Reddit Bluesky Email

Every AI extension in VS Code sends the code around your cursor to a model somewhere, and the question an organisation has to answer is not whether that happens but where it goes, what is kept, and who holds the key that let it leave. The answer differs for the three routes in common use, and most of the mistakes come from treating them as one.

Three Routes, Three Different Leaks

A vendor extension such as GitHub Copilot authenticates with your GitHub account rather than an API key, so there is nothing for a developer to paste anywhere. What leaves the machine is the prompt, which is the file you are in plus whatever context the extension assembles from open tabs and the workspace. Microsoft's own training material states that Copilot in the code editor "discards the prompts once a suggestion is returned", while for chat used outside the editor (the command line, mobile, GitHub.com) "GitHub typically retains prompts, suggestions, and supporting context for 28 days", adding that retention for chat inside the editor "may vary". The same page says individual subscribers "can opt-out of sharing their prompts with GitHub which will otherwise be used to finetune GitHub's foundational model". If your developers are on personal licences, that default is your data-handling policy whether you wrote it or not; GitHub's own trust documentation is the place to confirm the current figures before you put them in a policy.

An open extension with your own key, such as Continue, Cline or Roo Code, moves the trust to the model vendor and the key-handling to the extension. Here the key matters as much as the traffic, because a leaked key is both a bill and a data path. The local route, an extension pointed at Ollama or another server on the same machine, is the only one where nothing need leave at all: Ollama "binds 127.0.0.1 port 11434 by default" and its FAQ says plainly that "we don't see your prompts or data when you run locally". The caveat is that the same binary now offers cloud models and web search, which do leave the machine; an organisation that wants the local guarantee sets the documented environment variable or server setting that disables Ollama's cloud features, rather than relying on developers to notice which model they picked.

Where the Key Actually Lives

VS Code gives extensions two places to put a secret, and the difference decides whether a key walks out of the building. Settings written to settings.json are plain text, and Settings Sync copies user settings, extensions and MCP server configuration to every machine signed into the same account, including the laptop at home. A key stored that way also sits in a workspace .vscode/settings.json one careless commit from the repository. Roo Code's documentation says its keys "are stored securely in VSCode's Secret Storage and are never exposed in plain text", and an independent code analysis of Cline found the same design, with the operating system keychain behind it. That is the right design: the key is not in any file you can grep for and does not travel with Settings Sync.

Two failure cases are worth naming. First, SecretStorage needs an OS keyring, which a container often lacks; the same analysis of Cline found that its standalone mode outside VS Code falls back to a plain, unencrypted JSON file under the home directory. A key that was safe on a laptop is a file in a container image once the same workflow is reproduced headlessly. Second, SecretStorage namespaces secrets by extension but does not isolate them: in June 2024 ControlPlane published a proof-of-concept extension that read VS Code's shared SQLite store, obtained the OS-managed key and decrypted other extensions' secrets, because every extension runs with the full permissions of the user. Microsoft's answer was that "users should only install extensions they trust", which is a statement about governance, not about the API.

Continue takes a third path. Its configuration references a key as ${{ secrets.NAME }}, and the project's documentation describes resolving it from a .env file at the workspace root, then from the workspace's .continue folder, then from the global ~/.continue directory, and finally from the process environment. It also warns that the IDE extension cannot read variables exported in your shell, which is the single most common reason a key works from the terminal and not from the editor. A .env file at the workspace root is also the single most common thing to commit by accident, so the .gitignore has to come first.

What the Vendors Say About Retention and Training

Anthropic's commercial retention policy says API inputs and outputs are deleted "within 30 days of receipt or generation" by default, with content flagged for a usage-policy violation held "for up to 2 years". Its API documentation states that "retained data is never used for model training without your express permission", and that zero data retention is arranged per organisation through the sales team, with stateful features such as code execution and the Files API excluded because they hold data by design. OpenAI's data page makes a parallel commitment: abuse-monitoring logs are "retained for up to 30 days, unless longer retention is required by law", API data "is not used to train or improve OpenAI models" unless you opt in, and zero data retention is "subject to prior approval by OpenAI".

Alibaba Cloud's Model Studio, which serves the Qwen family, states in its FAQ that it "never uses your data for model training", but also that it "will store data generated from model and application calls" without naming a period on that page. The service "must be activated on a per-region basis", so where a developer created the key decides whether traffic lands in Beijing or Singapore. DeepSeek is the outlier. Its privacy policy says it stores collected information "in secure servers located in the People's Republic of China", lists user input among the data used "to train and improve our technology", and gives no fixed retention period beyond "as long as you have an account". It also says data from developers using its open platform is "not covered by this privacy policy", which means an organisation using the DeepSeek API has to write its own answer to the question. The weights are open, so the honest route for Qwen or DeepSeek models in a regulated setting is to serve them yourself and use the local route above.

Making the Mistake Impossible

Telling developers not to paste keys into settings.json does not work at volume; the control has to be a policy VS Code enforces. VS Code supports centrally managed policies through Windows Group Policy (deployable with Intune), macOS configuration profiles and a Linux policy file, and a managed value "overrides the VS Code setting value configured at any level", so a developer cannot undo it in a workspace file. The two that matter are AllowedExtensions, which restricts installation to the publishers or extension identifiers you list, and TelemetryLevel. The MCP policies, an allow-list and a deny-list where "deny rules always take precedence", close the newer hole, since an MCP server is a second channel for code to leave by. With an allow-list of a handful of audited extensions, the SecretStorage weakness shrinks to the extensions you chose, the only key-handling in play is the kind those extensions implement, and settings.json never has a key to leak because nothing on the list reads one from there.

More in VS Code and AI

All VS Code and AI guides →
VS Code and AI Guide · 7 min

Writing Instructions Files Every Assistant Reads

Claude Code, Copilot, Continue and Cline each read their own instructions file, but most of them now read AGENTS.md too. Write the content once, point the rest at it, and check that each harness actually loaded it.

VS Code and AI 7 min read 31 Oct 2026 For people

VS Code and AI Guide · 7 min

Using Claude Through GitHub Copilot Chat

What you get when you pick a Claude model inside GitHub Copilot in VS Code, where it quietly differs from using Claude directly, which plans include it, and how the AI Credits meter runs down faster on the heavier models and in agent mode.

VS Code and AI 7 min read 31 Oct 2026 For people

VS Code and AI Guide · 6 min

Running a Local Model Behind VS Code With Ollama

Continue and Cline will both talk to Ollama on port 11434 instead of a vendor's API. Which jobs that is good for, how much memory it takes, and why autocomplete and chat want different models.

VS Code and AI 6 min read 31 Oct 2026 For people

VS Code and AI Guide · 6 min

Qwen Models in VS Code: Cloud and Local

Three ways to run Qwen's coder models in VS Code — Alibaba's hosted API through Cline or Continue, a local Ollama or LM Studio runtime, or Qwen Code's own companion panel — and the memory, region and tool-calling mistakes that trip each one.

VS Code and AI 6 min read 31 Oct 2026 For people

Discussion 0

Use @handle to bring somebody in, and #tag to file it.

Nothing here yet. Ask a question, or say how you used it.

Sign in to join the discussion. Sign in