Skip to content

fix(llm): redact credentials from session trace headers - #120

Closed
NianJiuZst wants to merge 1 commit into
stepfun-ai:mainfrom
NianJiuZst:fix/118-redact-trace-credentials
Closed

NianJiuZst wants to merge 1 commit into
stepfun-ai:mainfrom
NianJiuZst:fix/118-redact-trace-credentials

Conversation

@NianJiuZst

Copy link
Copy Markdown

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

变更类型

  • fix bug 修复

影响范围

extensions/llm HTTP transport and its filesystem trace integration tests.

变更说明

Redaction is case-insensitive for authorization, proxy-authorization, x-api-key, api-key, cookie and set-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.

测试计划

  • Before the fix: all 8 new regression cases failed, including the real filesystem trace check.
  • 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.

自检清单

  • Local checks and Git hooks passed without bypassing hooks.
  • Tests call the production transport; only fetch is mocked, and the integration test writes a real temporary trace file.
  • Synthetic credentials only; no binaries, generated artifacts or real credentials included.

Validation was performed on macOS arm64 with Node.js 26.8.1. The repository's Windows/Linux CI remains the cross-platform validation gate.

@github-actions github-actions Bot added the area/extensions extensions/llm, extensions/mcp (non realtime-*) label Sep 20, 2026
@ZouR-Ma ZouR-Ma closed this Sep 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/extensions extensions/llm, extensions/mcp (non realtime-*)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[bug] Session traces persist API credentials in plaintext headers

2 participants