Skip to content

FEAT: Toxic Sentence Generator #893

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

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

0xm00n
Copy link

@0xm00n 0xm00n commented Apr 24, 2025

Description

This PR adds the ToxicSentenceGeneratorConverter converter adapted from Project Moonshot's attack modules. The converter generates toxic sentence starters based on seed prompts to test language model safety guardrails within the PyRIT framework.

Work Completed

  • Implemented the ToxicSentenceGeneratorConverter class in toxic_sentence_generator_converter.py
  • Added the YAML template for the toxic sentence generation prompt
  • Created a new Jupyter notebook and Python script demonstrating example usage
  • Added unit tests for the ToxicSentenceGeneratorConverter class

Related Issue

Contributes to issue #428 and its parent issue #376

@0xm00n
Copy link
Author

0xm00n commented Apr 24, 2025

@microsoft-github-policy-service agree

Copy link
Contributor

@bashirpartovi bashirpartovi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, a couple of comments

0xm00n and others added 4 commits April 25, 2025 12:24
- Add Optional type hint to prompt_template parameter
- Add unit test for case when no template is provided
- Update API reference documentation to include ToxicSentenceGeneratorConverter
…ference

- Remove documentation notebook and Python file as recommended by reviewer
- Add explicit GitHub link to Project Moonshot's toxic sentence generator module
@bashirpartovi
Copy link
Contributor

#901 should fix the build issues you're seeing here. Once it is merged, just merge main into your branch and it should take care of the build issues

@bashirpartovi
Copy link
Contributor

I think you need to run pre-commit to fix the formatting

@0xm00n
Copy link
Author

0xm00n commented Apr 28, 2025

I think you need to run pre-commit to fix the formatting

Do I run pre-commit run --all-files on my end locally?

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.

3 participants