Skip to content

Conversation

@rlundeen2
Copy link
Contributor

@rlundeen2 rlundeen2 commented Jan 2, 2026

PrependedConversationConfig

Added new PrependedConversationConfig dataclass to configure how prepended conversations are handled. Supports configurable behavior for non-chat targets (normalize_first_turn vs raise), and allows specifying which roles should have converters applied. Includes factory methods for common configurations

Consistent next_message Handling

  • Fixed RedTeamingAttack._generate_next_prompt_async to return Message instead of str, preserving multimodal content (images, audio)
  • Ensures next_message is sent as the first message to targets across all attacks
  • Multimodal content is now properly preserved end-to-end
  • Consistent prepended_conversation Handling (e.g some attacks used to extract next_message if the last prepended message was user, but others did not. Now it is never auto-extracted)

ConversationManager Refactoring

  • Refactored initialize_context_async to accept context object with cleaner parameter passing
  • Moved prepended conversation processing logic into the manager
  • Added add_prepended_conversation_to_memory_async for explicit memory operations
  • Started handling non PromptChatTargets
  • The logic for this used to be quite difficult to follow. prepended_conversation was updated multiple places. Now it should all be handled centrally.

Test Coverage

  • Added test_attack_parameter_consistency.py with cross-attack behavioral tests
  • Rewrote test_conversation_manager.py to match refactored API
  • Added comprehensive tests for PrependedConversationConfig settings
  • Fixed numerous tests affected by API changes

Breaking Changes

Nothing major IMO; I think both of these are really internal.

  • ConversationManager.initialize_context_async signature changed to accept context parameter
  • generate_next_prompt_async in RedTeamingAttack now returns Message instead of str

@rlundeen2 rlundeen2 changed the title [FIX Breaking]: Attack Parameter Consistency and ConversationManager Refactoring [FIX Breaking]: PrependedconversationConfig and Attack Param Consistency Jan 2, 2026
@romanlutz romanlutz changed the title [FIX Breaking]: PrependedconversationConfig and Attack Param Consistency [FIX Breaking]: PrependedConversationConfig and Attack Param Consistency Jan 2, 2026
@rlundeen2 rlundeen2 merged commit d7c893f into Azure:main Jan 6, 2026
20 checks passed
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