Repository navigation
fix(security): normalize SENSITIVE_KEYS so api_key dict entries actually redact (#11762) - #11764
Merged
Merged
Conversation
Contributor
✅ SSOT Configuration Compliance: Passing🎉 No hardcoded values detected that have SSOT config equivalents! |
Auto-regenerated (py3.14) to match the backend schema so the required verify-generated-types gate passes. Triggered by auto-fix-generated-types.yml.
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.
Closes #11762
Thinking Path
redact_dictnormalizes each dict key (.lower().replace("_","").replace("-","")→api_key→apikey) butSENSITIVE_KEYSstored the un-normalized formsapi_key/apiKey/api-key— none can ever match, so API-key entries were only redacted if their VALUE happened to match the long-key regexes (sk- requires 20+ chars). Realistic keys leaked unredacted. Production consumer:llc/services/replay_service.pyredacts replay exports through this module. Found because #11730 exposed that this module's own test file never ran (never real-loaded in conftest).What Changed
llm_shared/credential_redaction.py:SENSITIVE_KEYSstored in normalized form (apikey, …) with a comment stating the invariant; the three un-normalized variants collapse to one entry.autobot-backend/conftest.py: real-loadllm_shared.credential_redactionso the co-located tests actually run from now on.Verification
llm_shared/tests/test_credential_redaction.py: was 4 failed / uncollectable → 6 passed (incl.test_redact_dict_simple,test_redact_dict_variations,test_safe_repr— the leaking cases).llc/tests/test_replay.py(production consumer suite): passes.SENSITIVE_KEYSexist (grep).Model Used
Claude Fable 5