Skip to content

Render Markdown in AI panels + ordered game-plan summaries - #74

Merged
kocaemre merged 1 commit into
developfrom
feat/ai-markdown-gameplan
Jun 20, 2026
Merged

Render Markdown in AI panels + ordered game-plan summaries#74
kocaemre merged 1 commit into
developfrom
feat/ai-markdown-gameplan

Conversation

@kocaemre

Copy link
Copy Markdown
Owner

Summary

Two UX follow-ups from a fresh beta test of v2.5.0-beta.17, both requested after seeing the AI panels in action.

1. Render Markdown in AI panels

The co-pilot replies in Markdown, but the Explain and Summary panels printed it raw — operators saw literal **bold**, ### headings, and - bullets instead of formatting. Adds a tiny, dependency-free renderer (Markdown.tsx) for the subset the model actually uses: headings, **bold**, *italic*, `code`, and bullet / numbered lists.

  • XSS-safe by construction: model output can echo attacker-controlled scan text, so it renders to React text nodes only — no dangerouslySetInnerHTML, and links are deliberately not turned into anchors (no clickable surface from model output).
  • Wired into ExplainButton and SummarizeEngagementButton.
  • The pure block parser is split into markdown-parse.ts with unit tests (the .tsx isn't importable under the current vitest config).

2. Ordered "game plan" summaries

Both the single-host and cross-host summary prompts now ask for a numbered, sequential game plan — the order of moves to work the target ("do this first, then this, then pivot"), each step naming the target service in bold, the concrete action, and a short why, ending with a one-line best-first-move call-out. With the new Markdown renderer these display as a real ordered list.

Testing

  • npm test612 passing (adds markdown-parse unit tests).
  • npm run typecheck, npm run lint:kb, npm run build — all clean.
  • Verified live against real CTF data (HTB Lame/Blocky/Busqueda multi-host engagement): Explain renders bullets/bold, single-host and cross-host summaries render as numbered game plans, and no literal ** / ### remain in the panels.

🤖 Generated with Claude Code

Two beta-test follow-ups:

1. AI replies are Markdown but the Explain/Summary panels printed them raw, so
   operators saw literal **bold**, ### headings and - bullets. Add a tiny,
   dependency-free, XSS-safe renderer (React nodes only — no
   dangerouslySetInnerHTML, no anchors built from model output) for the subset
   the model uses: headings, **bold**, *italic*, `code`, and bullet/numbered
   lists. Wired into ExplainButton + SummarizeEngagementButton. Pure block
   parser split into markdown-parse.ts with unit tests.

2. Summaries now produce an ordered GAME PLAN. Both the single-host and
   cross-host summary prompts ask for a numbered, sequential list of moves
   ("do this first, then this, then pivot") with the target in bold, the
   action, and a short why — plus a one-line best-first-move call-out. Renders
   as a real ordered list via the new Markdown component.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WDoCrduJx7h9Dv8XaTqrSr
@kocaemre
kocaemre merged commit 476cb07 into develop Jun 20, 2026
3 checks passed
@kocaemre
kocaemre deleted the feat/ai-markdown-gameplan branch June 20, 2026 18:17
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.

1 participant