Repolode
ZeroLeaks

ZeroLeaks/zeroleaks

Command-line and library scanner that red-teams system prompts and agent instructions for prompt extraction and injection vulnerabilities.

Stars
744
Forks
112
Open issues
1
Last commit
last month

What is it?

ZeroLeaks loads a system prompt into a model you choose, attacks that model with extraction and injection probes, and reports how well the prompt held up. Extraction tests check whether the model can be talked into revealing its own system prompt. Injection tests check whether it follows instructions hidden in documents, tool results, or fake admin messages, and whether it agrees to misuse tools.

The scanner runs locally with your own model-provider keys, using OpenRouter by default or OpenAI directly. Multiple agents plan attacks, read the target's replies and change tactics during a scan, and an LLM judge grades each result as full, partial, or refused compliance. The injection corpus contains 78 behavioral probes covering categories such as tool hijacking, indirect injection, and multi-turn grooming.

The package ships as a CLI and a TypeScript library, and works with any OpenAI-compatible endpoint such as Ollama, vLLM, or LiteLLM. It outputs a colorized terminal report or JSON, and uses exit codes so it can run in CI. The project is source-available under the FSL license rather than open source.

Key features

  • 01Runs extraction and injection scans against a system prompt.
  • 02Uses multiple agents that plan attacks and adjust tactics mid-scan.
  • 03Ships 78 behavioral injection probes across six categories.
  • 04Uses an LLM judge to grade whether the model actually complied.
  • 05Supports separate models for attacker, target, evaluator, and judge.
  • 06Works with OpenRouter, OpenAI, and OpenAI-compatible local or hosted endpoints.
  • 07Outputs terminal reports or JSON, with exit codes for CI use.

Use cases

  • Testing a customer-facing chatbot's system prompt before deployment.
  • Checking whether an agent resists instructions hidden in retrieved documents or tool outputs.
  • Adding prompt-security regression checks to a CI pipeline.
  • Comparing how different models hold up against the same prompt.

Quick start

  1. 1

    Install the package with npm

    npm install zeroleaks
  2. 2

    Set your OpenRouter API key

    export OPENROUTER_API_KEY=sk-or-...
  3. 3

    Scan a system prompt from the command line

    zeroleaks scan --prompt "You are a helpful assistant..."

Things to know

  • Requires your own model-provider API key and you pay the provider for every scan.
  • The license is FSL-1.1-Apache-2.0 (source-available), not a standard open-source license.
  • The README does not say which Node/Bun setup is needed beyond npm install and the Bun runtime.

In collections

Topics

FAQ

What is zeroleaks?
Command-line and library scanner that red-teams system prompts and agent instructions for prompt extraction and injection vulnerabilities. ZeroLeaks loads a system prompt into a model you choose, attacks that model with extraction and injection probes, and reports how well the prompt held up. Extraction tests check whether the model can be talked into revealing its own system prompt. Injection tests check whether it follows instructions hidden in documents, tool results, or fake admin messages, and whether it agrees to misuse tools.
Is zeroleaks free to use? What license does it have?
zeroleaks is open source under the Other license. Check the license terms before using it in commercial products.
Is zeroleaks still maintained?
Updated within 6 months. The last commit to zeroleaks was on Sep 26, 2026.
What can I use zeroleaks for?
Testing a customer-facing chatbot's system prompt before deployment. Checking whether an agent resists instructions hidden in retrieved documents or tool outputs. Adding prompt-security regression checks to a CI pipeline. Comparing how different models hold up against the same prompt.
How do I install zeroleaks?
Install the package with npm: npm install zeroleaks Set your OpenRouter API key: export OPENROUTER_API_KEY=sk-or-... Scan a system prompt from the command line: zeroleaks scan --prompt "You are a helpful assistant..."
Where can I get zeroleaks?
The source code and installation instructions are on GitHub: https://github.com/ZeroLeaks/zeroleaks

Summary generated by AI from the project's README. GitHub stats refresh daily.

Related projects