feat: add sensitiveContext property to Tool#14777
Merged
Merged
Conversation
nicoalbanese
approved these changes
Apr 28, 2026
Merged
2 tasks
lgrammel
added a commit
that referenced
this pull request
May 5, 2026
…xt and make it opt-in (#14996) ## Background The sensitiveContext tool option for excluding tool context properties from telemetry was introduced in #14777 However, it should be secure-by-default, ie runtime context properties should only be exposed to telemetry if they have been explicitly marked for that purpose. ## Summary * move `sensitiveContext` from `Tool` to `telemetry.includeToolsContext` * make it opt-in, i.e. tools context properties have to be marked as `true` to be forwarded to telemetry ## Manual Verification Run examples and verify telemetry logging - [x] `examples/ai-functions/src/telemetry/console/tool-loop-agent-generate.ts` - [x] `examples/ai-functions/src/telemetry/console/tool-loop-agent-stream.ts` ## Related Issues Builds on #14777 Follow up from #14995
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.
Background
The
contextfor tools can contain information that should not be exposed to telemetry, e.g. credentials.Summary
sensitiveContextproperty onTool.Manual Verification
Run and verify that only non-sensitive tool context is logged in telemetry.
examples/ai-functions/src/telemetry/console/tool-loop-agent-generate.tsexamples/ai-functions/src/telemetry/console/tool-loop-agent-stream.tsRelated Issues
Follow up from #14757