Skip to content

fix(clients): stop logging full OpenRouter request/response payloads - #597

Open
carfeii wants to merge 1 commit into
AsyncFuncAI:mainfrom
carfeii:fix/openrouter-sensitive-logging
Open

carfeii wants to merge 1 commit into
AsyncFuncAI:mainfrom
carfeii:fix/openrouter-sensitive-logging

Conversation

@carfeii

@carfeii carfeii commented Oct 5, 2026

Copy link
Copy Markdown

OpenRouterClient.acall logged the entire api_kwargs (the full prompt, including repository source embedded in it) and the entire provider response at INFO. The application's default logging configuration writes INFO-level logs to a rotating file the deployment persists on disk, so any principal with log access gained the full source context and conversation content for every OpenRouter-backed request.

Logs only sizing/model metadata (model name, message count and total character length, response status, choice count, token usage) instead of the payload/response content.

Test plan

  • pytest tests/unit/test_openrouter_logging.py: new regression test passes, asserting the planted secret strings never appear in any log record.
  • Confirmed the test fails against the pre-fix code (both secrets appear in the captured log records).

OpenRouterClient.acall logged the entire api_kwargs (the full prompt,
including repository source embedded in it) and the entire provider
response at INFO. The application's default logging configuration
writes INFO-level logs to a rotating file the deployment persists on
disk, so any principal with log access gained the full source context
and conversation content for every OpenRouter-backed request.

Log only sizing/model metadata (model name, message count and total
character length, response status, choice count, token usage) instead
of the payload/response content.

Adds a regression test in tests/unit/test_openrouter_logging.py,
including fail-before coverage run against the unpatched code.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Your trial has ended. Reactivate Greptile to resume code reviews.

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.

1 participant