From 0e0c42ff93d792c96d57c73807cd7f0a772b45aa Mon Sep 17 00:00:00 2001 From: Karir Date: Tue, 23 Sep 2025 08:12:37 -0400 Subject: [PATCH 1/2] Fix: Always display objective scores; auxiliary scores shown only if requested (Issue #1096) --- .../executor/attack/printer/console_printer.py | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/pyrit/executor/attack/printer/console_printer.py b/pyrit/executor/attack/printer/console_printer.py index 7f954fd4e..5c8e61f4c 100644 --- a/pyrit/executor/attack/printer/console_printer.py +++ b/pyrit/executor/attack/printer/console_printer.py @@ -152,13 +152,19 @@ async def print_conversation_async( # Display images if present await display_image_response(piece) - # Print scores with better formatting (only if auxiliary scores are requested) + # Always print objective scores + scores = self._memory.get_prompt_scores(prompt_ids=[str(piece.id)]) + if scores: + print() + self._print_colored(f"{self._indent}📊 Scores:", Style.DIM, Fore.MAGENTA) + for score in scores: + if score.score_category == "objective": + self._print_score(score) + + # Print auxiliary scores only if requested if include_auxiliary_scores: - scores = self._memory.get_prompt_scores(prompt_ids=[str(piece.id)]) - if scores: - print() - self._print_colored(f"{self._indent}📊 Scores:", Style.DIM, Fore.MAGENTA) - for score in scores: + for score in scores: + if score.score_category == "auxiliary": self._print_score(score) print() From 75692c8e45de85edabbde55167a2ed7f700e29ed Mon Sep 17 00:00:00 2001 From: Raghav Chowdary <86942586+raghavendrakari@users.noreply.github.com> Date: Tue, 23 Sep 2025 18:19:47 -0400 Subject: [PATCH 2/2] Update pyrit/executor/attack/printer/console_printer.py Apply reviewer suggestion: use list comprehension for objective score Co-authored-by: hannahwestra25 --- pyrit/executor/attack/printer/console_printer.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pyrit/executor/attack/printer/console_printer.py b/pyrit/executor/attack/printer/console_printer.py index 5c8e61f4c..272d275bb 100644 --- a/pyrit/executor/attack/printer/console_printer.py +++ b/pyrit/executor/attack/printer/console_printer.py @@ -157,9 +157,8 @@ async def print_conversation_async( if scores: print() self._print_colored(f"{self._indent}📊 Scores:", Style.DIM, Fore.MAGENTA) - for score in scores: - if score.score_category == "objective": - self._print_score(score) + objective_score = [score for score in scores if score.score_category == "objective"][0] + self.print_score(objective_score) # Print auxiliary scores only if requested if include_auxiliary_scores: