ref: Make stream_gen_ai_spans opt out#6658
1 issue
Medium
Blob content (e.g. base64 images) no longer redacted from gen_ai spans when stream_gen_ai_spans defaults to True - `sentry_sdk/consts.py:1331`
This branch makes stream_gen_ai_spans opt-out (default True) via should_truncate_gen_ai_input in tracing_utils.py. With the new default, should_truncate_gen_ai_input returns False, so integrations use the raw normalized messages instead of routing them through truncate_and_annotate_messages. Because redact_blob_message_parts is only invoked inside truncate_and_annotate_messages/truncate_and_annotate_embedding_inputs, the unconditional blob redaction (replacing base64 image/blob content with [Filtered]) is now bypassed on the default code path. There is no equivalent redaction in the streaming (traces.py) path, so multi-modal prompt blobs are sent unredacted to Sentry whenever prompt capture is enabled (send_default_pii=True and include_prompts=True). This redaction was previously unconditional (applied even with PII enabled), so coupling it to the now-disabled truncation appears to be an unintended side effect.
4 skills analyzed
| Skill | Findings | Duration | Cost |
|---|---|---|---|
| security-review | 0 | 3.0s | $0.05 |
| code-review | 0 | 58.5s | $0.65 |
| find-bugs | 1 | 2m 14s | $0.78 |
| skill-scanner | 0 | 52.0s | $0.02 |
⏱ 4m 7s · 958.0k in / 29.9k out · $1.51