DEV Community

Cover image for AI Agent Security Scanner: Auditing MCP Tools & Prompt Vulnerabilities
Tarek Mohamed
Tarek Mohamed

Posted on

AI Agent Security Scanner: Auditing MCP Tools & Prompt Vulnerabilities

Connecting LLMs to external tools and APIs via the Model Context Protocol (MCP) gives agents unprecedented autonomy. But how do you verify that your MCP tools aren't vulnerable to command execution, SSRF, or privilege escalation?

ai-agent-security-scanner is an automated vulnerability scanner and fuzzing benchmark suite built specifically for AI agents and MCP tool schemas.

GitHub logo seotarek / ai-agent-security-scanner

Security auditor and benchmark suite for AI agents, prompt injection defense, and MCP tool verification.

AI Agent Security Scanner 🛡️

License: MIT Python Version OWASP LLM PRs Welcome

An enterprise-grade, lightweight vulnerability assessment and prompt injection detection engine designed for autonomous AI agents, LLM pipelines, and Model Context Protocol (MCP) tool integrations.


🚀 Key Features

  • Direct & Indirect Prompt Injection Detection: Flags jailbreak patterns, system prompt overrides, persona hijacks, and delimiter manipulation.
  • Obfuscation & Payload Unmasking: Automatically decodes Base64, Hex, Leetspeak, zero-width characters, and Unicode homoglyphs used to bypass basic filters.
  • MCP Tool Call & Schema Guard: Inspects dynamic tool parameters and MCP function payloads for command injection, unauthorized file access, and SQL injection risks.
  • OWASP LLM Top 10 Mapping: Direct categorization against LLM01 (Prompt Injection), LLM02 (Insecure Output Handling), and LLM06 (Sensitive Info Disclosure).
  • High Performance: Pure Python heuristic and pattern-matching pipeline capable of evaluating inputs in < 2ms with zero external API calls required.
  • CI/CD Ready: Built-in CLI command with strict exit codes for seamless automated pipelines.

📦 Installation

git clone
…
Enter fullscreen mode Exit fullscreen mode

🔍 What Does It Scan For?

  • Excessive Tool Permissions: Detects tools that grant unnecessary write, delete, or system execution privileges.
  • Schema Poisoning & Type Confusion: Fuzzes tool input parameters with malformed payloads to test runtime validation.
  • Information Leakage in Tool Responses: Checks whether error messages expose environment variables, database connection strings, or system paths.
  • CI/CD Security Gate: Integrates seamlessly into GitHub Actions to fail builds if insecure prompt changes or tools are introduced.

🚀 Running the Scanner

# Scan your agent configuration and tool definitions
ai-agent-security-scanner --config ./agent_config.json --output report.html
Enter fullscreen mode Exit fullscreen mode

Give it a star and join the community on GitHub:
👉 https://github.com/seotarek/ai-agent-security-scanner

Top comments (0)