fix(server): mask caller-supplied llm_configs api_key in persisted requests (RENG-39) - #153
Open
Liewzheng wants to merge 1 commit into
Open
fix(server): mask caller-supplied llm_configs api_key in persisted requests (RENG-39)#153Liewzheng wants to merge 1 commit into
Liewzheng wants to merge 1 commit into
Conversation
…ng reviews.request (RENG-39) (0.10.2) Explicit llm_configs in a ReviewRequest were serialized verbatim into the reviews.request column, leaking live LLM API keys into the DB. Masking now happens at the single persistence choke point (enqueue_review): each llm_configs[i].api_key is stored as the *** sentinel (empty stays empty), using the same projection as GET /config. The in-memory config driving the review keeps the live key. A rerun replays the persisted (masked) request, so a masked key is resolved for execution like the POST /config/models probe: fall back to the server-side config with the same api_base; unmatched masks are kept and fail explicitly at the provider. Reruns of legacy plaintext rows re-persist masked instead of copying the leak forward. Existing rows are not rewritten (no migration); CHANGELOG documents cleanup SQL/options for pre-0.10.2 history.
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
Masks the caller-supplied
api_keyinsidellm_configsbefore a review request is persisted, and fixes rerun matching to backfill against the masked request.Changes
enqueue_reviewis the one place wherereviews.requestis written to the DB — the caller'sllm_configs[*].api_keyis replaced with a masked form there, so no other code path can leak a raw key into storage.(provider, api_base)instead of the (now-masked)api_key, so re-running a review still finds and backfills the right persisted request.Test evidence
Notes
Plane: RENG-39