Skip to content

feat: add sensitiveContext property to Tool#14777

Merged
lgrammel merged 8 commits into
mainfrom
lg/LgivGMuR
Apr 28, 2026
Merged

feat: add sensitiveContext property to Tool#14777
lgrammel merged 8 commits into
mainfrom
lg/LgivGMuR

Conversation

@lgrammel
Copy link
Copy Markdown
Collaborator

@lgrammel lgrammel commented Apr 28, 2026

Background

The context for tools can contain information that should not be exposed to telemetry, e.g. credentials.

Summary

  • introduce filtering based on sensitiveContext property on Tool.

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.ts
  • examples/ai-functions/src/telemetry/console/tool-loop-agent-stream.ts

Related Issues

Follow up from #14757

@lgrammel lgrammel changed the title Lg/lgiv g mu r feat: add sensitiveContext property to Tool Apr 28, 2026
@lgrammel lgrammel marked this pull request as ready for review April 28, 2026 13:49
@lgrammel lgrammel merged commit 67df0a0 into main Apr 28, 2026
18 checks passed
@lgrammel lgrammel deleted the lg/LgivGMuR branch April 28, 2026 14:06
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
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.

2 participants