Skip to content

Conversation

@constantinius
Copy link
Contributor

Description

Binary content is useless to us, so we remove it from the message parts of type "blob"

Issues

Contributes to https://linear.app/getsentry/issue/TET-1616/redact-images-in-python-sdk-input-messages

@constantinius constantinius requested a review from a team as a code owner December 17, 2025 09:47
@linear
Copy link

linear bot commented Dec 17, 2025

for item in content:
if item.get("type") == "blob":
item["content"] = SENSITIVE_DATA_SUBSTITUTE
return messages
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Redaction mutates outbound AI request messages

redact_blob_message_parts mutates messages (and nested content items) in place and is called from truncate_and_annotate_messages. Several integrations build messages via shallow copies (or reuse original dicts), so this can replace blob content in the original request payload before the provider call, potentially stripping images/binary inputs and changing model behavior.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the concern is valid, we shouldn't modify anything the user has a reference on @constantinius.

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