Skip to content

FEAT: GUI view existing scores#2189

Open
jbolor21 wants to merge 5 commits into
microsoft:mainfrom
jbolor21:jbolor/GUI_load_scores
Open

FEAT: GUI view existing scores#2189
jbolor21 wants to merge 5 commits into
microsoft:mainfrom
jbolor21:jbolor/GUI_load_scores

Conversation

@jbolor21

@jbolor21 jbolor21 commented Jul 14, 2026

Copy link
Copy Markdown
Contributor

Description

Surfaces the attack objectives and scores from existing conversations in the DB into the GUI/CoPyRIT chat view.

Whats new:

  • Objective Header: the conversation objective is now shown in an inline banner above the conversation. Long objectives are truncated with a toggle to view the full objective.
  • Score value: a clickable chip is shown with the score value in the top ribbon
  • When you click on the score value, you can see all scorer information including the rationale, scorer type, etc
  • The chip color is color coded red for 'False', green for 'True' and grey for NA/neutral.
  • Refactored History table outcome icons/colors into a shared utils/attackOutcome helper so the chat and history views stay consistent

Screenshots:
(see the new objective and score)
image

Click on score for details:
image

Tests and Documentation

New unit tests for the score chip, objective header, and the color. Existing full frontend test suite passes.

@rlundeen2

Copy link
Copy Markdown
Contributor

Love this already but haven't reviewed in depth yet :)

Comment thread frontend/src/App.tsx Outdated
Comment thread frontend/src/utils/scoreColor.ts Outdated
Comment thread frontend/src/components/Chat/AttackVerdictChip.tsx Outdated
Comment thread frontend/src/components/Chat/ChatWindow.tsx Outdated

@behnam-o behnam-o left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed with other comments, approved as long as those are resolved.

Comment thread frontend/src/components/Chat/AttackVerdictChip.tsx Outdated
Comment thread frontend/src/components/History/AttackTable.tsx Outdated
Comment on lines +624 to +627
<AttackVerdictChip
outcome={outcome}
score={lastScore}
appliesToActiveConversation={activeConversationId === conversationId}

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should render the verdict here at all when a related (non-main) conversation is active, rather than dimming it and adding a caveat. outcome/last_score are attack-level, computed on the main conversation's final turn — so putting a colored success/failure badge in the ribbon next to a different conversation's messages is misleading. Someone scanning the ribbon reads the badge color first; the "this is attack-level, not this conversation" note in the popover is easy to miss and only shows after a click.

The dimming + appliesToActiveConversation machinery is really working around the fact that this value doesn't belong on a related-conversation view. I'd gate it so the chip only shows on the main conversation (activeConversationId === conversationId) and drop the dimmed/attack-level-note branch entirely — simpler component, and no misleading state.

(If we do want related conversations to show their verdict eventually, the per-piece scores are already in the API — MessagePieceView.scores — so that'd be a separate, more accurate feature rather than surfacing the main conversation's score everywhere.)

[For attacks, it's not unreasonable to think that we might have an attack result page at some point, too. ]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants