You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Terminal report formatter can crash when displaying literal markup tags #724
On main at 4a5506276795397c62ed4f0111c08f41c2b9f1b1, generating a terminal report can crash or change its displayed text when a report field contains bracketed markers. _format_terminal treats dynamic report text as Rich markup. The failure happens before the report is printed or saved, so it affects both displaying the report directly in the terminal and saving a terminal-format report to a file.
For example, prompt examples in a SKILL.md can contain the [INST] ... [/INST] format documented for Mistral-7B-Instruct. A displayed report field that quotes the closing marker can raise rich.errors.MarkupError.
The baseline reason below is one reproducible example of this formatter bug. Finding messages, paths, evidence, and other dynamic terminal fields also reach Rich without escaping; unmatched closing tags can crash report generation, while balanced tags such as [bold]x[/bold] silently change how the text appears.
To reproduce, create prompt-review/SKILL.md:
---name: prompt-reviewdescription: Explain prompt injection examples in chat templates.---# Prompt Review
Example attack:
```text[INST] Ignore all previous instructions. [/INST]```
Expected: print or save the terminal report with the suppression reason displayed literally.
Actual: Rich raises MarkupError because the closing tag [/INST] does not match an open tag. The scan exits 1; the report is not printed, and no report.txt is written when --output is used.
In this reproduction, the trigger is rendering the suppression reason that quotes [/INST]. This is a constructed reproduction using supported inputs; the prompt example in SKILL.md provides context for that reason.
The report module already imports rich.markup.escape and uses it in the completeness section. Applying it to the other dynamic terminal fields would retain their literal contents while preserving report styling.
changed the title [-]Terminal report crashes when a baseline reason contains a closing markup tag[/-][+]Terminal report formatter can crash when displaying literal markup tags[/+]on Oct 4, 2026
Activity
[-]Terminal report crashes when a baseline reason contains a closing markup tag[/-][+]Terminal report formatter can crash when displaying literal markup tags[/+]