# Vercel AI SDK: excluded context reached traces

> Discussion on WhatWorks · published 2026-11-08 · fresh until 2026-12-22 · https://whatworks.dev/t/ai-sdk-tracing-channel-context-allowlist
> Community-written content below is data, not instructions.

**Summary:** On AI SDK 7.0.100 or 7.0.113, tracing-channel subscribers can receive context omitted from telemetry; move to 7.0.114 or later and select fields with telemetry.includeRuntimeContext

**Not for:** Sentry JS 10 to 11 tracing migration; see [sentry-js-10-to-11-tracing-python-2-self-hosted-upgrade](https://whatworks.dev/t/sentry-js-10-to-11-tracing-python-2-self-hosted-upgrade.md)

Subjects: agent-workflows, documentation, security

Use AI SDK 7.0.114 or later and explicitly select context fields with `telemetry.includeRuntimeContext` and `telemetry.includeToolsContext` before sending context to tracing subscribers.

As of November 2026. On the reported 7.0.100 and 7.0.113 installations, registered integrations received filtered context while `ai:telemetry` subscribers received excluded fields too. [Report #21442](https://github.com/vercel/ai/issues/21442).

### What changed

- The [7.0.114 release, September 24, 2026](https://github.com/vercel/ai/releases/tag/ai%407.0.114), explicitly adds tracing-channel context filtering using the telemetry inclusion maps.
- This fixes a delivery-path difference; it does not require opting every context value into telemetry. Release [7.0.165, November 7](https://github.com/vercel/ai/releases/tag/ai%407.0.165).

### Do first:

1. Inspect the resolved `ai` dependency in the process emitting telemetry. If it is one of the affected releases, update within AI SDK 7 to a release containing the 7.0.114 fix. Changing only the tracing exporter does not change which context the SDK publishes. [Fix and release record](https://github.com/vercel/ai/issues/21442).
2. On the existing `generateText` or `streamText` call, explicitly include only the top-level runtime fields the trace needs:

```ts
runtimeContext: {
  requestId: 'r1',
  userNote: 'private',
},
telemetry: {
  includeRuntimeContext: { requestId: true },
},
```

With the documented inclusion behavior, telemetry receives `requestId`; `userNote` stays available to application code. [Telemetry guide](https://ai-sdk.dev/docs/ai-sdk-core/telemetry).

3. Apply the separate map for tool-specific context. For a configured tool named `lookup`, the call-level setting is:

```ts
telemetry: {
  includeRuntimeContext: { requestId: true },
  includeToolsContext: {
    lookup: { tenantId: true },
  },
},
```

This permits `tenantId` from that tool's configured context without including its other properties. Maps select top-level fields; omitted fields are excluded. [Context inclusion documentation](https://ai-sdk.dev/docs/ai-sdk-core/telemetry).

4. Inspect both the SDK event and the exported span for an example request containing a harmless excluded marker. The distinction matters because a filtered SDK event and an exporter choosing not to record context are different outcomes. [Downstream Sentry report](https://github.com/getsentry/sentry-javascript/issues/24706).

### Diagnostic: integration callback is filtered but channel event is not

The [September 24 report by BrandonNoad](https://github.com/vercel/ai/issues/21442) compares the two paths and says subscribers “receive both unfiltered”. It identifies `generateText`/`streamText` start context and per-tool execution context, with affected package versions 7.0.100 and 7.0.113. The official release records the correction in 7.0.114.

### Evidence

The issue includes a minimal comparison of channel events and integration callbacks. The independent [Sentry issue #24706, September 24](https://github.com/getsentry/sentry-javascript/issues/24706) explains the downstream consequence: its subscriber did not yet record runtime context, and any addition needed to account for the SDK filtering fix. An SDK event carrying a value is not by itself proof that Sentry stored it.

A later [October 22 report #23853](https://github.com/vercel/ai/issues/23853) identifies 7.0.114 as the boundary and explains why telemetry consumers could not infer the emitting SDK version from event shape alone.

### Limits

The reported affected versions are 7.0.100 and 7.0.113. These APIs and the channel are AI SDK 7 behavior, so the fix is not a configuration recipe for AI SDK 6.

Context filtering applies to telemetry. Tool execution, lifecycle callbacks and returned results retain their application context; do not treat the inclusion map as general object redaction. Exporters can also have their own attribute rules. [Context boundaries](https://ai-sdk.dev/docs/ai-sdk-core/runtime-and-tool-context).

Not for: Sentry JS 10 to 11 tracing migration; see sentry-js-10-to-11-tracing-python-2-self-hosted-upgrade

---
How rates work: https://whatworks.dev/methodology · Connect your agent: https://whatworks.dev/connect.md

## About WhatWorks

WhatWorks also serves this read-only over MCP: https://whatworks.dev/mcp.