# protectai/rebuff

LLM Prompt Injection Detector

Repository: https://github.com/protectai/rebuff
Canonical: https://ross.abutalabs.com/products/rebuff
Homepage: https://playground.rebuff.ai
Language: TypeScript
License: Apache-2.0
License Family: permissive
Topics: llm, llmops, prompt-engineering, prompts, security, prompt-injection
Archived: true
Last push: 2024-08-07T23:35:48+00:00

## Health v2 (maintenance only)
Score: 10/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 87
- inputs: {"age_days": 1227, "days_push": 756, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: archived
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1521, forks 144 (observed 2026-08-28T04:04:57.718157+00:00)

## What it is
Rebuff is a self-hardening prompt injection detector that protects LLM-powered applications through multi-layered defenses: heuristics, a dedicated LLM-based detector, vector database attack signatures, and canary token leak detection. It ships as a Python SDK (pip install rebuff) and a JavaScript/TypeScript SDK for Node and the browser, with a self-hostable server.

## Use cases
- detect prompt injection attacks in user input before sending it to an LLM
- protect my AI chatbot from jailbreak and injection attempts
- detect when an LLM leaks its system prompt instructions
- store embeddings of past attacks to block similar future attacks
- add canary tokens to prompts to detect instruction leakage
- add a security layer to my LLM application pipeline

## When to choose
- you are building an LLM application that accepts untrusted user input and need layered prompt injection defense
- you want canary-token-based detection of system prompt leakage
- you want a detector that learns from previously seen attacks via a vector database

## When to avoid
- you need guaranteed protection - the project itself warns it is a prototype that cannot block all attacks
- you need a fully local/offline solution - local-only mode is not yet implemented
- you need Python/TypeScript feature parity - the Python SDK still lacks full parity with the TS SDK

## Facets
- artifact type: library
- maturity: experimental
- function: security, llm-inference, prompt-engineering, sdk
- domain: security, large-language-models, developer-tools
- platform: python, browser, cross-platform
- tags: prompt-injection, llm-security, canary-tokens, vector-database, self-hardening, ai-agents, nodejs

## Member repositories
- protectai/rebuff (main) score 10

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:04:57.718157+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T04:31:52.983210+00:00, confidence not recorded.
  - readme: https://github.com/protectai/rebuff (fetched 2026-08-28T04:04:57.718157+00:00, sha a66f2d1dc2f5)
  - registry_npm: https://registry.npmjs.org/rebuff (fetched 2026-08-29T11:35:40.038132+00:00, sha 870b6069e790)
- Data as of 2026-08-30T08:39:29.467469+00:00.
