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
Conversation
rads-1996
force-pushed
the
make-tool-definition-description-sensitive
branch
from
August 11, 2026 23:57
b21b2e2 to
d079031
Compare
gen_ai.tool.definitions and gen_ai.tool.description as sensitive attributes per semconv spec updategen_ai.tool.definitions and gen_ai.tool.description as sensitive attributes per semconv spec update
rads-1996
force-pushed
the
make-tool-definition-description-sensitive
branch
from
August 12, 2026 16:18
b7bf74e to
04d1fb9
Compare
Pull request dashboard statusWaiting on reviewers · refreshed 2026-08-12 23:22 UTC Review the latest changes. Status above doesn't look right?
|
Contributor
There was a problem hiding this comment.
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.descriptionon tool spans behind span content-capture (should_capture_content_on_span) at span-creation time. - Gate
gen_ai.tool.definitionsemission viaget_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_CONTENTand 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.
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.
Description
Fixes #360
Type of change
Please delete options that are not relevant.
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.
Checklist
See CONTRIBUTING.md
for the style guide, changelog guidance, and more.