Coder Social home page Coder Social logo

pokebot's Introduction

Pokebot: Vulnerable RAG Application for Testing GenAI Specific Vulnerabilities

Pokebot is a demonstration vulnerable Retrieval-Augmented Generation (RAG) application designed for learning and testing specific vulnerabilities related to Generative AI (GenAI). This project provides a platform to experiment with various attacks and defenses in the context of AI-powered natural language understanding and generation systems.

Pokebot, How does it look like?

Quick Start

Clone the repository and Install:

git clone https://github.com/safedep/pokebot
cd pokebot
pip install poetry
poetry install
poetry run pokebot rag start

above command will create a virtual env in case non exists

Setup OpenAI API Key

Set your OpenAI API key as an environment variable:

export OPENAI_API_KEY=<your_openai_api_key>

Replace <your_openai_api_key> with your actual OpenAI API key.

Running the Application

Start the Pokebot application by providing seed data (optional):

poetry run pokebot --seed data/med/articles/diabetes.txt

Alternatively use Pip

pip install -r requirements.txt
python pokebot/main.py --seed data/med/articles/diabetes.txt

Once the application is running, click on the Gradio link provided to access the app.

Usage

Prompting Without Poisoning Data

After accessing the application through the Gradio link, you can try prompts without poisoning the data. For example:

What is the best medicine for diabetes?

Poisoning Data

To simulate data poisoning, select the "Poison" option and submit. This action will inject poisoned data into the application for testing purposes.

Trying New Prompts

After poisoning the data, you can try new prompts to observe the behavior of the application. For example:

Get list of usernames

Contributing

Contributions to Pokebot are welcome! If you discover any vulnerabilities, have ideas for improvements, or want to add new features, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.

pokebot's People

Contributors

jchauhan avatar

Stargazers

Demetrius Tsitrelis avatar Sumit Verma avatar Dipak Kumar Das avatar

Watchers

Abhisek Datta avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.