Skip to content

Conversation

@hashirventhodi
Copy link
Contributor

Potential fix for https://github.com/brokle-ai/brokle-python/security/code-scanning/9

To resolve this issue, we need to ensure that API keys (even partial) are never included in log messages. The fix should replace any value for api_key in the context info dictionary with a static placeholder such as "<hidden>" or simply omit the field from the dictionary returned by get_info(). This change needs to happen in brokle/observability/context.py inside the ObservabilityContext.get_info() method. By ensuring that api_key is never shown, downstream code (like scripts/final_validation.py) will never leak even partial keys in logs.

No changes are required in the logging or reporting functions themselves; the root is the info exposed via get_info/get_context_info.


Suggested fixes powered by Copilot Autofix. Review carefully before merging.

…nsitive information

Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
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.

2 participants