Mark gen_ai.tool.description and gen_ai.tool.definitions as sensitive attributes per [GenAI Spec](https://github.com/open-telemetry/semantic-conventions-genai/pull/431) - #237
Merged
rads-1996 merged 4 commits intoAug 4, 2026
Conversation
Performance comparisonThreshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.
|
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the LangChain GenAI instrumentation to treat gen_ai.tool.definitions and gen_ai.tool.description as sensitive content by gating their emission behind the existing content-capture decision (_should_capture_content_on_spans) and/or explicit opt-in via enable_sensitive_data.
Changes:
- Gate
gen_ai.tool.definitionsemission ininvocation_parameters()behind_should_capture_content_on_spans(enable_sensitive_data)and add anenable_sensitive_dataparameter. - Gate
gen_ai.tool.descriptionemission infunction_calls()andtools()behind_should_capture_content_on_spans(enable_sensitive_data). - Update tracer wiring and tests to validate tool definition/description gating behaviors; add a changelog entry.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tests/langchain/test_utils.py | Updates existing tests and adds new cases to ensure tool definitions/descriptions are gated appropriately. |
| tests/langchain/test_tracer.py | Adds coverage ensuring tool definitions propagate to child LLM spans and agent aggregation when opted in. |
| src/microsoft/opentelemetry/_genai/_langchain/_utils.py | Implements gating for tool definitions/descriptions and extends invocation_parameters() API. |
| src/microsoft/opentelemetry/_genai/_langchain/_tracer.py | Propagates enable_sensitive_data into invocation_parameters() during span updates and agent aggregation. |
| CHANGELOG.md | Documents the new sensitive-attribute handling for tool definitions/descriptions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
rads-1996
marked this pull request as ready for review
August 4, 2026 21:09
rads-1996
requested review from
JacksonWeber,
MSNev,
hectorhdzg,
jeremydvoss and
lzchen
as code owners
August 4, 2026 21:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.