diff --git a/docs/core/tools/telemetry.md b/docs/core/tools/telemetry.md index 121c499658901..60cc642023778 100644 --- a/docs/core/tools/telemetry.md +++ b/docs/core/tools/telemetry.md @@ -106,6 +106,7 @@ The telemetry feature collects the following data: | >=8.0.100 | Whether library mode for mobile is used. | | >=8.0.100 | Whether NativeAOT is used. | | >=8.0.100 | Used Mono runtime pack version. | +| >=10.0.100 | If the CLI was invoked from an LLM agent, the detected LLM agent name is reported. For more information, see [LLM Detection](#llm-detection).| ### Collected options @@ -190,6 +191,21 @@ The full list of environment variables, and what is done with their values, is s | TEAMCITY_VERSION | TeamCity | Check if present and non-null | | JB_SPACE_API_URL | JetBrains Space | Check if present and non-null | +## LLM Detection + +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. + +The following table shows the agent name, environment variables used for detection and the value of the agent type that is reported. The actual values of these environment variables are never collected—only used to identify the agent type. + +| LLM agent | Variable(s) | Value | +| --------- | ----------- | ----- | +| GitHub Copilot | GITHUB_COPILOT_CLI_MODE | "copilot" | +| Claude Code | CLAUDECODE | "claude" | +| Cursor | CURSOR_EDITOR| "cursor" | +| Google Gemini | GEMINI_CLI | "gemini" | + +If multiple agents are detected, the different agent Values will be concatenated with a comma to produce the final value. + ## Avoid inadvertent disclosure of information .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.