zeroleaks package
Source-available CLI and TypeScript library that tests a system prompt for extraction and prompt injection on your machine with your own model API key.
The zeroleaks npm package is a standalone scanner for system prompts. It loads your prompt into a model you choose and tests that model in two ways. An extraction scan uses a multi-turn attacker that tries to get the model to reveal its own system prompt. An injection scan runs behavioral probes that try to get the model to follow planted instructions (in a document, a fake admin message, or a tool description) or to agree to misuse a tool. A judge model decides whether the target complied.
The package runs on your machine with your own model-provider API keys. Use it to harden prompt wording, run local experiments without an account, or add a low-cost prompt check to CI. The source is at github.com/ZeroLeaks/zeroleaks. These pages describe version 1.5.0.
License
The package is licensed under FSL-1.1-Apache-2.0, the Functional Source License. You can use, modify, and redistribute it for any purpose except offering a competing commercial product or service. Each release becomes available under Apache 2.0 two years after it is published or on January 21, 2028, whichever comes first.
Comparison with hosted ZeroLeaks
The zeroleaks package tests a system prompt. The target is a model you specify, running your prompt with no tools, memory, or application code. A finding means that model, given that prompt, leaked its instructions or followed an injected instruction in its reply.
Hosted ZeroLeaks tests a running agent. Through @zeroleaks/sdk runtime scans or endpoint scans, every probe goes through your real agent: its model settings, tools, memory, credentials, and the other agents it talks to. Findings come with a least-privilege policy or configuration fix, and later scans rerun the same attacks to catch regressions.
zeroleaks package | Hosted ZeroLeaks | |
|---|---|---|
| Target | A model running your system prompt | Your deployed or in-process agent |
| Tools, memory, peers | Not exercised | Real tool calls and results are traced |
| Model access | Your OpenRouter or OpenAI API key | Included, one ZeroLeaks API key |
| Output | Terminal report or JSON | Stored reports with fixes and PDF export |
| Pricing | Free under FSL; you pay your model provider | Paid plans (Pro, Team, Business, Enterprise), with a 14-day Pro trial |
Hosted agent scans no longer run a system-prompt extraction loop. They run a secrets-in-context track instead, which scores what sensitive data leaked (credentials, internal hosts, tool schemas, approval rules), not whether the prompt was reproduced word for word. Hosted prompt scans are retired.
Next steps
Quickstart
Install the package and run a first scan.
CLI
Run scans and list probes from the command line.
Scan engine
Control turns, tree depth, branching, Best-of-N, and callbacks with createScanEngine.
Attack agents
Call the agents from your own code.
Probe library
Read the extraction probes, the 78 behavioral injection probes, and the attack seed corpus.
Knowledge base
Read the documented techniques, payload templates, exfiltration vectors, and defense bypass methods.