FEAT: Chain-of-Thought Rendering for Attack Results and Scenario Results#2269
Open
ValbuenaVC wants to merge 6 commits into
Open
FEAT: Chain-of-Thought Rendering for Attack Results and Scenario Results#2269ValbuenaVC wants to merge 6 commits into
ValbuenaVC wants to merge 6 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds opt-in provider reasoning-summary rendering across conversation, attack-result, and scenario-result output.
Changes:
- Parses and validates OpenAI reasoning-summary payloads.
- Adds pretty and Markdown rendering with reasoning hidden by default.
- Propagates reasoning options through helpers and adds unit coverage.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
pyrit/output/conversation/base.py |
Adds reasoning filtering and parsing. |
pyrit/output/conversation/pretty.py |
Renders pretty reasoning blocks. |
pyrit/output/conversation/markdown.py |
Renders Markdown reasoning blocks. |
pyrit/output/attack_result/base.py |
Extends the rendering contract. |
pyrit/output/attack_result/pretty.py |
Propagates reasoning through pretty output. |
pyrit/output/attack_result/markdown.py |
Propagates reasoning through Markdown output. |
pyrit/output/scenario_result/base.py |
Extends the scenario rendering contract. |
pyrit/output/scenario_result/pretty.py |
Adds scenario-level reasoning output. |
pyrit/output/helpers.py |
Exposes reasoning options in helpers. |
tests/unit/output/conftest.py |
Adds shared reasoning fixtures. |
tests/unit/output/conversation/test_reasoning.py |
Tests parsing, visibility, and formatting. |
tests/unit/output/attack_result/test_pretty.py |
Tests pretty attack reasoning. |
tests/unit/output/attack_result/test_markdown.py |
Tests Markdown attack reasoning. |
tests/unit/output/scenario_result/test_pretty.py |
Tests scenario reasoning output. |
tests/unit/output/test_helpers.py |
Tests helper argument forwarding. |
ValbuenaVC
marked this pull request as ready for review
July 24, 2026 22:40
added 2 commits
July 24, 2026 16:56
…c to _render_attack_reasoning_summaries_async for clarity.
…://github.com/ValbuenaVC/PyRIT into vvalbuena-microsoft-plan-cot-output-rendering Merge latest changes from main.
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 17 out of 17 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
pyrit/output/scenario_result/pretty.py:341
- When scenario reasoning is enabled, this nested attack printer renders each full objective conversation, and
PrettyConversationMemoryPrinterdisplays everyimage_pathpiece in notebooks. Because this printer is always created with its defaultblur_images=Falseandoutput_scenario_asyncexposes no blur option, requesting reasoning summaries can unexpectedly display unblurred attack images with no way for callers to opt into the safety control available onoutput_attack_async. Please either render only the reasoning blocks or plumb the image-blur settings through the scenario API and nested printer.
attack_result_printer = PrettyAttackResultMemoryPrinter(
sink=sink,
width=width,
indent_size=indent_size,
enable_colors=enable_colors,
)
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.
Description
Adds opt-in rendering of OpenAI Responses API reasoning summaries across PyRIT’s output layer.
This PR:
include_reasoning_trace=Falseto conversation, attack-result, and scenario-result output APIs.<reasoning-summary>tags in subdued gray for Pretty output.\<reasoning-summary\>tags in Markdown.No breaking behavior is introduced because reasoning remains opt-in.
Background and Scope
The original story also requested investigation into JSON Schema adoption for scorers and attacks.
That infrastructure and adoption already landed through:
Schemas remain domain-specific; this PR does not introduce a universal response schema or change target/scorer/attack semantics.
CoPyRIT already maps persisted reasoning pieces into its existing Reasoning panel and has mapper/component test coverage. This PR adds the missing PyRIT output parity. CoPyRIT currently has no scenario-results UI, so scenario frontend rendering is outside this PR.
Tests and Documentation
Added or expanded unit coverage for:
Local results:
171 passedpyrit.output:98%statement coverageUpdated the paired output documentation with conversation, attack, and scenario examples and clarification that OpenAI exposes summaries rather than raw chain-of-thought.