Skip to content

Mark gen_ai.tool.definitions and gen_ai.tool.description as sensitive attributes per semconv spec update - #377

Open
rads-1996 wants to merge 8 commits into
open-telemetry:mainfrom
rads-1996:make-tool-definition-description-sensitive
Open

Mark gen_ai.tool.definitions and gen_ai.tool.description as sensitive attributes per semconv spec update#377
rads-1996 wants to merge 8 commits into
open-telemetry:mainfrom
rads-1996:make-tool-definition-description-sensitive

Conversation

@rads-1996

Copy link
Copy Markdown
Contributor

Description

Fixes #360

Type of change

Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How has this been tested?

Please describe the tests that you ran to verify your changes. Provide
instructions so we can reproduce. List any relevant details for your test
configuration.

  • Unit/conformance tests have been executed for the packages modified

Checklist

See CONTRIBUTING.md
for the style guide, changelog guidance, and more.

  • Followed the style guidelines of this project
  • Changelog updated if the change requires an entry
  • Unit tests added
  • Documentation updated

@rads-1996
rads-1996 force-pushed the make-tool-definition-description-sensitive branch from b21b2e2 to d079031 Compare August 11, 2026 23:57
@rads-1996 rads-1996 changed the title Make gen_ai.tool.definitions and gen_ai.tool.description as sensitive attributes per semconv spec update Mark gen_ai.tool.definitions and gen_ai.tool.description as sensitive attributes per semconv spec update Aug 11, 2026
@rads-1996
rads-1996 force-pushed the make-tool-definition-description-sensitive branch from b7bf74e to 04d1fb9 Compare August 12, 2026 16:18
@rads-1996
rads-1996 marked this pull request as ready for review August 12, 2026 22:05
@rads-1996
rads-1996 requested a review from a team as a code owner August 12, 2026 22:05
Copilot AI lite review requested due to automatic review settings August 12, 2026 22:05
@opentelemetry-pr-dashboard

opentelemetry-pr-dashboard Bot commented Aug 12, 2026

Copy link
Copy Markdown

Pull request dashboard status

Waiting on reviewers · refreshed 2026-08-12 23:22 UTC

Review the latest changes.

Status above doesn't look right?
  • Just replied or pushed? Anything around or after the refresh time above may not be picked up yet — give it a few minutes.
  • Anything look wrong? Report it with what you expected; it helps us improve the dashboard.

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 GenAI content-capture behavior to align with the updated semantic conventions by treating gen_ai.tool.definitions and gen_ai.tool.description as sensitive and omitting them from spans when span content capture is disabled, with corresponding cross-package test updates.

Changes:

  • Gate gen_ai.tool.description on tool spans behind span content-capture (should_capture_content_on_span) at span-creation time.
  • Gate gen_ai.tool.definitions emission via get_content_attributes(..., for_span=...) so it is only recorded on the relevant signal (span vs event) when content capture targets that signal.
  • Update unit/integration tests across util + multiple instrumentations to assert tool description/definitions are omitted under NO_CONTENT and present when capture is enabled; add towncrier fragments.

Reviewed changes

Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.

Show a summary per file
File Description
util/opentelemetry-util-genai/tests/test_toolcall.py Ensures tool span start attributes (including description) are only asserted under span content capture.
util/opentelemetry-util-genai/tests/test_handler_agent.py Adds coverage that tool definitions are omitted from spans when content capture is disabled.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_tool_invocation.py Gates gen_ai.tool.description at span creation based on should_capture_content_on_span.
util/opentelemetry-util-genai/src/opentelemetry/util/genai/_invocation.py Changes content attribute serialization to omit tool definitions when content capture does not target the signal.
util/opentelemetry-util-genai/.changelog/377.added Adds release note fragment for sensitive tool attributes.
instrumentation/opentelemetry-instrumentation-google-genai/tests/utils/test_tool_call_wrapper.py Updates wrapper tests to assert tool description is omitted without content capture.
instrumentation/opentelemetry-instrumentation-google-genai/tests/interactions/base.py Adds test asserting tool definitions are omitted on spans when content capture is off.
instrumentation/opentelemetry-instrumentation-google-genai/tests/generate_content/nonstreaming_base.py Updates no-content expectations to ensure tool definitions are absent from events/spans.
instrumentation/opentelemetry-instrumentation-google-genai/.changelog/377.added Adds release note fragment for sensitive tool attributes.
instrumentation/opentelemetry-instrumentation-genai-qwen-agent/tests/test_tool.py Extends no-content test assertions to include tool description omission.
instrumentation/opentelemetry-instrumentation-genai-qwen-agent/.changelog/377.added Adds release note fragment for sensitive tool attributes.
instrumentation/opentelemetry-instrumentation-genai-openai/tests/test_chat_completions.py Updates tests to assert tool definitions are not present when content capture is off.
instrumentation/opentelemetry-instrumentation-genai-openai/tests/test_async_chat_completions.py Same as sync: asserts tool definitions omitted when content capture is off.
instrumentation/opentelemetry-instrumentation-genai-openai/.changelog/377.added Adds release note fragment for sensitive tool attributes.
instrumentation/opentelemetry-instrumentation-genai-langchain/tests/test_tools.py Adds tests around tool description/definitions behavior under different content capture modes.
instrumentation/opentelemetry-instrumentation-genai-langchain/tests/test_llm_call.py Adds test asserting legacy OpenAI tool definitions are omitted when content capture is disabled.
instrumentation/opentelemetry-instrumentation-genai-langchain/.changelog/377.added Adds release note fragment for sensitive tool attributes.
instrumentation/opentelemetry-instrumentation-genai-agno/tests/test_tools.py Updates/extends tests to cover tool definitions omission without span capture; adds needed imports/mode coverage.
instrumentation/opentelemetry-instrumentation-genai-agno/tests/requirements.oldest.txt Ensures oldest tests install workspace util dependency as needed.
instrumentation/opentelemetry-instrumentation-genai-agno/.changelog/377.added Adds release note fragment for sensitive tool attributes.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread util/opentelemetry-util-genai/.changelog/377.added Outdated
Comment thread instrumentation/opentelemetry-instrumentation-google-genai/.changelog/377.added Outdated
Comment thread instrumentation/opentelemetry-instrumentation-genai-openai/.changelog/377.added Outdated
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.

Gate gen_ai.tool.definitions and gen_ai.tool.description as sensitive attributes per spec update

2 participants