Skip to content

BUG MultiPromptSendingAttack fails with UNIQUE constraint when user_messages are reused, and drops harm categories #2815

Description

Running MultiPromptSendingAttack twice with the same user_messages fails:

msgs = [Message.from_prompt(prompt="turn one", role="user"), Message.from_prompt(prompt="turn two", role="user")]
await attack.execute_async(objective="A", user_messages=msgs)  # fine
await attack.execute_async(objective="B", user_messages=msgs)  # UNIQUE constraint failed: PromptMemoryEntries.id

The same thing happens when AttackExecutor broadcasts user_messages to several objectives: only the first one completes. The attack sends the caller's Message objects as they are, so their piece IDs get reused. PromptSendingAttack avoids this by calling .duplicate() first.

Separately, MultiPromptSendingAttackParameters.from_seed_group_async never sets targeted_harm_categories, so these results have no harm categories and don't show up when you filter by them.

Fix: send current_message.duplicate() and pass the seed group's harm categories through.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions