Track Agency usage as an execution environment modifier - #10061
Conversation
📋 Prioritization NoteThanks for the contribution! The linked issue isn't in the current milestone yet. |
|
Azure Pipelines: Successfully started running 1 pipeline(s). 22 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
There was a problem hiding this comment.
Copilot review overview
🔵 Needs a closer look
The required privacy review and confirmation of Agency’s marker contract remain pending.
Review effort: Balanced
Findings: None
What changed in this PR
Adds Agency usage attribution to azd’s canonical execution-environment telemetry without exposing session IDs or changing agent precedence.
Changes:
- Appends the fixed
agencymodifier whenAGENCY_SESSION_IDis non-empty. - Adds unit and functional regression coverage.
- Updates telemetry, privacy, and environment-variable documentation.
| File | Description |
|---|---|
cli/azd/internal/tracing/resource/exec_environment.go |
Detects the Agency marker. |
cli/azd/internal/tracing/fields/fields.go |
Defines the fixed modifier. |
cli/azd/internal/tracing/resource/resource_test.go |
Tests detection, ordering, and disclosure boundaries. |
cli/azd/test/functional/telemetry_test.go |
Verifies end-to-end trace output. |
cli/azd/cmd/telemetry_test.go |
Validates telemetry field metadata. |
cli/azd/docs/environment-variables.md |
Documents the canonical variable contract. |
docs/reference/environment-variables.md |
Adds the variable to the public index. |
docs/reference/telemetry-data.md |
Documents emitted modifier behavior. |
docs/specs/metrics-audit/telemetry-schema.md |
Updates allowed telemetry values. |
docs/specs/metrics-audit/privacy-review-checklist.md |
Records the pending privacy requirement. |
docs/specs/metrics-audit/feature-telemetry-matrix.md |
Updates subsystem coverage. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
|
Fixed the test lint failures in d844ce6. The resource assertions now use Value.String(), and the test subprocess has a scoped G204 annotation explaining why its inputs are trusted. Both Linux and Windows lint jobs now pass. The previous Linux signing failure was a package-download infrastructure issue: DNS resolution failed, and the fallback feed returned 401. No signing configuration changes are needed in this PR. The replacement pipeline is running. Local build, lint, unit tests, and the targeted telemetry integration tests pass. Full playback remains blocked by the unavailable local container runtime after retrying with the pinned Bicep binary. |
Azure Dev CLI Install InstructionsInstall scriptsMacOS/Linux
bash: pwsh: WindowsPowerShell install MSI install Standalone Binary
MSI
Documentationlearn.microsoft.com documentationtitle: Azure Developer CLI reference
|
Adds
agencytoexecution.environmentwhenAGENCY_SESSION_IDis non-empty. The modifier preserves the existing primary environment and other modifiers. Empty or unset values have no effect, and the session ID is never emitted.Agent detection, prompting, and telemetry opt-out behavior are unchanged. Regression coverage includes overlapping agent markers, caller precedence, modifier ordering, empty and unset values, and session-ID non-disclosure in resource attributes, trace files, and command output. Environment-variable and telemetry documentation are updated.
Targeted unit tests, CLI trace-file tests, and the build pass.
Before merge, confirm the marker contract with the Agency implementation or maintainers and complete privacy review for the new detection source. The tests verify behavior when the marker is supplied; they do not establish that Agency supplies it.
Fixes #10059
Telemetry change checklist
Telemetry Change Checklist
New Fields
fields/fields.go; extension-suppliedext.*values are covered by the extension's own review instead. Existing field only.SystemMetadata/BusinessInsight.docs/specs/metrics-audit/telemetry-schema.md.New Events
events/events.go. N/A: no new events.constwhose Go identifier containsEvent(end it withPrefixfor a prefix-match group) so the GDPR classifier discovers it. N/A: no new events.docs/specs/metrics-audit/telemetry-schema.md. N/A: no new events.prefix.noun.verb). N/A: no new events.Privacy
CustomerContentemitted in telemetry.Testing
Downstream
Documentation
docs/specs/metrics-audit/feature-telemetry-matrix.md) if a new command emits telemetry, a gap is being closed, or a new cross-cutting subsystem is added.docs/specs/metrics-audit/telemetry-schema.md) with new field/event, including its Hashing section if the field is hashed. Allowed modifier values updated; no hashing changes.privacy-review-checklist.md) updated if a new field is hashed or a previously-raw field becomes hashed. N/A: no new hashing.