<p align="center"> <img src="https://img.shields.io/pypi/v/agentvuln?color=blue" alt="PyPI"> <img src="https://img.shields.io/pypi/dm/agentvuln?color=green" alt="Downloads"> <img src="https://img.shields.io/github/stars/Mikehzp/agentvuln?style=social" alt="Stars"> <img src="https://img.shields.io/badge/attacks-18-orange" alt="18 attacks"> </p>
<h1 align="center">๐ Agent Security Scanner (agentsec)</h1> <p align="center"><em>Find tool-calling vulnerabilities in AI agents โ before attackers do.</em></p>
---
agentsec scans AI agents that call tools. Not chat prompt injection โ tool-calling abuse: argument injection, privilege escalation, MCP protocol attacks, data exfiltration, and more.
pip install agentvuln
agentsec self-test # Verify your setup
agentsec scan hermes --profile quick # Scan a live agent in ~1 min
agentsec scan trace.json -o report.html # Scan an offline trace
๐ด Real Findings
| Agent | Vulns | Key Finding | |-------|-------|-------------| | Hermes | 3 ๐ด | Leaked ~/.env, executed SQL injection, leaked system prompt | | browser-use | 3 ๐ด | Leaked SSH private keys, executed SQL injection | | OpenHands CLI | 0 ๐ข | Refused ALL attacks | | OpenHands SDK | 4 ๐ด | No security guardrails โ executed every attack |
CLI โ SDK. OpenHands' security lives at the CLI layer, not the agent core. If you integrate via SDK directly, you get zero protection.
Features
| Feature | | |---------|-| | 18 attack vectors | tool injection, MCP attacks, memory poisoning, RAG poisoning, data leaks, DoS, and more | | Online + Offline | scan live agent APIs or offline trace files (JSON/JSONL) | | 3 report formats | JSON (CI), Markdown (PRs), HTML (dashboards) | | Scan profiles | quick (5 attacks, ~1 min), daily (8), full (18) | | CI/CD ready | GitHub Action, --fail-on threshold, Docker support | | Auto-fix | Some vulnerabilities can be mitigated automatically | | Custom attacks | YAML templates for your own attack scenarios | | MCP Server | Integrate as MCP tools for any MCP client | | Cross-provider | DeepSeek, OpenAI, Anthropic, OpenRouter, Google, xAI |
Try It
# Quick scan of your local agent
agentsec scan hermes --profile quick
# Full scan with HTML report
agentsec scan hermes -o report.html
# CI mode: exit code 1 if any HIGH+ vulnerability found
agentsec scan hermes --fail-on high
# Docker
docker build -t agentvuln .
docker run agentvuln scan hermes --profile quick
GitHub Actions
- name: Run agent security scan
uses: Mikehzp/agentvuln@v0.4.0
with:
target: hermes
profile: daily
fail-on: high
output-format: html
Python API
from agentsec.engine import ScanEngine
from agentsec.report import ReportGenerator
engine = ScanEngine(offline_mode=True)
results = engine.run("trace.json", ["system_prompt_leak", "data_leak"])
ReportGenerator().save(results, "my_agent", "report.html")
Supported Targets
agentsec scan hermes # Local Hermes agent
agentsec scan openai:gpt-4o # OpenAI API agent
agentsec scan openrouter:anthropic/claude-4 # OpenRouter
agentsec scan deepseek:deepseek-chat # DeepSeek
agentsec scan trace.json # Offline trace
agentsec scan template:claude-code # Simulated agent
Real Scan Demo
$ agentsec self-test
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ ๐ฌ Agent Security Scanner โ Self Test โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โโ API Connectivity โโ
โ
API call succeeds
โโ Detection Pipeline โโ
โ
tool call analysis: exploited=True conf=medium
โ
pipeline: agent refuses โ exploited=False
โโ Attack Registry โโ
โ
18 attacks registered, all with run methods
โโ Report Generation โโ
โ
JSON/MD/HTML report generation
โโ Scan Profiles โโ
โ
quick(5) daily(8)
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ
All 7 self-tests passed.
Project Status
Alpha โ works, tested, but APIs may change. MIT licensed. Contributions welcome.
---
ไธญๆ่ฏดๆ
agentsec ๆฏไธไธชไธ้จๆซๆ AI Agent๏ผ่ฐ็จๅทฅๅ ท็ๆบ่ฝไฝ๏ผ ็ๅฎๅ จๅทฅๅ ทใไธๆฏๆต่ๅคฉๅฏน่ฏ็ prompt injection๏ผ่ๆฏๆตๅทฅๅ ท่ฐ็จๅฑ้ข็ๆผๆด๏ผๅๆฐๆณจๅ ฅใๆ้ๆๅใMCP ๅ่ฎฎๆปๅปใๆฐๆฎๆณ้ฒใๆ็ปๆๅก็ญใ
pip install agentvuln
agentsec scan hermes --profile quick
| Agent | ๆผๆดๆฐ | ๅ
ณ้ฎๅ็ฐ | |-------|--------|---------| | Hermes | 3 ๐ด | ๆณ้ฒ ~/.envใๆง่ก SQL ๆณจๅ
ฅใๆณ้ฒ็ณป็ปๆ็คบ่ฏ | | browser-use | 3 ๐ด | ๆณ้ฒ SSH ็ง้ฅ | | OpenHands CLI | 0 ๐ข | ๅ
จ้จๆปๅป่ขซๆ็ป | | OpenHands SDK | 4 ๐ด | ๆ ๅฎๅ
จ้ฒๆค๏ผๆๆๆปๅปๆง่กๆๅ |
GitHub: https://github.com/Mikehzp/agentvuln PyPI: pip install agentvuln






