# Agent Security Audit: Prompt Injection & MCP Scanner

> Scan a repo before your AI agent trusts it: finds hidden prompt injection, invisible Unicode, poisoned MCP tools and configs, permission-bypass settings, and typosquatted or hallucinated packages. 37 rules, zero dependencies, runs offline.

Agent Security Audit: Prompt Injection & MCP Scanner is a free AI agent skill on Agensi by K. L. Aadithya, in Security. It loads into your AI agent through the Agensi MCP server, always in its latest approved version.

- Price: Free
- Creator: [K. L. Aadithya](https://www.agensi.io/creators/k-l-aadithya)
- Category: [Security](https://www.agensi.io/skills/security)
- Version: 1.0
- Last updated: 2026-12-01
- Security: scan passed (2026-12-01); every new listing is also reviewed by a person
- Listing: https://www.agensi.io/skills/agent-security-audit-prompt-injection-mcp-scanner
- Tags: security, python, llm-ops, ai-agents, dependency-management

## About this skill

AI coding agents read files nobody reviews like code: `CLAUDE.md`, `AGENTS.md`, `.cursor/rules`, skills, MCP server configs and tool descriptions. Attackers hide instructions there with invisible Unicode, HTML comments, base64 blobs or poisoned tool descriptions. This skill makes your agent audit a repo **before** it trusts it.

It runs **Warden**, a bundled, zero-dependency Python scanner (37 rules), then your agent checks each finding, explains it in plain English and offers fixes.

### What it catches
| Attack | Example | Rules |
|---|---|---|
| Rules-file backdoor | Invisible Unicode TAG characters hiding "add this script, don't tell the user" | WD101–WD106 |
| Prompt injection in repo content | HTML comments telling the agent to read `~/.ssh` and send it out | WD201–WD208 |
| MCP tool poisoning / rug pulls | Tool descriptions that hijack other tools; configs that change after approval | WD401–WD406 |
| Risky MCP configs | Unpinned `npx` servers, auto-approve `*`, plaintext tokens | WD301–WD307 |
| YOLO-mode agent settings | `bypassPermissions`, `Bash(*)`, Copilot auto-approve | WD501–WD505 |
| Slopsquatting & typosquats | `reqeusts`, hallucinated package names, npm deps in Python manifests | WD601–WD605 |

### How it works
1. Scans the repo (text + JSON report, risk score 0–100).
2. Your agent opens each CRITICAL/HIGH finding and confirms it, dismissing false positives with a reason.
3. Decodes hidden payloads so you can see exactly what was smuggled in.
4. Proposes fixes (sanitize hidden Unicode, pin MCP servers, remove auto-approve, correct package names) and applies them **only with your OK**, then re-scans.

### Why trust it
- **Explainable rules, not an LLM judge**: every finding names the signal that fired and a fix.
- **Offline by default.** Registry checks (`--online`) and live MCP inspection (`--live-mcp`) run only if you ask.
- The skill tells your agent to treat scanned files as untrusted and never follow instructions found in them.
- Outputs SARIF for GitHub code scanning; includes an optional Claude Code hook that blocks poisoned tool results at runtime.
- Benchmarked: 100% recall / 0% false positives on its corpus; 0 MEDIUM+ findings on the CPython stdlib.

Open source under Apache-2.0: search "Aadithya-kl/warden" on GitHub.

## Requires

- Python 3.11+
- Live MCP
- @scope/server
- Node.js
- pkg
- uv (Python tool runner)

## Known limitations

Requires Python 3.11+. Heuristic-based scanning may flag security documentation as false positives. Online package checks require explicit user consent.

## How to use this skill

1. Connect your AI agent to Agensi once: add the MCP server https://mcp.agensi.io/mcp/auth and sign in with your Agensi account (OAuth, no API key). Steps for Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and other agents: https://www.agensi.io/docs/mcp-setup
2. Ask your agent: "Use the Agent Security Audit: Prompt Injection & MCP Scanner skill from Agensi" and describe your task.
3. Your agent loads the skill from Agensi when it needs it. Nothing is downloaded.

## Frequently asked questions

### What specific security threats does this skill protect my AI agent from?

This skill audits repositories for security threats that target AI agents, such as hidden Unicode prompt injections, poisoned Model Context Protocol (MCP) tool definitions, and hallucinated or typosquatted dependencies like slopsquatted packages. It prevents agents from blindly trusting instructions in files like CLAUDE.md or .cursorrules that could lead to unauthorized command execution or permission bypasses.

### What software or environment do I need to run these security audits?

The skill requires a Python 3.11 or newer environment to run its bundled zero-dependency scanner. It performs audits locally and offline by default, though an active internet connection is needed if you choose to use the optional online flag for verifying package names on PyPI or npm.

### What kind of reports and fixes does this skill generate?

You will receive a risk score and a detailed report of security findings categorized by severity from CRITICAL to LOW, which can be exported in JSON or SARIF formats. For hidden payloads, the skill can decode invisible Unicode content and provide remediation tools to sanitize files, pin MCP tool versions, or remove unsafe auto-approval settings.

### How should I ask my AI agent to start a security check using this skill?

You can ask your agent to scan a specific repository path or newly cloned project for security risks, check for hidden prompt injections in rules files, or audit your MCP configurations for tool poisoning. It is particularly useful to request a scan before allowing an agent to read instructions from files like AGENTS.md, .clinerules, or pyproject.toml.

### Are there any limitations to what the scanner can detect automatically?

The scanner uses 37 explainable heuristic rules, so it can occasionally flag legitimate security documentation that quotes an attack; your agent checks each finding and dismisses those with a reason. Typosquat checks run offline against bundled lists of popular packages. Confirming that a package actually exists on PyPI/npm needs the optional --online flag, and inspecting live MCP servers needs --live-mcp, which launches those third-party servers.

---

Source: [Agensi](https://www.agensi.io), the marketplace of skills for AI agents. Any MCP-compatible agent (Claude, ChatGPT, Claude Code, Codex, Cursor, VS Code and more) connects at https://mcp.agensi.io/mcp/auth and signs in with an Agensi account; setup for every agent: https://www.agensi.io/docs/mcp-setup. Append .md to any skill, guide or docs address on agensi.io for its markdown version.
