agentvet 0.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- agentvet-0.5.0/LICENSE +21 -0
- agentvet-0.5.0/PKG-INFO +210 -0
- agentvet-0.5.0/README.md +176 -0
- agentvet-0.5.0/agentvet.egg-info/PKG-INFO +210 -0
- agentvet-0.5.0/agentvet.egg-info/SOURCES.txt +26 -0
- agentvet-0.5.0/agentvet.egg-info/dependency_links.txt +1 -0
- agentvet-0.5.0/agentvet.egg-info/entry_points.txt +2 -0
- agentvet-0.5.0/agentvet.egg-info/requires.txt +11 -0
- agentvet-0.5.0/agentvet.egg-info/top_level.txt +3 -0
- agentvet-0.5.0/cli/main.py +201 -0
- agentvet-0.5.0/pyproject.toml +65 -0
- agentvet-0.5.0/scanner/__init__.py +6 -0
- agentvet-0.5.0/scanner/engine.py +329 -0
- agentvet-0.5.0/scanner/findings.py +156 -0
- agentvet-0.5.0/scanner/l2_filter.py +206 -0
- agentvet-0.5.0/scanner/l3_audit.py +255 -0
- agentvet-0.5.0/scanner/l4_chain.py +282 -0
- agentvet-0.5.0/scanner/rules/__init__.py +1 -0
- agentvet-0.5.0/scanner/rules/data_leak.py +102 -0
- agentvet-0.5.0/scanner/rules/frameworks.py +199 -0
- agentvet-0.5.0/scanner/rules/mcp_config.py +505 -0
- agentvet-0.5.0/scanner/rules/prompt_injection.py +199 -0
- agentvet-0.5.0/scanner/rules/secrets.py +201 -0
- agentvet-0.5.0/scanner/rules/supply_chain.py +166 -0
- agentvet-0.5.0/scanner/rules/tool_auth.py +195 -0
- agentvet-0.5.0/setup.cfg +4 -0
- agentvet-0.5.0/web/__init__.py +0 -0
- agentvet-0.5.0/web/main.py +281 -0
agentvet-0.5.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 AgentVet
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
agentvet-0.5.0/PKG-INFO
ADDED
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentvet
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: AI Agent Security Scanner — detect prompt injection, tool auth bypass, data leaks
|
|
5
|
+
Author-email: tlyyxjz <tlyyxjz@users.noreply.github.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/tlyyxjz/agentvet
|
|
8
|
+
Project-URL: Repository, https://github.com/tlyyxjz/agentvet
|
|
9
|
+
Project-URL: Issues, https://github.com/tlyyxjz/agentvet/issues
|
|
10
|
+
Keywords: security,ai-agent,llm,prompt-injection,mcp,supply-chain,scanner,claude-code,cursor,agent-security
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: fastapi>=0.115.0
|
|
25
|
+
Requires-Dist: requests>=2.31.0
|
|
26
|
+
Requires-Dist: uvicorn>=0.30.0
|
|
27
|
+
Provides-Extra: web
|
|
28
|
+
Requires-Dist: fastapi; extra == "web"
|
|
29
|
+
Requires-Dist: uvicorn; extra == "web"
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest; extra == "dev"
|
|
32
|
+
Requires-Dist: ruff; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# AgentVet
|
|
36
|
+
|
|
37
|
+
**AI Agent Security Scanner** — detect prompt injection, tool auth bypass, and data leaks before attackers do.
|
|
38
|
+
|
|
39
|
+
[](https://www.python.org/downloads/)
|
|
40
|
+
[](LICENSE)
|
|
41
|
+
[]()
|
|
42
|
+
|
|
43
|
+
One command. Find vulnerabilities in your AI agent code.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
- **4-Tier Detection Pipeline**
|
|
50
|
+
- **L1** — Regex + AST patterns (fast, broad coverage)
|
|
51
|
+
- **L2** — Ollama semantic filter (removes false positives, ~24s/batch)
|
|
52
|
+
- **L3** — DeepSeek deep audit (attack paths + PoC + CVSS + fix, on HIGH/CRITICAL only)
|
|
53
|
+
- **L4** — Cross-finding attack chain synthesis (how vulns combine into full attack campaigns) — *unique to AgentVet*
|
|
54
|
+
- **22 Detection Rules** across 7 categories: prompt injection, tool authorization, data leakage, framework security, secret exposure, MCP config, and supply-chain
|
|
55
|
+
- **Web Dashboard** — React + Tailwind UI with scan history and per-finding drilldown
|
|
56
|
+
- **CLI Tool** — `agentvet scan ./my-agent --depth 3`
|
|
57
|
+
- **Zero data leaves your machine** (L1 is local-only; L2 uses local Ollama; L3 is opt-in via API key)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
### Prerequisites
|
|
64
|
+
|
|
65
|
+
- Python 3.10+
|
|
66
|
+
- [Ollama](https://ollama.com) (optional, for L2 semantic filtering)
|
|
67
|
+
- Pull a model: `ollama pull qwen3:8b`
|
|
68
|
+
- DeepSeek API key (optional, for L3 deep audit)
|
|
69
|
+
|
|
70
|
+
### Install
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/tlyyxjz/agentvet.git
|
|
74
|
+
cd agentvet
|
|
75
|
+
|
|
76
|
+
# Using pip
|
|
77
|
+
pip install -e .
|
|
78
|
+
|
|
79
|
+
# Or using uv
|
|
80
|
+
uv sync
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Usage
|
|
84
|
+
|
|
85
|
+
**CLI:**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# L1 only (fastest, some noise)
|
|
89
|
+
agentvet scan ./my-agent --depth 1
|
|
90
|
+
|
|
91
|
+
# L1 + L2 (removes false positives)
|
|
92
|
+
agentvet scan ./my-agent --depth 2
|
|
93
|
+
|
|
94
|
+
# Full pipeline (L1 + L2 + L3 deep audit)
|
|
95
|
+
agentvet scan ./my-agent --depth 3
|
|
96
|
+
|
|
97
|
+
# JSON output
|
|
98
|
+
python quick_scan.py --target ./my-agent --depth 3 --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Web Dashboard:**
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Start backend
|
|
105
|
+
uvicorn web.main:app --host 0.0.0.0 --port 8765
|
|
106
|
+
|
|
107
|
+
# Start frontend (in another terminal)
|
|
108
|
+
cd frontend && npm install && npm run dev
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Open `http://localhost:5173` to use the web dashboard.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Configuration
|
|
116
|
+
|
|
117
|
+
Copy `.env.example` to `.env` and set your values:
|
|
118
|
+
|
|
119
|
+
| Variable | Default | Purpose |
|
|
120
|
+
|----------|---------|---------|
|
|
121
|
+
| `OLLAMA_BASE_URL` | `http://127.0.0.1:11434` | Ollama API endpoint |
|
|
122
|
+
| `OLLAMA_MODEL` | `qwen3:8b` | Model for L2 filtering |
|
|
123
|
+
| `DEEPSEEK_API_KEY` | — | DeepSeek API key for L3 audit |
|
|
124
|
+
| `DEEPSEEK_BASE_URL` | `https://api.deepseek.com/v1/chat/completions` | DeepSeek endpoint |
|
|
125
|
+
| `DEEPSEEK_MODEL` | `deepseek-chat` | Model for L3 deep audit |
|
|
126
|
+
| `AGENTVET_DB` | `./agentvet.db` | SQLite database path |
|
|
127
|
+
| `ALLOWED_ORIGINS` | `http://localhost:5173,http://localhost:3000` | CORS origins |
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Architecture
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
scan target
|
|
135
|
+
│
|
|
136
|
+
├─ L1: RegexRule + ASTRule (~1s, free, ~60% coverage)
|
|
137
|
+
│ └─ 17 rules auto-discovered from scanner/rules/
|
|
138
|
+
│
|
|
139
|
+
├─ L2: Ollama qwen3:8b (~24s, free, removes ~30% noise)
|
|
140
|
+
│ └─ Batch classify: REAL vs NOISE
|
|
141
|
+
│
|
|
142
|
+
├─ L3: DeepSeek-chat (~10s/finding, ~$0.01/scan)
|
|
143
|
+
│ └─ Per-finding: attack path + exploit demo + CVSS + fix
|
|
144
|
+
│
|
|
145
|
+
└─ L4: DeepSeek-chat (~15s, one call total)
|
|
146
|
+
└─ Cross-finding chain synthesis: how vulns combine into attack campaigns
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Detection Rules
|
|
150
|
+
|
|
151
|
+
| ID | Category | Rule |
|
|
152
|
+
|----|----------|------|
|
|
153
|
+
| PI-001 | Prompt Injection | Direct user input concatenation to LLM prompt |
|
|
154
|
+
| PI-002 | Prompt Injection | Missing input sanitization |
|
|
155
|
+
| PI-003 | Prompt Injection | No system defense prompt |
|
|
156
|
+
| TA-001 | Tool Auth | High-risk tool without user confirmation |
|
|
157
|
+
| TA-002 | Tool Auth | Missing tool permission check |
|
|
158
|
+
| DL-001 | Data Leak | Sensitive data logged |
|
|
159
|
+
| DL-002 | Data Leak | External service call without audit |
|
|
160
|
+
| FW-001 | Frameworks | LangChain @tool executes dangerous op without confirm |
|
|
161
|
+
| FW-002 | Frameworks | AutoGen code execution without Docker sandbox |
|
|
162
|
+
| FW-003 | Frameworks | CrewAI Task allows code exec without validation |
|
|
163
|
+
| FW-004 | Frameworks | Dify plugin API endpoint missing permission check |
|
|
164
|
+
| SEC-001 | Secrets | AI provider API key embedded in source code |
|
|
165
|
+
| SEC-002 | Secrets | Cloud provider credential in source code |
|
|
166
|
+
| SEC-003 | Secrets | Generic password/token/db-url in source code |
|
|
167
|
+
| MCP-001 | MCP Config | MCP server registered without authentication |
|
|
168
|
+
| MCP-002 | MCP Config | MCP server env contains plaintext secrets |
|
|
169
|
+
| MCP-003 | MCP Config | MCP server command from user-writable path |
|
|
170
|
+
| MCP-004 | MCP Config | MCP tool description contains prompt injection payload |
|
|
171
|
+
| PI-004 | Prompt Injection | IDE rule file (.cursorrules/.windsurfrules) with suspicious directives |
|
|
172
|
+
| TA-003 | Tool Auth | Cross-agent delegation loses caller permission context |
|
|
173
|
+
| SC-001 | Supply Chain | Skill/plugin contains obfuscated payload or exfiltration endpoint |
|
|
174
|
+
| SC-002 | Supply Chain | Skill manifest references suspicious external URL (pastebin/raw/gist) |
|
|
175
|
+
|
|
176
|
+
All 22 rules auto-discover from `scanner/rules/` — no registration needed. Each rule maps to OWASP LLM Top 10 (2025) and OWASP Agentic AI Top 10 categories.
|
|
177
|
+
|
|
178
|
+
### Project Structure
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
agentvet/
|
|
182
|
+
├── scanner/ # Core scan engine
|
|
183
|
+
│ ├── engine.py # ScanEngine + Rule base classes
|
|
184
|
+
│ ├── findings.py # Finding + ScanReport data models
|
|
185
|
+
│ ├── l2_filter.py # L2 Ollama semantic filter
|
|
186
|
+
│ ├── l3_audit.py # L3 DeepSeek deep audit
|
|
187
|
+
│ └── rules/ # Detection rules
|
|
188
|
+
├── cli/ # CLI entrypoint
|
|
189
|
+
├── web/ # FastAPI backend
|
|
190
|
+
├── frontend/ # React + Vite + Tailwind
|
|
191
|
+
├── docs/ # Documentation
|
|
192
|
+
└── tests/ # Test suite (coming soon)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Roadmap
|
|
198
|
+
|
|
199
|
+
- [ ] npm distribution (`npx agentvet scan`)
|
|
200
|
+
- [ ] More detection rules (CSRF, SSRF, path traversal in agent tools)
|
|
201
|
+
- [ ] Docker image
|
|
202
|
+
- [ ] Supabase migration for cloud deployment
|
|
203
|
+
- [ ] VS Code extension
|
|
204
|
+
- [ ] GitHub Action (`agentvet/scan`)
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT — see [LICENSE](LICENSE).
|
agentvet-0.5.0/README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
# AgentVet
|
|
2
|
+
|
|
3
|
+
**AI Agent Security Scanner** — detect prompt injection, tool auth bypass, and data leaks before attackers do.
|
|
4
|
+
|
|
5
|
+
[](https://www.python.org/downloads/)
|
|
6
|
+
[](LICENSE)
|
|
7
|
+
[]()
|
|
8
|
+
|
|
9
|
+
One command. Find vulnerabilities in your AI agent code.
|
|
10
|
+
|
|
11
|
+
---
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
- **4-Tier Detection Pipeline**
|
|
16
|
+
- **L1** — Regex + AST patterns (fast, broad coverage)
|
|
17
|
+
- **L2** — Ollama semantic filter (removes false positives, ~24s/batch)
|
|
18
|
+
- **L3** — DeepSeek deep audit (attack paths + PoC + CVSS + fix, on HIGH/CRITICAL only)
|
|
19
|
+
- **L4** — Cross-finding attack chain synthesis (how vulns combine into full attack campaigns) — *unique to AgentVet*
|
|
20
|
+
- **22 Detection Rules** across 7 categories: prompt injection, tool authorization, data leakage, framework security, secret exposure, MCP config, and supply-chain
|
|
21
|
+
- **Web Dashboard** — React + Tailwind UI with scan history and per-finding drilldown
|
|
22
|
+
- **CLI Tool** — `agentvet scan ./my-agent --depth 3`
|
|
23
|
+
- **Zero data leaves your machine** (L1 is local-only; L2 uses local Ollama; L3 is opt-in via API key)
|
|
24
|
+
|
|
25
|
+
---
|
|
26
|
+
|
|
27
|
+
## Quick Start
|
|
28
|
+
|
|
29
|
+
### Prerequisites
|
|
30
|
+
|
|
31
|
+
- Python 3.10+
|
|
32
|
+
- [Ollama](https://ollama.com) (optional, for L2 semantic filtering)
|
|
33
|
+
- Pull a model: `ollama pull qwen3:8b`
|
|
34
|
+
- DeepSeek API key (optional, for L3 deep audit)
|
|
35
|
+
|
|
36
|
+
### Install
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
git clone https://github.com/tlyyxjz/agentvet.git
|
|
40
|
+
cd agentvet
|
|
41
|
+
|
|
42
|
+
# Using pip
|
|
43
|
+
pip install -e .
|
|
44
|
+
|
|
45
|
+
# Or using uv
|
|
46
|
+
uv sync
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### Usage
|
|
50
|
+
|
|
51
|
+
**CLI:**
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
# L1 only (fastest, some noise)
|
|
55
|
+
agentvet scan ./my-agent --depth 1
|
|
56
|
+
|
|
57
|
+
# L1 + L2 (removes false positives)
|
|
58
|
+
agentvet scan ./my-agent --depth 2
|
|
59
|
+
|
|
60
|
+
# Full pipeline (L1 + L2 + L3 deep audit)
|
|
61
|
+
agentvet scan ./my-agent --depth 3
|
|
62
|
+
|
|
63
|
+
# JSON output
|
|
64
|
+
python quick_scan.py --target ./my-agent --depth 3 --json
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
**Web Dashboard:**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
# Start backend
|
|
71
|
+
uvicorn web.main:app --host 0.0.0.0 --port 8765
|
|
72
|
+
|
|
73
|
+
# Start frontend (in another terminal)
|
|
74
|
+
cd frontend && npm install && npm run dev
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Open `http://localhost:5173` to use the web dashboard.
|
|
78
|
+
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Configuration
|
|
82
|
+
|
|
83
|
+
Copy `.env.example` to `.env` and set your values:
|
|
84
|
+
|
|
85
|
+
| Variable | Default | Purpose |
|
|
86
|
+
|----------|---------|---------|
|
|
87
|
+
| `OLLAMA_BASE_URL` | `http://127.0.0.1:11434` | Ollama API endpoint |
|
|
88
|
+
| `OLLAMA_MODEL` | `qwen3:8b` | Model for L2 filtering |
|
|
89
|
+
| `DEEPSEEK_API_KEY` | — | DeepSeek API key for L3 audit |
|
|
90
|
+
| `DEEPSEEK_BASE_URL` | `https://api.deepseek.com/v1/chat/completions` | DeepSeek endpoint |
|
|
91
|
+
| `DEEPSEEK_MODEL` | `deepseek-chat` | Model for L3 deep audit |
|
|
92
|
+
| `AGENTVET_DB` | `./agentvet.db` | SQLite database path |
|
|
93
|
+
| `ALLOWED_ORIGINS` | `http://localhost:5173,http://localhost:3000` | CORS origins |
|
|
94
|
+
|
|
95
|
+
---
|
|
96
|
+
|
|
97
|
+
## Architecture
|
|
98
|
+
|
|
99
|
+
```
|
|
100
|
+
scan target
|
|
101
|
+
│
|
|
102
|
+
├─ L1: RegexRule + ASTRule (~1s, free, ~60% coverage)
|
|
103
|
+
│ └─ 17 rules auto-discovered from scanner/rules/
|
|
104
|
+
│
|
|
105
|
+
├─ L2: Ollama qwen3:8b (~24s, free, removes ~30% noise)
|
|
106
|
+
│ └─ Batch classify: REAL vs NOISE
|
|
107
|
+
│
|
|
108
|
+
├─ L3: DeepSeek-chat (~10s/finding, ~$0.01/scan)
|
|
109
|
+
│ └─ Per-finding: attack path + exploit demo + CVSS + fix
|
|
110
|
+
│
|
|
111
|
+
└─ L4: DeepSeek-chat (~15s, one call total)
|
|
112
|
+
└─ Cross-finding chain synthesis: how vulns combine into attack campaigns
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
### Detection Rules
|
|
116
|
+
|
|
117
|
+
| ID | Category | Rule |
|
|
118
|
+
|----|----------|------|
|
|
119
|
+
| PI-001 | Prompt Injection | Direct user input concatenation to LLM prompt |
|
|
120
|
+
| PI-002 | Prompt Injection | Missing input sanitization |
|
|
121
|
+
| PI-003 | Prompt Injection | No system defense prompt |
|
|
122
|
+
| TA-001 | Tool Auth | High-risk tool without user confirmation |
|
|
123
|
+
| TA-002 | Tool Auth | Missing tool permission check |
|
|
124
|
+
| DL-001 | Data Leak | Sensitive data logged |
|
|
125
|
+
| DL-002 | Data Leak | External service call without audit |
|
|
126
|
+
| FW-001 | Frameworks | LangChain @tool executes dangerous op without confirm |
|
|
127
|
+
| FW-002 | Frameworks | AutoGen code execution without Docker sandbox |
|
|
128
|
+
| FW-003 | Frameworks | CrewAI Task allows code exec without validation |
|
|
129
|
+
| FW-004 | Frameworks | Dify plugin API endpoint missing permission check |
|
|
130
|
+
| SEC-001 | Secrets | AI provider API key embedded in source code |
|
|
131
|
+
| SEC-002 | Secrets | Cloud provider credential in source code |
|
|
132
|
+
| SEC-003 | Secrets | Generic password/token/db-url in source code |
|
|
133
|
+
| MCP-001 | MCP Config | MCP server registered without authentication |
|
|
134
|
+
| MCP-002 | MCP Config | MCP server env contains plaintext secrets |
|
|
135
|
+
| MCP-003 | MCP Config | MCP server command from user-writable path |
|
|
136
|
+
| MCP-004 | MCP Config | MCP tool description contains prompt injection payload |
|
|
137
|
+
| PI-004 | Prompt Injection | IDE rule file (.cursorrules/.windsurfrules) with suspicious directives |
|
|
138
|
+
| TA-003 | Tool Auth | Cross-agent delegation loses caller permission context |
|
|
139
|
+
| SC-001 | Supply Chain | Skill/plugin contains obfuscated payload or exfiltration endpoint |
|
|
140
|
+
| SC-002 | Supply Chain | Skill manifest references suspicious external URL (pastebin/raw/gist) |
|
|
141
|
+
|
|
142
|
+
All 22 rules auto-discover from `scanner/rules/` — no registration needed. Each rule maps to OWASP LLM Top 10 (2025) and OWASP Agentic AI Top 10 categories.
|
|
143
|
+
|
|
144
|
+
### Project Structure
|
|
145
|
+
|
|
146
|
+
```
|
|
147
|
+
agentvet/
|
|
148
|
+
├── scanner/ # Core scan engine
|
|
149
|
+
│ ├── engine.py # ScanEngine + Rule base classes
|
|
150
|
+
│ ├── findings.py # Finding + ScanReport data models
|
|
151
|
+
│ ├── l2_filter.py # L2 Ollama semantic filter
|
|
152
|
+
│ ├── l3_audit.py # L3 DeepSeek deep audit
|
|
153
|
+
│ └── rules/ # Detection rules
|
|
154
|
+
├── cli/ # CLI entrypoint
|
|
155
|
+
├── web/ # FastAPI backend
|
|
156
|
+
├── frontend/ # React + Vite + Tailwind
|
|
157
|
+
├── docs/ # Documentation
|
|
158
|
+
└── tests/ # Test suite (coming soon)
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
---
|
|
162
|
+
|
|
163
|
+
## Roadmap
|
|
164
|
+
|
|
165
|
+
- [ ] npm distribution (`npx agentvet scan`)
|
|
166
|
+
- [ ] More detection rules (CSRF, SSRF, path traversal in agent tools)
|
|
167
|
+
- [ ] Docker image
|
|
168
|
+
- [ ] Supabase migration for cloud deployment
|
|
169
|
+
- [ ] VS Code extension
|
|
170
|
+
- [ ] GitHub Action (`agentvet/scan`)
|
|
171
|
+
|
|
172
|
+
---
|
|
173
|
+
|
|
174
|
+
## License
|
|
175
|
+
|
|
176
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: agentvet
|
|
3
|
+
Version: 0.5.0
|
|
4
|
+
Summary: AI Agent Security Scanner — detect prompt injection, tool auth bypass, data leaks
|
|
5
|
+
Author-email: tlyyxjz <tlyyxjz@users.noreply.github.com>
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://github.com/tlyyxjz/agentvet
|
|
8
|
+
Project-URL: Repository, https://github.com/tlyyxjz/agentvet
|
|
9
|
+
Project-URL: Issues, https://github.com/tlyyxjz/agentvet/issues
|
|
10
|
+
Keywords: security,ai-agent,llm,prompt-injection,mcp,supply-chain,scanner,claude-code,cursor,agent-security
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.10
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
18
|
+
Classifier: Topic :: Security
|
|
19
|
+
Classifier: Topic :: Software Development :: Quality Assurance
|
|
20
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
+
Requires-Python: >=3.10
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Requires-Dist: fastapi>=0.115.0
|
|
25
|
+
Requires-Dist: requests>=2.31.0
|
|
26
|
+
Requires-Dist: uvicorn>=0.30.0
|
|
27
|
+
Provides-Extra: web
|
|
28
|
+
Requires-Dist: fastapi; extra == "web"
|
|
29
|
+
Requires-Dist: uvicorn; extra == "web"
|
|
30
|
+
Provides-Extra: dev
|
|
31
|
+
Requires-Dist: pytest; extra == "dev"
|
|
32
|
+
Requires-Dist: ruff; extra == "dev"
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
|
|
35
|
+
# AgentVet
|
|
36
|
+
|
|
37
|
+
**AI Agent Security Scanner** — detect prompt injection, tool auth bypass, and data leaks before attackers do.
|
|
38
|
+
|
|
39
|
+
[](https://www.python.org/downloads/)
|
|
40
|
+
[](LICENSE)
|
|
41
|
+
[]()
|
|
42
|
+
|
|
43
|
+
One command. Find vulnerabilities in your AI agent code.
|
|
44
|
+
|
|
45
|
+
---
|
|
46
|
+
|
|
47
|
+
## Features
|
|
48
|
+
|
|
49
|
+
- **4-Tier Detection Pipeline**
|
|
50
|
+
- **L1** — Regex + AST patterns (fast, broad coverage)
|
|
51
|
+
- **L2** — Ollama semantic filter (removes false positives, ~24s/batch)
|
|
52
|
+
- **L3** — DeepSeek deep audit (attack paths + PoC + CVSS + fix, on HIGH/CRITICAL only)
|
|
53
|
+
- **L4** — Cross-finding attack chain synthesis (how vulns combine into full attack campaigns) — *unique to AgentVet*
|
|
54
|
+
- **22 Detection Rules** across 7 categories: prompt injection, tool authorization, data leakage, framework security, secret exposure, MCP config, and supply-chain
|
|
55
|
+
- **Web Dashboard** — React + Tailwind UI with scan history and per-finding drilldown
|
|
56
|
+
- **CLI Tool** — `agentvet scan ./my-agent --depth 3`
|
|
57
|
+
- **Zero data leaves your machine** (L1 is local-only; L2 uses local Ollama; L3 is opt-in via API key)
|
|
58
|
+
|
|
59
|
+
---
|
|
60
|
+
|
|
61
|
+
## Quick Start
|
|
62
|
+
|
|
63
|
+
### Prerequisites
|
|
64
|
+
|
|
65
|
+
- Python 3.10+
|
|
66
|
+
- [Ollama](https://ollama.com) (optional, for L2 semantic filtering)
|
|
67
|
+
- Pull a model: `ollama pull qwen3:8b`
|
|
68
|
+
- DeepSeek API key (optional, for L3 deep audit)
|
|
69
|
+
|
|
70
|
+
### Install
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
git clone https://github.com/tlyyxjz/agentvet.git
|
|
74
|
+
cd agentvet
|
|
75
|
+
|
|
76
|
+
# Using pip
|
|
77
|
+
pip install -e .
|
|
78
|
+
|
|
79
|
+
# Or using uv
|
|
80
|
+
uv sync
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Usage
|
|
84
|
+
|
|
85
|
+
**CLI:**
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
# L1 only (fastest, some noise)
|
|
89
|
+
agentvet scan ./my-agent --depth 1
|
|
90
|
+
|
|
91
|
+
# L1 + L2 (removes false positives)
|
|
92
|
+
agentvet scan ./my-agent --depth 2
|
|
93
|
+
|
|
94
|
+
# Full pipeline (L1 + L2 + L3 deep audit)
|
|
95
|
+
agentvet scan ./my-agent --depth 3
|
|
96
|
+
|
|
97
|
+
# JSON output
|
|
98
|
+
python quick_scan.py --target ./my-agent --depth 3 --json
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
**Web Dashboard:**
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
# Start backend
|
|
105
|
+
uvicorn web.main:app --host 0.0.0.0 --port 8765
|
|
106
|
+
|
|
107
|
+
# Start frontend (in another terminal)
|
|
108
|
+
cd frontend && npm install && npm run dev
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Open `http://localhost:5173` to use the web dashboard.
|
|
112
|
+
|
|
113
|
+
---
|
|
114
|
+
|
|
115
|
+
## Configuration
|
|
116
|
+
|
|
117
|
+
Copy `.env.example` to `.env` and set your values:
|
|
118
|
+
|
|
119
|
+
| Variable | Default | Purpose |
|
|
120
|
+
|----------|---------|---------|
|
|
121
|
+
| `OLLAMA_BASE_URL` | `http://127.0.0.1:11434` | Ollama API endpoint |
|
|
122
|
+
| `OLLAMA_MODEL` | `qwen3:8b` | Model for L2 filtering |
|
|
123
|
+
| `DEEPSEEK_API_KEY` | — | DeepSeek API key for L3 audit |
|
|
124
|
+
| `DEEPSEEK_BASE_URL` | `https://api.deepseek.com/v1/chat/completions` | DeepSeek endpoint |
|
|
125
|
+
| `DEEPSEEK_MODEL` | `deepseek-chat` | Model for L3 deep audit |
|
|
126
|
+
| `AGENTVET_DB` | `./agentvet.db` | SQLite database path |
|
|
127
|
+
| `ALLOWED_ORIGINS` | `http://localhost:5173,http://localhost:3000` | CORS origins |
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## Architecture
|
|
132
|
+
|
|
133
|
+
```
|
|
134
|
+
scan target
|
|
135
|
+
│
|
|
136
|
+
├─ L1: RegexRule + ASTRule (~1s, free, ~60% coverage)
|
|
137
|
+
│ └─ 17 rules auto-discovered from scanner/rules/
|
|
138
|
+
│
|
|
139
|
+
├─ L2: Ollama qwen3:8b (~24s, free, removes ~30% noise)
|
|
140
|
+
│ └─ Batch classify: REAL vs NOISE
|
|
141
|
+
│
|
|
142
|
+
├─ L3: DeepSeek-chat (~10s/finding, ~$0.01/scan)
|
|
143
|
+
│ └─ Per-finding: attack path + exploit demo + CVSS + fix
|
|
144
|
+
│
|
|
145
|
+
└─ L4: DeepSeek-chat (~15s, one call total)
|
|
146
|
+
└─ Cross-finding chain synthesis: how vulns combine into attack campaigns
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
### Detection Rules
|
|
150
|
+
|
|
151
|
+
| ID | Category | Rule |
|
|
152
|
+
|----|----------|------|
|
|
153
|
+
| PI-001 | Prompt Injection | Direct user input concatenation to LLM prompt |
|
|
154
|
+
| PI-002 | Prompt Injection | Missing input sanitization |
|
|
155
|
+
| PI-003 | Prompt Injection | No system defense prompt |
|
|
156
|
+
| TA-001 | Tool Auth | High-risk tool without user confirmation |
|
|
157
|
+
| TA-002 | Tool Auth | Missing tool permission check |
|
|
158
|
+
| DL-001 | Data Leak | Sensitive data logged |
|
|
159
|
+
| DL-002 | Data Leak | External service call without audit |
|
|
160
|
+
| FW-001 | Frameworks | LangChain @tool executes dangerous op without confirm |
|
|
161
|
+
| FW-002 | Frameworks | AutoGen code execution without Docker sandbox |
|
|
162
|
+
| FW-003 | Frameworks | CrewAI Task allows code exec without validation |
|
|
163
|
+
| FW-004 | Frameworks | Dify plugin API endpoint missing permission check |
|
|
164
|
+
| SEC-001 | Secrets | AI provider API key embedded in source code |
|
|
165
|
+
| SEC-002 | Secrets | Cloud provider credential in source code |
|
|
166
|
+
| SEC-003 | Secrets | Generic password/token/db-url in source code |
|
|
167
|
+
| MCP-001 | MCP Config | MCP server registered without authentication |
|
|
168
|
+
| MCP-002 | MCP Config | MCP server env contains plaintext secrets |
|
|
169
|
+
| MCP-003 | MCP Config | MCP server command from user-writable path |
|
|
170
|
+
| MCP-004 | MCP Config | MCP tool description contains prompt injection payload |
|
|
171
|
+
| PI-004 | Prompt Injection | IDE rule file (.cursorrules/.windsurfrules) with suspicious directives |
|
|
172
|
+
| TA-003 | Tool Auth | Cross-agent delegation loses caller permission context |
|
|
173
|
+
| SC-001 | Supply Chain | Skill/plugin contains obfuscated payload or exfiltration endpoint |
|
|
174
|
+
| SC-002 | Supply Chain | Skill manifest references suspicious external URL (pastebin/raw/gist) |
|
|
175
|
+
|
|
176
|
+
All 22 rules auto-discover from `scanner/rules/` — no registration needed. Each rule maps to OWASP LLM Top 10 (2025) and OWASP Agentic AI Top 10 categories.
|
|
177
|
+
|
|
178
|
+
### Project Structure
|
|
179
|
+
|
|
180
|
+
```
|
|
181
|
+
agentvet/
|
|
182
|
+
├── scanner/ # Core scan engine
|
|
183
|
+
│ ├── engine.py # ScanEngine + Rule base classes
|
|
184
|
+
│ ├── findings.py # Finding + ScanReport data models
|
|
185
|
+
│ ├── l2_filter.py # L2 Ollama semantic filter
|
|
186
|
+
│ ├── l3_audit.py # L3 DeepSeek deep audit
|
|
187
|
+
│ └── rules/ # Detection rules
|
|
188
|
+
├── cli/ # CLI entrypoint
|
|
189
|
+
├── web/ # FastAPI backend
|
|
190
|
+
├── frontend/ # React + Vite + Tailwind
|
|
191
|
+
├── docs/ # Documentation
|
|
192
|
+
└── tests/ # Test suite (coming soon)
|
|
193
|
+
```
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
## Roadmap
|
|
198
|
+
|
|
199
|
+
- [ ] npm distribution (`npx agentvet scan`)
|
|
200
|
+
- [ ] More detection rules (CSRF, SSRF, path traversal in agent tools)
|
|
201
|
+
- [ ] Docker image
|
|
202
|
+
- [ ] Supabase migration for cloud deployment
|
|
203
|
+
- [ ] VS Code extension
|
|
204
|
+
- [ ] GitHub Action (`agentvet/scan`)
|
|
205
|
+
|
|
206
|
+
---
|
|
207
|
+
|
|
208
|
+
## License
|
|
209
|
+
|
|
210
|
+
MIT — see [LICENSE](LICENSE).
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
LICENSE
|
|
2
|
+
README.md
|
|
3
|
+
pyproject.toml
|
|
4
|
+
agentvet.egg-info/PKG-INFO
|
|
5
|
+
agentvet.egg-info/SOURCES.txt
|
|
6
|
+
agentvet.egg-info/dependency_links.txt
|
|
7
|
+
agentvet.egg-info/entry_points.txt
|
|
8
|
+
agentvet.egg-info/requires.txt
|
|
9
|
+
agentvet.egg-info/top_level.txt
|
|
10
|
+
cli/main.py
|
|
11
|
+
scanner/__init__.py
|
|
12
|
+
scanner/engine.py
|
|
13
|
+
scanner/findings.py
|
|
14
|
+
scanner/l2_filter.py
|
|
15
|
+
scanner/l3_audit.py
|
|
16
|
+
scanner/l4_chain.py
|
|
17
|
+
scanner/rules/__init__.py
|
|
18
|
+
scanner/rules/data_leak.py
|
|
19
|
+
scanner/rules/frameworks.py
|
|
20
|
+
scanner/rules/mcp_config.py
|
|
21
|
+
scanner/rules/prompt_injection.py
|
|
22
|
+
scanner/rules/secrets.py
|
|
23
|
+
scanner/rules/supply_chain.py
|
|
24
|
+
scanner/rules/tool_auth.py
|
|
25
|
+
web/__init__.py
|
|
26
|
+
web/main.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|