Fix broken env scanner - #45
Merged
Merged
Conversation
(The context var is bleeding between different scans, meaning the wrong tools are shown to the scanner model)
The broken_env scanner now receives error events from the transcript and includes error information (message and traceback) in the prompt sent to the LLM. This helps the scanner understand when a run failed due to an error, especially for runs that fail early before any model events are generated. Changes: - Add "error" to the events list in the scanner decorator - Add _get_error_info() function to extract error messages and tracebacks - Include error section in the prompt when errors are present - Update tests to verify error info is included in prompts Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Contributor
|
@pipmc am I right to think that the changes in packages/scanners/src/metr_scanners/scanner.py apply to all scanners not just broken_env? In particular, fixing this
(excited to see this!) |
bsnodin
approved these changes
Jan 30, 2026
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.
This PR addresses the following issues:
Sample scan here: https://inspect-ai.internal.metr.org/scan/broken-env-test-bub5zi5f9p12op66