Skip to content

Commit bc6f309

Browse files
Copilotmeaghanlewisbaronfelgewarren
authored
Add LLM detection telemetry documentation for .NET CLI (#48930)
* Initial plan * Add LLM detection section to .NET CLI telemetry documentation Co-authored-by: meaghanlewis <[email protected]> * Update LLM detection section in telemetry documentation * Add additional LLM agent detections from SDK PR #51054 Co-authored-by: baronfel <[email protected]> * Apply suggestion from @baronfel * update ms.date * Update docs/core/tools/telemetry.md Co-authored-by: Genevieve Warren <[email protected]> * Update docs/core/tools/telemetry.md Co-authored-by: Genevieve Warren <[email protected]> * Update docs/core/tools/telemetry.md Co-authored-by: Genevieve Warren <[email protected]> * Update docs/core/tools/telemetry.md Co-authored-by: Genevieve Warren <[email protected]> * Update docs/core/tools/telemetry.md Co-authored-by: Genevieve Warren <[email protected]> * Fix LLM agent name description formatting Corrected formatting in telemetry documentation. --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: meaghanlewis <[email protected]> Co-authored-by: Meaghan Osagie <[email protected]> Co-authored-by: baronfel <[email protected]> Co-authored-by: Chet Husk <[email protected]> Co-authored-by: Genevieve Warren <[email protected]>
1 parent f03d278 commit bc6f309

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

docs/core/tools/telemetry.md

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
title: .NET SDK and .NET CLI telemetry
33
description: The .NET SDK and the .NET CLI collect usage information and send it to Microsoft. Learn what data is collected and how to opt out.
44
author: KathleenDollard
5-
ms.date: 02/24/2022
5+
ms.date: 10/07/2025
66
---
77
# .NET SDK and .NET CLI telemetry
88

@@ -105,7 +105,8 @@ The telemetry feature collects the following data:
105105
| >=8.0.100 | Whether Mono interpreter is used. |
106106
| >=8.0.100 | Whether library mode for mobile is used. |
107107
| >=8.0.100 | Whether NativeAOT is used. |
108-
| >=8.0.100 | Used Mono runtime pack version. |
108+
| >=8.0.100 | The Mono runtime pack version that was used. |
109+
| >=10.0.100 | The detected LLM agent name if the CLI was invoked from an LLM agent. For more information, see [LLM detection](#llm-detection).|
109110

110111
### Collected options
111112

@@ -190,6 +191,21 @@ The full list of environment variables, and what is done with their values, is s
190191
| TEAMCITY_VERSION | TeamCity | Check if present and non-null |
191192
| JB_SPACE_API_URL | JetBrains Space | Check if present and non-null |
192193

194+
## LLM detection
195+
196+
To detect if the .NET CLI is running in the context of an LLM agent, the .NET CLI probes for the presence and values of several environment variables that LLM agents and AI coding assistants set.
197+
198+
The following table shows the agent name, environment variable used for detection, and value of the agent type that's reported. The actual values of these environment variables are never collected—only used to identify the agent type.
199+
200+
| LLM agent | Variable | Value |
201+
| --------- | ----------- | ----- |
202+
| GitHub Copilot | GITHUB_COPILOT_CLI_MODE | "copilot" |
203+
| Claude Code | CLAUDECODE | "claude" |
204+
| Cursor | CURSOR_EDITOR| "cursor" |
205+
| Google Gemini | GEMINI_CLI | "gemini" |
206+
207+
If multiple agents are detected, the different agent values are concatenated with a comma to produce the final value.
208+
193209
## Avoid inadvertent disclosure of information
194210

195211
.NET contributors and anyone else running a version of the .NET SDK that they built themselves should consider the path to their SDK source code. If a crash occurs while using a .NET SDK that is a custom debug build or configured with custom build symbol files, the SDK source file path from the build machine is collected as part of the stack trace and isn't hashed.

0 commit comments

Comments
 (0)