fix: redact GitHub token from git clone error messages in eval engine#87
Open
gn00295120 wants to merge 2 commits intoanthropics:mainfrom
Open
fix: redact GitHub token from git clone error messages in eval engine#87gn00295120 wants to merge 2 commits intoanthropics:mainfrom
gn00295120 wants to merge 2 commits intoanthropics:mainfrom
Conversation
When git clone fails, git may echo the clone URL in stderr. Since the GitHub token is embedded in the URL, it appears in the error message which is logged and saved to the JSON result file. In CI/CD environments this means the token is exposed in workflow logs visible to all repository collaborators (or publicly for public repos). Redact the token from stderr before including it in error messages.
There was a problem hiding this comment.
Pull request overview
This PR mitigates accidental leakage of embedded GitHub tokens in eval-engine logs/results by redacting credentials from git clone failure output before it’s logged and persisted.
Changes:
- Capture
git clonestderr defensively (handle missing stderr). - Redact
self.github_tokenfrom the captured stderr prior to constructing/logging the error message.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. 🤖 Generated with Claude Code |
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.
Summary
When
git clonefails in the eval engine, git may echo the clone URL in stderr. Since the GitHub token is embedded in the URL (https://<TOKEN>@github.com/...), the token appears in error messages that are logged and saved to the JSON result file.Problem
In CI/CD environments, this means the token is exposed in:
Before fix:
After fix:
Changes
self.github_tokenfromstderrbefore including it in error messagesTest plan