Skip to content

fix: redact sensitive trace headers - #669

Open
rohan-patnaik wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
rohan-patnaik:fix-trace-header-redaction
Open

fix: redact sensitive trace headers#669
rohan-patnaik wants to merge 1 commit into
GoogleCloudPlatform:mainfrom
rohan-patnaik:fix-trace-header-redaction

Conversation

@rohan-patnaik

Copy link
Copy Markdown

What

Redacts sensitive HTTP headers before writing request and response entries to the trace journal.

The actual request sent to the provider is unchanged. Only the recorded trace output is sanitized.

Why

Trace files are useful for debugging provider calls, but they can currently include headers such as Authorization, cookies, API keys, tokens, or secrets. That makes trace files risky to share or store.

Fixes #617.

Testing

  • go test ./gollm -run TestJournalingRoundTripperRedactsSensitiveHeaders -count=1
  • git diff --check

Note: go test ./gollm currently fails on TestGetAnthropicModel/explicit_model_is_highest_priority on the current base branch. That failure is unrelated to this change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Trace file should filter sensitive headers

1 participant