Skip to content

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 into
microsoft:mainfrom
rads-1996:make-tool-definition-description-sensitive
Aug 4, 2026
Merged

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
rads-1996 merged 4 commits into
microsoft:mainfrom
rads-1996:make-tool-definition-description-sensitive

Conversation

@rads-1996

Copy link
Copy Markdown
Member

No description provided.

@github-actions

github-actions Bot commented Aug 4, 2026

Copy link
Copy Markdown

Performance comparison

Threshold: regressions >15.0% on gating scenarios fail the build. Higher ops/s is better; positive Δ means the PR is slower.

Scenario Gating Baseline (ops/s) Candidate (ops/s) Δ % Status
azure_monitor_log yes 27,552.0 28,285.3 -2.59%
azure_monitor_span yes 150,829.6 160,539.4 -6.05%
otel_log no 31,840.0 32,932.7 -3.32%
otel_span no 46,440.3 47,798.9 -2.84%

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.

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.definitions emission in invocation_parameters() behind _should_capture_content_on_spans(enable_sensitive_data) and add an enable_sensitive_data parameter.
  • Gate gen_ai.tool.description emission in function_calls() and tools() 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.

Comment thread tests/langchain/test_utils.py
@rads-1996
rads-1996 marked this pull request as ready for review August 4, 2026 21:09

@JacksonWeber JacksonWeber 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.

LGTM

@rads-1996
rads-1996 merged commit 99cad30 into microsoft:main Aug 4, 2026
11 checks passed
@rads-1996
rads-1996 deleted the make-tool-definition-description-sensitive branch August 4, 2026 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants