fix: redact inline file data in prompt logs#1407
Open
atharvasingh7007 wants to merge 1 commit intosimonw:mainfrom
Open
fix: redact inline file data in prompt logs#1407atharvasingh7007 wants to merge 1 commit intosimonw:mainfrom
atharvasingh7007 wants to merge 1 commit intosimonw:mainfrom
Conversation
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
file.file_datawhen prompt JSON is logged, alongside the existingimage_url.urlandinput_audio.datahandlingredact_data()regression covering inline image, audio, and file payloads while preserving external URLs andfile_idprompt_jsonRoot cause
PDF attachments are encoded as inline
{type: file, file: {file_data: data:application/pdf;base64,...}}payloads before they hitredact_data(), butredact_data()only knew how to scrubimage_url.urlandinput_audio.data. That left the full base64 PDF content inresponses.prompt_json.Testing
python -m pytest tests/test_cli_openai_models.pypython -m ruff check .python -m mypy llmCloses #1396