Skip to content

{Core} Add agent context to command telemetry - #34465

Open
Tom Gamble (gambtho) wants to merge 1 commit into
Azure:devfrom
gambtho:core-agent-telemetry
Open

Tom Gamble (gambtho) wants to merge 1 commit into
Azure:devfrom
gambtho:core-agent-telemetry

Conversation

@gambtho

@gambtho Tom Gamble (gambtho) commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

🤖 PR Validation — ️✔️ All clear

Breaking Changes Tests Suppressions
️✔️ None ️✔️ 130/130 ️✔️ None

Related command
All az commands.

Description
Adds a name-only Agent property to command telemetry so recognized agent contexts can be measured separately from AgenticSession, which describes an authentication path.

  • Values: claude-code, copilot-cli, copilot-vscode, codex, cursor, gemini-cli, unknown and multiple.
  • Uses a small allowlist of inherited environment signals. It doesn't prove AI authorship, and unknown doesn't mean human use.
  • The detector collects no raw environment values, versions, account data or session IDs. Authentication and the existing telemetry opt-out are unchanged.

Related #34403. Telemetry owners: please confirm schema/ingestion allowlisting and the required privacy review.

Testing Guide

  • Telemetry and agentic-session tests: 26 passed, plus 85 subtests.
  • Core pylint/flake8 and custom linter checks passed. Command-table linter rules have no selected core commands.
  • Broader core tests: 406 passed, 4 skipped, 1 failed. The completion test expects set show but gets set show subscription; the same failure reproduces on the unchanged base.
  • Vendor-runtime coverage and service ingestion weren't tested.

  • The PR title and description follow the submitting-PR guidelines.
  • I adhere to the Command Guidelines.
  • I adhere to the Error Handling Guidelines.

Copilot AI balanced review requested due to automatic review settings November 19, 2026 15:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Needs a closer look

The new Agent telemetry field requires telemetry-owner confirmation of privacy approval and backend schema/ingestion allowlisting, which remain unverified and cannot be established by client-side tests.

No open issues 🎉

What changed in this PR

Adds a name-only Agent property to Azure CLI command telemetry, addressing #34403 by tracking advertised agent context separately from the existing AgenticSession authentication indicator.

Changes:

  • Detects canonical agent names from allowlisted environment signals, with explicit precedence and unknown/multiple outcomes.
  • Adds tests for detection, payload handling, failure isolation, and existing telemetry consent controls.
  • Documents privacy boundaries and interpretation limits; service ingestion allowlisting and privacy review remain pending.
File Description
src/​azure-cli-core/​azure/​cli/​core/​tests/​test_telemetry.py Adds agent detection, payload lifecycle, and consent tests.
src/​azure-cli-core/​azure/​cli/​core/​telemetry.py Detects agent context and adds it to standard telemetry properties.
doc/​telemetry/​README.md Documents signals, precedence, privacy safeguards, and analytics limitations.

Review effort: Balanced

@microsoft-github-policy-service microsoft-github-policy-service Bot added the customer-reported Issues that are reported by GitHub users external to the Azure organization. label Nov 19, 2026
@microsoft-github-policy-service

Copy link
Copy Markdown
Contributor

Thank you for your contribution Tom Gamble (@gambtho)! We will review the pull request and get back to you soon.

@x-engineering-agent

Copy link
Copy Markdown
Contributor

Hi Tom Gamble (@gambtho),
Since the current milestone time is less than 7 days, this pr will be reviewed in the next milestone.

@yonzhan

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
Successfully started running 3 pipeline(s).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

act-platform-engineering-squad Core CLI core infrastructure customer-reported Issues that are reported by GitHub users external to the Azure organization.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants