βœ“
Guardrail & Eval Securing AI & LLMs Read-Only Analysis Verified Nov 2026

Rebuff Canary-Token Injection Detector

Multi-stage prompt-injection detector pairing heuristic rules, canary tokens, and vector similarity checks.

Prerequisites & Step-by-Step Installation

Copy & run inside isolated lab

Before You Start (Prerequisites)

  • + Python >= 3.10 or TypeScript SDK
  • + Isolated staging endpoint or test prompt wrapper
  • + Secret-free canary token seed
1

Install Rebuff SDK inside Python environment

pip install rebuff

Use randomized cryptographic canaries per request session.

2

Enable canary leakage check on model outputs

python -c "import secrets; print('Canary check seed len:', len(secrets.token_hex(8)))"

Halts response streaming if the secret canary phrase echoes in model output.

Verify Setup Works
python -c "import rebuff; print('OK')"
Expected output: OK

Client Integration & Configuration Files

Review scope limits before wiring
pip install rebuff
python -c "import rebuff; print('Rebuff installed')"

How to Use & Defensive Workflow

Authorized assessment protocol

Typical Scenario: Detect when a prompt-extraction probe causes a customer-facing chatbot to leak hidden system prompt instructions.

  1. 01. Inject a random per-session canary marker inside the non-user system prompt.
  2. 02. Evaluate incoming queries through heuristic + embedding filters.
  3. 03. Verify output text with is_canary_word_leaked() before returning JSON to the browser.
Example Defensive Prompt / Run Command
Wrap our RAG prompt template with per-request canary verification so system prompt leaks trigger an instant safe fallback response.
Security Hardening & Authorized Scope Guidelines

Canary detection helps catch prompt leakage (`LLM07`), not arbitrary instruction misuse; combine with strict least-privilege tool scoping.

Technical Architecture & Deployment Brief

Overview & Role in Security Engineering

Rebuff Canary-Token Injection Detector (Guardrail & Eval) is engineered to support practitioners focused on system-prompt leak detection via randomized canary tokens plus layered input heuristic scoring. Within the ToolWar ecosystem, it serves as an explicit bridge between AI reasoning layers and verifiable cybersecurity telemetry.

Technical Architecture & Data Flow

This entry bridges classical cybersecurity engineering with modern AI workflows while preserving strict human review, deterministic boundary checks, and verifiable outputs.

Unlike ad-hoc prompt wrappers that execute unconstrained strings directly in a shell, structured integration enforces typed parameter validation, bounded scope allowlists, and explicit separation between untrusted analyzed artifacts (source files, telemetry logs, network banners, or binary samples) and system-level control instructions.

Recommended Deployment Practice

  1. Isolate the Execution Boundary: Deploy integrations inside ephemeral containers or dedicated analysis VMs so untrusted repositories, binaries, or HTTP responses cannot affect primary workstations.
  2. Enforce Least-Privilege Scoping: Use read-only filesystem mounts, non-privileged service tokens, and target CIDR allowlists before enabling interactive assistant sessions.
  3. Verify Outputs Deterministically: Validate every generated output against deterministic static scanners or runtime guardrails before applying changes to production infrastructure.

Integration & Operational Caveats

  • Treat all external content ingested by an LLM (including code comments, HTML titles, log lines, and MCP responses) as potential prompt-injection vectors.
  • Review configuration JSON and SKILL.md manifests carefully before binding credentials or running inside automated CI/CD pipelines.

Bridged ToolWar Classic Arsenal

1 linked tools

Community Field Notes (0)

No notes posted yet. Share verified runtime configs or hardening tips below.