Skip to Content
ZeroLeaksDocs
ZeroLeaks SDK

Skill scans

Scan remote or archived agent skills, and MCP servers, for prompt injection and unsafe behavior.

A skill scan inspects agent instruction packages, supporting files, trust boundaries, and behavior-changing content. The API reference lists every method and option.

Scan a remote source

const result = await zeroleaks.skillScans.run({
  source: "https://github.com/example/agent-skills/tree/main/research",
  mode: "full",
  toolProfile: "networked",
  includeAssets: false,
});

console.log(result.report);

Upload an archive

import { readFile } from "node:fs/promises";

const archive = await readFile("./my-skill.zip");
const created = await zeroleaks.skillScans.uploadArchive(archive, {
  fileName: "my-skill.zip",
  mode: "full",
  delivery: "async",
});

ZIP archives are limited by the API upload policy. Keep secrets, dependency caches, and unrelated build artifacts out of the archive.

Scan an MCP server

Point a skill scan at an MCP server to check what it tells every agent that connects to it. ZeroLeaks connects as an MCP client over Streamable HTTP, lists the server's tools, prompts, resources, and instructions, and analyzes all of that declared text. It never calls a tool.

const result = await zeroleaks.skillScans.run({
  source: "https://mcp.example.com/mcp",
  sourceType: "mcp",
  mcpAuthorization: `Bearer ${process.env.MCP_TOKEN}`, // optional
});

The server URL must be HTTPS on a public host. You can also write the source as mcp+https://mcp.example.com/mcp. mcpAuthorization is stored encrypted and deleted when the scan finishes. The report's metadata.mcp carries the server name and version, counts, and a hash per tool definition.

On top of the transparency, injection, and behavior analysis every skill scan runs, an MCP scan checks for:

  • instructions aimed at the model in tool, parameter, prompt, or resource descriptions (tool poisoning);
  • zero-width, bidirectional, and tag characters that hide text from reviewers;
  • descriptions that mention credentials or sensitive files;
  • one tool's description steering how another tool is used (shadowing);
  • tools whose names change state but that claim readOnlyHint, or that don't declare whether they're destructive;
  • tool definitions that changed since your last scan of the same server. Clients usually approve a server once, so a definition that changes afterwards is reported as a high-severity finding.

Choose a delivery mode

deliveryBehavior
asyncReturns a scanId. Use get() or wait() for the result.
syncHolds the request open and returns the report directly. Use it only in jobs with a sufficiently long execution timeout.
const report = await zeroleaks.skillScans.create({
  source,
  delivery: "sync",
  timeoutMs: 600_000,
});

Receive a webhook

Async scans can send completion callbacks:

await zeroleaks.skillScans.create({
  source,
  webhookUrl: "https://example.com/webhooks/zeroleaks",
  webhookSecret: process.env.ZEROLEAKS_WEBHOOK_SECRET,
});

Webhook URLs must use HTTPS and pass the platform's outbound URL safety checks. See webhooks.

On this page