En

agent-scan

AI Agent Security Scanner for Detecting Prompt Injection and Vulnerabilities

代码质量 执行MCP安全扫描排查代码漏洞检查配置安全 通用 ★ 2.8k Updated 2026-08-02

Install & Use

Copy this prompt and send it to your AI assistant (Claude / Cursor / TRAE / Codex / WorkBuddy etc.) to auto-install:

Help me install this AI Skill: agent-scan.
It is used for: AI Agent Security Scanner for Detecting Prompt Injection and Vulnerabilities
Full Skill content: https://321skill.com/skills/agent-scan/raw/index.md
Read that page and install it.

The prompt includes a link to the full Skill content. You can also view the full content.

This Skill addresses the challenge of discovering security risks within the AI Agent ecosystem. In practical development, engineers often need to audit components like MCP server configurations and Agent skill files, but traditional code scanning tools are ineffective at detecting natural language-level threats such as prompt injection, sensitive data leakage, and malicious payloads. Agent Scan automatically discovers all Agent components installed on the machine (including harnesses, MCP servers, and skills) and performs deep scanning for common threats.

Usage is straightforward: first, register a Snyk account and obtain an API token, then set the environment variable via export SNYK_TOKEN=.... After that, you can run the scan using uvx snyk-agent-scan or by downloading the binary. It automatically discovers MCP configuration files, skill files, and more, checking each for issues like prompt injection, improper handling of sensitive data, and hidden malicious code. You can skip skill scanning with the --no-skills parameter or, in trusted environments, allow execution of MCP server commands using --dangerously-run-mcp-servers.

It is well-suited for teams or individuals who need to ensure the security of their AI Agents, especially projects that have built multiple agent services using the MCP protocol or have integrated third-party Agent skills during development. Security engineers, operations staff, and agent developers can use it to quickly establish a security inventory of Agent components and identify potential risks before deployment.

It is recommended to run this tool in an isolated sandbox environment (e.g., a Docker container or virtual machine), particularly when scanning third-party MCP configurations. Note that scanning MCP configurations involves executing commands within them to retrieve tool descriptions, so always carefully review and approve prompts in interactive mode. The tool is currently experimental, and the CLI output format may change; it is not advised to directly rely on its output fields for building production workflows.

Key Features

Unlike traditional code security scanners (e.g., Semgrep), agent-scan is designed specifically for the AI Agent ecosystem. It can scan for natural language threats like prompt injection in MCP server configurations and skill files, rather than just code vulnerabilities. It also supports targeted analysis of Agent skills and can generate a component inventory.

Limitations

Requires Python 3.8+ environment. Scanning MCP configurations executes the commands defined within them, posing a security risk; must be run in a sandbox. The CLI output format is currently experimental and subject to change.

FAQ

The scan prompts to execute an MCP server. Is this safe?

Scanning MCP configurations executes commands for stdio-type MCP servers. It is recommended to run in an isolated sandbox and carefully review approval prompts in interactive mode. By default, user confirmation is required for each command. In trusted environments, you can use --dangerously-run-mcp-servers to skip confirmations.

How do I obtain a Snyk API token?

Visit https://app.snyk.io/account, click on KEY in the API Token section to display it, then copy and set it as the environment variable SNYK_TOKEN.

Installation guide for AI assistants

If your AI coding assistant (Claude Code, Cursor, TRAE etc.) can see this page, send it this message to auto-install:

Visit https://321skill.com/skills/agent-scan/raw/index.md to read the original Skill definition (Markdown format) for agent-scan, and install it according to the instructions.