fix: use shallow clone to prevent reward hacking via git history#114
Open
neubig wants to merge 3 commits intocommit-0:mainfrom
Open
fix: use shallow clone to prevent reward hacking via git history#114neubig wants to merge 3 commits intocommit-0:mainfrom
neubig wants to merge 3 commits intocommit-0:mainfrom
Conversation
Use --depth 1 when cloning repositories to prevent agents from accessing git history and exploiting it to retrieve original function implementations that were stripped out. This addresses a reward hacking vulnerability where agents can use git log/diff/show commands to find and copy original implementations instead of writing them from scratch. For Commit0Spec, also fetch the specific env_setup_commit with --depth 1 before resetting to it, since shallow clone only gets the default branch tip. Co-authored-by: openhands <openhands@all-hands.dev>
The shallow clone only fetches the latest commit, but the setup scripts need access to both env_setup_commit (reference_commit) and base_commit for the git reset operations. - Commit0Spec: Fetch both env_setup_commit and base_commit before removing remote - SWEBenchSpec: Fetch base_commit needed for eval script reset Co-authored-by: openhands <openhands@all-hands.dev>
Modal requires authentication tokens that aren't available to fork PRs. Using the local Docker backend allows CI to run without Modal credentials. Co-authored-by: openhands <openhands@all-hands.dev>
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
Use
--depth 1when cloning repositories to prevent agents from accessing git history and exploiting it to retrieve original function implementations.Fixes #113