Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Multiple Tasks] FEAT add attack modules from moonshot #376

Open
5 of 10 tasks
eugeniavkim opened this issue Sep 18, 2024 · 11 comments
Open
5 of 10 tasks

[Multiple Tasks] FEAT add attack modules from moonshot #376

eugeniavkim opened this issue Sep 18, 2024 · 11 comments
Labels
converters Related to PyRIT converters enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@eugeniavkim
Copy link
Contributor

eugeniavkim commented Sep 18, 2024

Is your feature request related to a problem? Please describe.

Adding in attack modules from Project Moonshot that can be adapted as converters under pyrit.prompt_converter

Describe the solution you'd like

Directly porting over the technique from attack-modules from https://github.com/aiverify-foundation/moonshot-data?tab=readme-ov-file#attack-modules

In order to prevent duplicate work, we can use this task list below to check off completed attack modules as well as commenting on which attack you are working on adapting into PyRIT.

@eugeniavkim
Copy link
Contributor Author

I will take on the colloquial wordswap attack and mark it completed on the task list once completed👍

@visirion07
Copy link

I will "attack" Textfooler and Textbugger. WIll mark it completed once done.

@KutalVolkan
Copy link
Contributor

KutalVolkan commented Sep 21, 2024

Hi @eugeniavkim ,

I would like to work on Malicious Question Generator and Violent Durian.

I also took a look at the Toxic Sentence Generator and noticed that 22 files have been flagged as unsafe. Just wanted to check with you—is it still safe to proceed with this model, or should we apply the same approach used in the Malicious Question Generator as an alternative?

Here’s the link to the files I mentioned: Toxic Sentence Generator.

Looking forward to your thoughts!


  • Malicious Question Generator

@romanlutz
Copy link
Contributor

@KutalVolkan go ahead! Which files are unsafe?

@KutalVolkan
Copy link
Contributor

@KutalVolkan go ahead! Which files are unsafe?

Hello Roman,

Here’s the link and the screenshot I mentioned regarding the unsafe files: Toxic Sentence Generator on Hugging Face.
image

@KutalVolkan
Copy link
Contributor

Hello @romanlutz,

A few additional questions:

  1. Should we create a PR for each converter individually, e.g., for the Malicious Question Generator, or should we wait until all the above attack modules from Project Moonshot are finished before submitting the PR?

Submitting separate PRs might allow for more focused reviews and quicker feedback on each converter, but I'll defer to your preference on how you'd like to handle it.

  1. Regarding Violent Durian, I initially thought it would function more like a strategy inside the Red Teaming Orchestrator. Upon further review, I see that it operates more dynamically by convincing the LLM (prompt target) to take on a criminal persona. The setup involves a multiturn agent that manipulates the LLM into gradually adopting the identity of a criminal (e.g., Zodiac Killer, Ted Bundy) and generating responses as if it were that persona.

This contrasts with a standard converter that mostly modifies the input prompt. In this case, Violent Durian seems to guide a multi-turn conversation, progressively influencing the LLM to respond unethically and act in alignment with the persona.

For example, I plan to integrate this behavior into the Red Teaming Orchestrator by dynamically selecting a criminal persona and applying it to the conversation objective in the YAML-based attack strategy, adapting the YAML to fit the Violent Durian use case.

If you have a different approach or best practices to suggest, I’d be happy to incorporate them. Looking forward to your thoughts 😀

@romanlutz
Copy link
Contributor

Yes, individual PRs are preferable, unless you're reusing pieces. Even then it's probably better to have them one after the other.

Your idea to use it on the orchestrator level makes sense. Essentially, this would be a new custom attack strategy.

@romanlutz
Copy link
Contributor

@KutalVolkan go ahead! Which files are unsafe?

Hello Roman,

Here’s the link and the screenshot I mentioned regarding the unsafe files: Toxic Sentence Generator on Hugging Face. image

Good question...

I have not used them before, but this sounds suspicious. Maybe it's because they're binary?
I suppose we could go back to the paper and check how they generated these but that could involve a lot of work.
Otherwise, I'm inclined to skip. Don't want to be responsible for making your machine unsafe 😆

@nina-msft nina-msft added converters Related to PyRIT converters enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Oct 2, 2024
@nina-msft
Copy link
Contributor

Marking this with good first issue. The remaining tasks of:

  • Insert Punctuation Attack
  • Job Role Generator
  • Toxic Sentence Generator

may be good first issues to tackle.

@nina-msft
Copy link
Contributor

@visirion07 - are you still planning on taking a look at Textfooler and Textbugger? 😄

@visirion07
Copy link

visirion07 commented Oct 2, 2024

Yes @nina-msft. Sorry got held up in some other work. Taking this up as a high priority. WIll post an ETA soon

@nina-msft nina-msft changed the title FEAT add attack modules from moonshot [Multiple Tasks] FEAT add attack modules from moonshot Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
converters Related to PyRIT converters enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

5 participants