FEAT: add ANSI escape output scorers - #2689
Open
Utkarsh Bahuguna (u7k4rs6) wants to merge 1 commit into
Open
Utkarsh Bahuguna (u7k4rs6) wants to merge 1 commit into
Utkarsh Bahuguna (u7k4rs6) wants to merge 1 commit into
Conversation
Contributor
|
Is this a duplicate of #2688 ? |
Contributor
Author
|
Roman Lutz (@romanlutz) No, they’re separate. #2688 adds the ANSI output scorers, while #2689 addresses a different part of the ANSI-related work. There’s no duplicate implementation between the two. |
Contributor
|
Identical PR title and the same classes mentioned in the description suggest otherwise (?) Please make the distinction clear. |
Contributor
Author
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
Adds dedicated output scorers for detecting ANSI escape sequences in model outputs, based on the detection patterns used by Garak's
AnsiEscapedetector.Changes
Added
AnsiEscapeOutputScorerESC[) and OSC (ESC]) sequences, as well as C1 CSI/OSC characters.Added
EscapedAnsiOutputScorer\x1b,\033,\u001b,\27,\e,\x9b, and\x9drepresentations.Added scorer exports through the existing PyRIT scoring package.
Added Garak provenance metadata for the detector patterns.
Added comprehensive unit tests covering:
Updated the scorer documentation and corresponding Jupyter notebook.
Scope
This PR implements the scorer portion of the ANSI escape support described in #2683. The Garak
AnsiEscapescenario and techniques are intentionally left for a follow-up PR.Part 1 of #2683.