PyRIT icon indicating copy to clipboard operation
PyRIT copied to clipboard

Prepended Conversation should be refactored to include objective

Open rlundeen2 opened this issue 8 months ago • 5 comments

Currently, for MultiTurnOrchestrators, you can set a prepended conversation. This is really useful, for example, if you want to set a system prompt on an objective target and then run Crescendo against it.

However, we want to make this more generic so we can prepend specific prompts based on the objective that's being used.

self._prepended_conversation should be replaced by

self.get_prepended_conversation(objective: str) -> list[PromptRequestResponse

We also need to update set_prepended_conversation to include an objectiver (optionally). A good behavior might be to store these in a dictionary such that get_prepended_conversation returns:

  • A default value if it's set and there is no match and set_prepended_conversation has been set for default
  • A specific prepended conversation if the objective matches. This can be a hash also/exact match

rlundeen2 avatar Mar 27 '25 19:03 rlundeen2

Hi, could I try to resolve this issue?

ryanjieh avatar Apr 03 '25 04:04 ryanjieh

Do you understand what needs to be done? If not, please ask questions here. It's not marked with "help wanted" but I'm guessing @rlundeen2 opened it so that people can give it a try. I'll assign it to you for now @ryanjieh

romanlutz avatar Apr 03 '25 04:04 romanlutz

A good use case to look is the second cookbook! Right now we have to send the second turns sequentially, but if we can match "prepend prompt X with objective Y" that's the goal.

rlundeen2 avatar Apr 03 '25 06:04 rlundeen2

A quick update to manage expectations - I’ve been assigned a project at my full time job that will take up more time for the next 4 weeks. Happy to continue to work on this issue, but I don’t want to hold the project back: if this issue is urgent, it may benefit from being reassigned.

ryanjieh avatar Apr 12 '25 02:04 ryanjieh

@nina-msft can you elaborate on what needs to happen and if you are taking care of it?

romanlutz avatar Apr 12 '25 04:04 romanlutz