Skip to content

feat: Assistant can refine the scenario, the Detection & Response narrative, or both (#44) - #57

Merged
mrwadams merged 3 commits into
mainfrom
feat/44-assistant-edit-detection-response
Jul 16, 2026
Merged

feat: Assistant can refine the scenario, the Detection & Response narrative, or both (#44)#57
mrwadams merged 3 commits into
mainfrom
feat/44-assistant-edit-detection-response

Conversation

@mrwadams

@mrwadams mrwadams commented Jul 15, 2026

Copy link
Copy Markdown
Owner

Closes #44.

What

The AttackGen Assistant could only refine the generated scenario, not the purple-team Detection & Response narrative added in v0.13 (#42). This lets the chat edit the scenario, the narrative, or both together.

Behaviour

  • The scenario-generating pages hand the defense narrative to the Assistant alongside the scenario (last_defense_narrative, mirroring last_scenario_text).
  • The Assistant page shows an "Editing:" selector — but only when a narrative was generated. With no narrative, the page behaves exactly as before (no selector).
  • Three targets:
    • Scenario — refine the scenario (original behaviour).
    • Detection & Response — refine the defender's narrative; the scenario is passed as read-only reference context.
    • Scenario + Detection & Response — refine both at once. Both artifacts are shown and fed to the model, which is instructed to apply cross-cutting changes (industry, threat actor, technique, timeline) consistently across the two so they don't drift.
  • The selected target drives the artifact(s) shown, the system prompt, and the LangSmith trace name/tags (purple_team_narrative on the defense and combined paths).
  • Per-target chat histories so switching modes doesn't feed one artifact's conversation into another.

Not in scope (matching the issue's framing)

Verification

  • test_scenario_page.py asserts the new last_defense_narrative handoff across all three defense states (none / deterministic-only / narrative).
  • Full suite: 132 passed.
  • Both the base narrative-editing feature and the combined mode were driven end-to-end in the browser. In combined mode, a single "re-target from an education organization to a hospital" instruction rewrote both the scenario and the narrative coherently (Healthcare/community-hospital theming, same techniques, aligned detections).

🤖 Generated with Claude Code

The AttackGen Assistant could only refine the generated scenario, not the
purple-team Detection & Response narrative introduced in v0.13. Hand the
narrative across in the cross-page handoff and add a target selector so the
chat can edit either artifact.

- scenario_page: _persist_and_render stashes last_defense_narrative (None when
  there's no narrative, so a stale one can't survive a plain-scenario regen).
- Assistant page: 'Editing: Scenario / Detection & Response' radio (shown only
  when a narrative exists) routes the artifact, system prompt, and LangSmith
  trace tags; per-target chat histories avoid cross-contamination. Editing the
  narrative passes the scenario as read-only reference context.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
mrwadams and others added 2 commits July 16, 2026 09:39
…e Assistant

The Assistant could refine the scenario or the Detection & Response narrative,
but not both together, so a cross-cutting change (industry, threat actor,
technique, timeline) had to be made twice and could drift between the two.

Add a third 'Scenario + Detection & Response' target that shows both artifacts,
feeds both into the model context, and instructs the model to apply changes
consistently across them. Each target keeps its own chat history.

Verified end-to-end in the browser: a single 'education -> hospital' instruction
in combined mode rewrote both the scenario and the narrative coherently.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…eam editing

Covers the Assistant editing the Detection & Response narrative (#44) and the
new combined 'Scenario + Detection & Response' editing mode.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mrwadams mrwadams changed the title feat: Assistant can refine the Detection & Response narrative (#44) feat: Assistant can refine the scenario, the Detection & Response narrative, or both (#44) Jul 16, 2026
@mrwadams
mrwadams merged commit 14896d3 into main Jul 16, 2026
7 checks passed
@mrwadams
mrwadams deleted the feat/44-assistant-edit-detection-response branch July 16, 2026 08:49
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.

AttackGen Assistant should edit the Detection & Response output too, not just the scenario

1 participant