Introduction to Rebuff.ai
Rebuff.ai is an innovative tool aimed at safeguarding artificial intelligence applications from potential threats known as prompt injection (PI) attacks. Think of these attacks as sneaky ways for malicious entities to trick AI systems into doing something they shouldn't. To combat this, Rebuff employs a robust, multi-layered defense strategy to ensure your AI remains secure and trustworthy.
Features
Rebuff.ai integrates four defensive layers to protect AI applications:
- Heuristics: This acts as a frontline filter, identifying and blocking potentially harmful inputs even before they reach your AI.
- LLM-based Detection: Rebuff uses a specialized language model to assess and identify likely attacks within input prompts, ensuring smarter detection.
- VectorDB: A database that memorizes the patterns of previous attacks. By storing these in a vector format, Rebuff can quickly recognize and thwart any similar forthcoming attacks.
- Canary Tokens: By embedding these unique tokens into prompts, Rebuff can detect any unauthorized information leakage. This clever mechanism helps it learn and prepare for defending against similar future incidents.
Roadmap
Rebuff.ai is not stagnant; it's continuously evolving with a clear development plan. Current features and upcoming enhancements include:
- Detection of prompt injections and canary word leaks.
- Learning and recognizing attack patterns.
- Development tools like a JavaScript/TypeScript SDK.
- Future enhancements such as a Python SDK to match the JavaScript one, offline modes, user-defined detection methods, and better handling of adversarial suffixes.
Installation and Getting Started
To integrate Rebuff into your systems, the process is straightforward. You just need to install the package using:
pip install rebuff
With Rebuff installed, detecting unwanted activities like prompt injections or canary word leaks is simple. It offers flexible SDKs that you can implement with just a few lines of code in Python, making it easy for developers to add an extra layer of AI safety.
Self-hosting
For those who prefer to run their own servers, Rebuff offers a self-hosting option. You just need to set up relevant providers like Supabase, OpenAI, and a vector database such as Pinecone. Once everything is configured, you can run the Rebuff server locally and customize it as per your requirements.
Development and Community
Rebuff.ai thrives under the contributions and shared knowledge of its growing community. Whether you're a developer looking to enhance your projects or an enthusiast passionate about AI security, there's room for collaboration. You can join the Rebuff team by starring the project, contributing suggestions or features, and connecting on their Discord server.
Rebuff.ai is in its prototype stage, which means it's a burgeoning project with lots of potential but also room for improvement. The developers welcome insights and efforts from like-minded individuals eager to make AI a safer space. If you're interested in contributing or furthering the development, you can easily set up the development environment by running:
make init
Through its comprehensive protection strategies and ongoing developments, Rebuff.ai stands as a promising guardian against the vulnerabilities that AI applications might face today and in the future.