Build behind a safer boundary.
One gateway for prompt-injection checks before your agent executes a tool call. Start with REST, install the CLI, connect MCP, or test the behavior in the browser sandbox.
01 / REST API
Quickstart in one request
Create a key in the dashboard, store it as ZN_API_KEY, and send the text your agent is about to pass to a tool. The default endpoint applies deterministic rules plus the multilingual neural head (v29); swap v30 for prod in the URL for pure deterministic rules with identical auth and response shape.
export ZN_API_KEY=zn_live_your_key
curl -X POST https://api.usezn.com/v30/analyze -H "Authorization: Bearer $ZN_API_KEY" -H "Content-Type: application/json" -d '{"messages": [{"role": "user", "content": "text from an untrusted source"}]}'1
Create a workspace key
2
Analyze before execution
3
Block on verdict = block
02 / MCP
Streamable HTTP for agents
The hosted MCP endpoint exposes the same analyzer as a native tool. It uses Streamable HTTP, accepts JSON-RPC POST requests, and authenticates with the same Bearer API key as REST.
Endpoint
POST https://api.usezn.com/mcp
Authorization: Bearer $ZN_API_KEY
Content-Type: application/json
Accept: application/json, text/event-streamDiscover tools
{"jsonrpc":"2.0","id":1,"method":"tools/list"}The analyze tool accepts one required string: input.
03 / CLI, SDK, DLP & MCP
Use zn from Python, Node.js, CI/CD & MCP
The official Python SDK (pip install zn-gate) and Node.js package (zn-gate v1.3.0) provide zero-dependency local guardrails, automatic credential masking (DLP), framework adapters (LangChain, CrewAI, LlamaIndex), Promptfoo red-team provider, and universal MCP servers. It works offline across macOS, Windows, and Linux with free local OSS rules by default, or with cloud neural protection when configured with an API key.
# 1. Python agent tool protection & Auto-DLP
pip install zn-gate
# @guard(on_block="raise", mask_secrets=True)
# 2. GitHub Action CI/CD security scan
# uses: tljohnsilver/zn@main
# 3. Promptfoo automated red-teaming
# - id: 'python:zn_gate.integrations.promptfoo:call_api'
# 4. Universal local-first MCP server
npx -y zn-gate mcp
# 5. CLI prompt test & secret scan
zn-gate scan ./prompts --format github04 / MACHINE READABLE
Resources agents can fetch
OpenAPI schema, authentication, response fields, rate-limit headers, and errors.
Navigation index with canonical pages and integration paths.
Integration guidance for agent loops, verdict handling, and MCP.
MCP transport, authentication, endpoint, and tool manifest.
Need a hand?
Read the full API documentation, inspect the privacy policy, or contact the team with a reproducible integration question or security report.