# Rebuff — Prompt Injection Detector

> Multi-layered prompt injection detection that learns from attacks.

- Org: Protect AI
- Date: 2024-03-20
- Category: security, tool, repo
- Source: https://github.com/protectai/rebuff
- Canonical page: https://ai-tldr.dev/releases/rebuff-ai/

## In short

Self-hardening prompt injection detector. Uses heuristics, LLM analysis, and a vector database of known attacks. Learns from new attacks it encounters.

## What it is

Rebuff detects prompt injection attacks using four layers: heuristic analysis, LLM-based detection, vector similarity against known attacks, and a canary token system.

## How it works

Pass user input through Rebuff before your LLM. It checks heuristics, asks an LLM 'is this an injection?', compares against a vector DB of attacks, and plants canary tokens to detect leakage.

## Why it matters

Prompt injection is the #1 LLM vulnerability. Rebuff catches attacks that simple filters miss and gets smarter over time.

## Who it's for

Anyone building LLM apps that accept user input.

## Try it

pip install rebuff

## Links

- [GitHub](https://github.com/protectai/rebuff)
- [Playground](https://playground.rebuff.ai)
