Skip to content

Make prepended history normalization capability-driven - #5

Open
rlundeen2 wants to merge 5 commits into
romanlutz:romanlutz-fix-converter-scoping-692from
rlundeen2:rlundeen2-fix-pr-2359-normalization
Open

Make prepended history normalization capability-driven#5
rlundeen2 wants to merge 5 commits into
romanlutz:romanlutz-fix-converter-scoping-692from
rlundeen2:rlundeen2-fix-pr-2359-normalization

Conversation

@rlundeen2

@rlundeen2 rlundeen2 commented Aug 21, 2026

Copy link
Copy Markdown

This PR updates Roman's romanlutz-fix-converter-scoping-692 branch. It keeps prepended conversations structured in PyRIT memory and adapts them only in the target-facing send path.

Changes from Roman's branch

  • Registers EDITABLE_HISTORY in the target normalization pipeline instead of handling non-chat targets in individual attacks.
  • Uses TargetNormalizationContext to identify the explicit persisted seed boundary. Stateful targets consume it after the first provider attempt; stateless targets reuse the original seed for each current request.
  • Uses the shared HistorySquashNormalizer for target-facing history adaptation instead of attack-specific flattening implementations.
  • Makes PrependedConversationConfig shared attack policy on AttackStrategy and resolves its per-send override through a shared base helper.
  • Includes the converter role scope in the attack identifier and the configured prepended-history formatter as a child identifier. Formatter-specific settings therefore affect resume and evaluation identity.
  • Lets technique factories specify PrependedConversationConfig through attack_kwargs; all attacks that create or accept prepended conversations expose the parameter, including SkeletonKey.
  • Applies the shared path to PromptSending, RedTeaming, Crescendo, MultiPromptSending, ChunkedRequest, TAP/PAIR, SkeletonKey, and BargeIn.
  • Keeps structured memory as the canonical conversation. A target without editable history may receive one flattened prompt while memory still shows the original structured turns.
  • Preserves the original TAP seed boundary when branches are copied; copied live turns do not become new seed history.
  • Reads feedback scores only from the final prepended assistant turn.
  • Warns when native non-text history must become a text placeholder for a target without editable history.
  • Keeps detailed normalization lifecycle documentation with message normalizers and limits framework.md to architecture and component responsibilities.

Compatibility note

The prepended-conversation policy now contributes to the attack evaluation hash. Existing cached evaluation results created with the old identifier will not match the new identifier.

Validation

  • 149 focused attack, target-normalization, score, and technique regression tests passed after rebasing onto the latest PR head.
  • Ruff and scoped ty checks passed.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 420eef57-7a1c-4dde-8aad-a93539e8da64
@rlundeen2
rlundeen2 marked this pull request as draft August 21, 2026 01:25
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 420eef57-7a1c-4dde-8aad-a93539e8da64
@rlundeen2 rlundeen2 changed the title Fix target context preservation after conversation rotation Make prepended history normalization capability-driven Aug 21, 2026
Copilot AI added 2 commits August 21, 2026 09:06
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Keep cloned and retained stateless TAP branches pinned to their original prepended seed, correlate failed exchanges using guarded persisted adjacency, and make normalization ownership explicit.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: cb50fd66-f0e0-4435-a71d-1d42fef7d307
@romanlutz
romanlutz marked this pull request as ready for review August 21, 2026 17:12
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

Copilot-Session: 420eef57-7a1c-4dde-8aad-a93539e8da64
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.

2 participants