This Python code simulates a Generative AI (GenAI) powered email client designed to illustrate potential vulnerabilities within GenAI ecosystems to adversarial inputs, specifically focusing on the propagation of self-replicating worms. This educational tool serves as a practical component to accompany the research findings presented in "ComPromptMized: Unleashing Zero-click Worms that Target GenAI-Powered Applications," shedding light on the security implications of integrating GenAI into email systems.
- Email Client Simulation: A simple simulation of an email client that uses OpenAI's API for processing incoming emails and generating responses based on the content of past emails.
- Adversarial Self-replicating Prompts: Demonstrates the concept of adversarial self-replicating prompts that can replicate themselves in the output of a GenAI model, perform malicious activity, and propagate to new hosts within the GenAI ecosystem.
- Simulated Database: Includes a simulated database of past emails to provide context for the GenAI model when generating responses.
- Python 3.6 or newer.
- Access to OpenAI's GPT (specifically tested with OpenAI's Python API client).
- Clone the repository or download the source code.
- Ensure you have Python 3.6 or newer installed.
- Install the required Python packages:
pip install openai
Usage
To run the simulation, you will need to replace "your-openai-key"
with your actual OpenAI API key in the EmailClient
class initialization.
python email_client_simulation.py
This simulation is based on findings from "ComPromptMized: Unleashing Zero-click Worms that Target GenAI-Powered Applications" by Stav Cohen, Ron Bitton, and Ben Nassi. Read the full paper here.
You can also learn more on the blog post here.
This code is intended for educational and research purposes only. The authors do not encourage malicious use of the techniques demonstrated within this simulation.
For more information or questions regarding this educational simulation, please refer to the contact details provided in the research paper.