-
Notifications
You must be signed in to change notification settings - Fork 647
feat(anthropic): Gate prompt collection on data_collection option #7054
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+492
−22
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
182c4c3
feat(anthropic): Gate prompt collection on data_collection option
ericapisani adb28ae
Move test coverage on tools to dedicated test.
ericapisani c16adff
return early
ericapisani ca1c3d1
cleanup
ericapisani 83b9075
Trigger Build
ericapisani File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Anthropic response text/tool calls ignore data_collection gen_ai.outputs opt-out
This change gates prompt (input) collection on
data_collection["gen_ai"]["inputs"], but_set_output_data(line 609) still recordsGEN_AI_RESPONSE_TEXTandGEN_AI_RESPONSE_TOOL_CALLSbased solely on the legacyshould_send_default_pii() and integration.include_promptscheck, so a user who sets_experiments={"data_collection": {"gen_ai": {"outputs": False}}}while still havingsend_default_pii=Truewill keep sending LLM response content — which frequently echoes user PII — to Sentry despite the explicit opt-out and despite the SDK warning thatsend_default_pii"is ignored whendata_collectionis set".Evidence
_set_common_input_data(this hunk) now resolvesrecord_inputsfromclient.options["data_collection"]["gen_ai"]["inputs"], falling back toshould_send_default_pii() and integration.include_promptsonly whenhas_data_collection_enabled()is false._set_output_data(line 609) gatesGEN_AI_RESPONSE_TEXT/GEN_AI_RESPONSE_TOOL_CALLSonly onshould_send_default_pii() and integration.include_prompts; it never readsoptions["data_collection"]["gen_ai"]["outputs"](confirmed via grep — nodata_collectionreference in the output path).data_collection._gen_ai_from_valuesupports an explicitoutputs: False, and_resolve_data_collectiondocuments thatdata_collectionwins oversend_default_pii, emitting a DeprecationWarning thatsend_default_pii"is ignored whendata_collectionis set."send_default_pii=Trueplusdata_collection={"gen_ai": {"outputs": False}}, the resolved config says outputs are off, yet the legacy check at line 609 still evaluates true and response text is attached to the span and sent to Sentry.Identified by Warden · security-review · JXZ-LMZ