fix(llm): redact credentials from session trace headers - #120
Closed
NianJiuZst wants to merge 1 commit into
Closed
NianJiuZst wants to merge 1 commit into
NianJiuZst wants to merge 1 commit into
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.
Session traces copied API credentials into JSON files whenever tracing was enabled, including its default configuration. Redact credential-bearing request and response headers before handing trace records to the recorder, while sending the original authentication headers to the model endpoint.
关联 Issue
Closes #118
变更类型
影响范围
extensions/llmHTTP transport and its filesystem trace integration tests.变更说明
Redaction is case-insensitive for
authorization,proxy-authorization,x-api-key,api-key,cookieandset-cookie. It covers ordinary and streaming requests, successful responses, HTTP errors, empty streams and network failures. Other diagnostic headers, status and body information remain available.This prevents new header credential leaks. It does not rewrite existing trace files or attempt general-purpose redaction of arbitrary request/response bodies.
测试计划
pnpm exec vitest run extensions/llm/src/http-transport.test.ts tests/integration/session-trace.test.ts— 47 passed.pnpm check— passed; 1,532 tests passed, 7 skipped.pnpm test:coverage— passed.自检清单
Validation was performed on macOS arm64 with Node.js 26.8.1. The repository's Windows/Linux CI remains the cross-platform validation gate.