protectai / rebuff

LLM Prompt Injection Detector
https://playground.rebuff.ai
Apache License 2.0
1.06k stars 73 forks source link

Create a first class python Rebuff SDK #52

Open seanpmorgan opened 11 months ago

seanpmorgan commented 11 months ago

Today, rebuff SDK consists of :

  1. A first class TypeScript SDK which houses the code for all 4 layers of defense. 3 detection layers that occur prior to prompt submission (Heuristics, LLM-detection, VectorDB comparison) and 1 layer that uses canary tokens to validate if a prompt injection has occurred.

  2. A Python SDK that must interact with a RESTful server (e.g. Rebuff Playground using the JS SDK) to do the 3 layers of detection mentioned above. The current python SDK does has the ability to add canary tokens, and detect if they've been leaked without the need for an external API call.


Going forward we're going to create a first class python SDK that has feature parity with the JS/TS SDK. We will move majority of the current python REST client within the server directory which will ultimately become its own repo (issue on this will be coming).

ristomcgehee commented 10 months ago

I'm interested in working on this one. I have a couple questions to discuss:

  1. Since we'll be introducing quite a few more dependencies, do we want to start using Poetry instead of setup.py?
  2. From the start, do we want to make separate packages for the python REST client and the full-fledged python sdk?