ZeroLeaks documentation
Red-team AI agents from your code or CI, add runtime prompt defenses, or run the source-available ZeroLeaks scan engine.
ZeroLeaks red-teams AI agents. It profiles the agent's role, tools, and reachable data, derives the boundaries it must not cross, and tests those boundaries on every scan.
Choose a product
Shield API
Check untrusted text for prompt injection before it reaches your agent.
ZeroLeaks SDK
Run hosted agent scans through your real AI SDK, OpenAI, or custom agent code, or against a deployed HTTPS endpoint.
Shield SDK
Add hosted or local prompt injection detection, prompt hardening, and output sanitization to an LLM application.
zeroleaks package
Run the source-available scanner and CLI locally with your own model-provider API key.
API reference
Authentication, REST endpoints, SDK methods, webhooks, and the MCP server.
Compare products
| Product | Best for | Runs where | API key |
|---|---|---|---|
@zeroleaks/sdk | Runtime and endpoint agent scans, plus skill scans | ZeroLeaks orchestration plus your runner | ZEROLEAKS_API_KEY |
@zeroleaks/shield | Runtime protection in an LLM request path | Hosted API for default detection; your application for local helpers | ZEROLEAKS_API_KEY for hosted detection; none for local helpers |
zeroleaks | Local scans, including system-prompt extraction tests, research, and custom scan engines | Your machine or CI runner | OPENROUTER_API_KEY |
For most production agents, run SDK runtime scans against the real agent and add Shield for runtime defense in depth. Use the zeroleaks package when you need local control over the scanning engine.
Protect your API key
Use ZeroLeaks API keys only on a server. Keep them in a server-side environment variable or secret manager, and never include them in browser bundles, mobile applications, source control, or logs.