Skip to content

Commit 78cc92b

Browse files
Copilotmeaghanlewis
andcommitted
Add LLM detection section to .NET CLI telemetry documentation
Co-authored-by: meaghanlewis <[email protected]>
1 parent d666375 commit 78cc92b

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

docs/core/tools/telemetry.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ The telemetry feature collects the following data:
9191
| >=6.0.104 | Hashed CompileListCount used for build (MSBuild property) |
9292
| >=6.0.104 | Hashed _ReadyToRunCompilationFailures used for build (MSBuild property) |
9393
| >=6.0.300 | If the CLI was invoked from a Continuous Integration environment. For more information, see [Continuous Integration Detection](#continuous-integration-detection).|
94+
| >=9.0.100 | If the CLI was invoked from an LLM agent environment and the detected agent type. For more information, see [LLM Detection](#llm-detection).|
9495
| >=7.0.100 | Hashed PublishAot used for build (MSBuild property) |
9596
| >=7.0.100 | Hashed PublishProtocol used for build (MSBuild property) |
9697
| >=8.0.100 | Hashed TargetPlatformIdentifier used for build (MSBuild property) |
@@ -190,6 +191,16 @@ 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 environment, 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 environment variables used for detection and the agent type that is reported. Similar to CI detection, the actual values of these environment variables are never collected—only used to identify the agent type.
199+
200+
| Variable(s) | Agent Type | Action |
201+
| ----------- | ---------- | ------ |
202+
| COPILOT_AGENT_ACTION, COPILOT_CLOUD_ENVIRONMENT | GitHub Copilot | Check if all are present and non-null |
203+
193204
## Avoid inadvertent disclosure of information
194205

195206
.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)