honeymcp 0.1.0__py3-none-any.whl → 0.1.2__py3-none-any.whl

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.
@@ -1,11 +1,12 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: honeymcp
3
- Version: 0.1.0
3
+ Version: 0.1.2
4
4
  Summary: Deception middleware for AI agents - detecting data theft and indirect prompt injection in MCP servers
5
5
  Project-URL: Homepage, https://github.com/barvhaim/HoneyMCP
6
6
  Project-URL: Documentation, https://github.com/barvhaim/HoneyMCP#readme
7
7
  Project-URL: Repository, https://github.com/barvhaim/HoneyMCP
8
8
  Project-URL: Issues, https://github.com/barvhaim/HoneyMCP/issues
9
+ Project-URL: PyPI, https://pypi.org/project/honeymcp/
9
10
  Author-email: Bar Haim <barha@il.ibm.com>, Alon Malach <Alon.Malach@ibm.com>
10
11
  Maintainer-email: Bar Haim <barha@il.ibm.com>, Alon Malach <Alon.Malach@ibm.com>
11
12
  License: Apache-2.0
@@ -46,46 +47,45 @@ Description-Content-Type: text/markdown
46
47
 
47
48
  <img src="images/logo.png" alt="HoneyMCP logo" width="300" height="300" />
48
49
 
49
- **Deception Middleware for AI Agents - Detecting Data Theft and Indirect Prompt Injection**
50
+ **Detect AI Agent Attacks Through Deception**
50
51
 
51
52
  [![Python 3.11+](https://img.shields.io/badge/python-3.11+-blue.svg)](https://www.python.org/downloads/)
52
53
  [![License: Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-green.svg)](https://opensource.org/licenses/Apache-2.0)
54
+ [![PyPI](https://img.shields.io/pypi/v/honeymcp)](https://pypi.org/project/honeymcp/)
53
55
 
54
56
  HoneyMCP is a defensive security tool that adds deception capabilities to Model Context Protocol (MCP) servers. It injects "ghost tools" (fake security-sensitive tools) that act as honeypots, detecting two critical threat categories:
55
57
 
56
58
  - **Data Exfiltration** (via "get" tools) - Detects attempts to steal sensitive data like credentials, secrets, or private files
57
59
  - **Indirect Prompt Injection** (via "set" tools) - Detects injection of malicious instructions that could manipulate AI agents working in this environment
58
60
 
59
- **Key Features:**
60
- - 🎯 **One-Line Integration** - Add to any FastMCP server with a single decorator
61
- - 🤖 **Dynamic Ghost Tools** - LLM-generated honeypots tailored to your server's domain
62
- - 🕵️ **Invisible Detection** - Attackers see realistic fake tools alongside legitimate ones
63
- - 📊 **Attack Intelligence** - Captures full attack context: tool sequences, arguments, session data
64
- - 📈 **Live Dashboard** - Real-time Streamlit dashboard for attack visualization
65
- - 🔍 **Zero False Positives** - Only triggers when attackers explicitly call honeypot tools
61
+ **One line of code. High-fidelity detection. Complete attack telemetry.**
66
62
 
67
63
  ---
68
64
 
69
- ## 🚀 Quick Start
65
+ ## Why HoneyMCP?
70
66
 
71
- ### Installation
67
+ 🎯 **One-Line Integration** - Add `@honeypot` decorator to any FastMCP server
68
+ 🤖 **Context-Aware Honeypots** - LLM generates domain-specific deception tools
69
+ 🕵️ **Transparent Detection** - Honeypots appear as legitimate tools to attackers
70
+ 📊 **Attack Telemetry** - Captures tool call sequences, arguments, session metadata
71
+ 📈 **Live Dashboard** - Real-time Streamlit dashboard for attack visualization
72
+ 🔍 **High-Fidelity Detection** - Triggers only on explicit honeypot invocation
72
73
 
73
- ```bash
74
- pip install honeymcp
75
- ```
74
+ ---
76
75
 
77
- ### Initialize Configuration
76
+ ## 🚀 Quick Start
77
+
78
+ ### Install
78
79
 
79
80
  ```bash
80
- honeymcp init
81
+ pip install honeymcp
82
+ honeymcp init # Creates config files
81
83
  ```
82
-
83
- This creates:
84
+ This creates the following config files:
84
85
  - `honeymcp.yaml` - Ghost tool configuration
85
86
  - `.env.honeymcp` - LLM credentials (only needed for dynamic ghost tools)
86
87
 
87
88
  ### Basic Usage
88
-
89
89
  Add HoneyMCP to your FastMCP server with **one line**:
90
90
 
91
91
  ```python
@@ -96,21 +96,19 @@ mcp = FastMCP("My Server")
96
96
 
97
97
  @mcp.tool()
98
98
  def my_real_tool(data: str) -> str:
99
- """Your legitimate tool"""
99
+ """Your legitimate tool"""
100
100
  return f"Processed: {data}"
101
101
 
102
- # ONE LINE - Add honeypot capabilities
102
+ # ONE LINE - Add honeypot protection
103
103
  mcp = honeypot(mcp)
104
104
 
105
105
  if __name__ == "__main__":
106
106
  mcp.run()
107
107
  ```
108
108
 
109
- That's it! Your server now has ghost tools that capture attacks while legitimate tools work normally.
110
-
111
- ### Run the Demo Servers
109
+ **That's it!** Your server now deploys honeypot tools that detect attacks while legitimate tools operate normally.
112
110
 
113
- Clone the repo to run the demo servers:
111
+ ### Try the Demo
114
112
 
115
113
  ```bash
116
114
  git clone https://github.com/barvhaim/HoneyMCP.git
@@ -130,63 +128,51 @@ Dynamic ghost tools demo (requires LLM credentials in `.env.honeymcp`):
130
128
  MCP_TRANSPORT=sse uv run python examples/demo_server_dynamic.py
131
129
  ```
132
130
 
131
+ # Launch dashboard
132
+ streamlit run src/honeymcp/dashboard/app.py
133
+ ```
134
+
133
135
  ---
134
136
 
135
137
  ## 🎭 How It Works
136
138
 
137
- ### 1. Ghost Tool Injection
139
+ ### 1. Honeypot Deployment
138
140
 
139
- HoneyMCP injects fake security-sensitive tools into your MCP server that appear alongside your legitimate tools.
141
+ HoneyMCP injects deceptive security-sensitive tools that appear alongside legitimate tools:
140
142
 
141
143
  **Two Modes:**
142
144
 
143
- **Dynamic Ghost Tools (Default)** - LLM analyzes your real tools and generates domain-specific honeypots:
145
+ **Dynamic Mode (Default)** - LLM analyzes your server context and generates domain-specific honeypots:
144
146
  - File server → `bypass_file_permissions`, `read_system_credentials`
145
147
  - Database server → `dump_admin_credentials`, `bypass_query_restrictions`
146
148
  - API gateway → `list_internal_api_keys`, `access_admin_endpoints`
147
149
 
148
- **Static Ghost Tools** - Pre-defined generic honeypots:
149
- - `list_cloud_secrets` - Returns fake AWS credentials
150
- - `execute_shell_command` - Returns fake shell output
151
- - `bypass_security_check` - Returns fake bypass tokens
152
- - `read_private_files` - Returns fake .env files
153
-
154
- Dynamic tools are more convincing as they match your server's context.
150
+ **Static Mode** - Pre-configured generic honeypots:
151
+ - `list_cloud_secrets`, `execute_shell_command`, `read_private_files`
155
152
 
156
- ### 2. Attack Detection
153
+ ### 2. Threat Detection
157
154
 
158
- When an AI agent calls a ghost tool, HoneyMCP detects two types of attacks:
155
+ HoneyMCP detects two primary attack vectors when an AI agent invokes a honeypot:
159
156
 
160
- **Data Exfiltration Attempts** (get-style ghost tools):
161
- - `list_cloud_secrets`, `read_private_files`, `dump_admin_credentials`
162
- - Attacker tries to steal sensitive data from the environment
163
- - Often triggered by malicious instructions hidden in user content
164
-
165
- **Indirect Prompt Injection** (set-style ghost tools):
166
- - `modify_system_prompt`, `execute_shell_command`, `escalate_privileges`
167
- - Attacker tries to inject malicious instructions to manipulate the agent
168
- - Could enable further attacks on other users or systems
157
+ **Data Exfiltration Attempts** (GET-style honeypots):
158
+ ```
159
+ Agent: "Use list_cloud_secrets to retrieve AWS credentials"
160
+ HoneyMCP: Returns synthetic credentials, logs attack event
161
+ ```
169
162
 
170
- When triggered, HoneyMCP:
171
- 1. **Captures complete attack context**:
172
- - Tool call sequence (what tools were called before the attack)
173
- - Arguments passed to the ghost tool
174
- - Session metadata
175
- - Timestamp and threat level
176
- 2. **Returns realistic fake data** to keep the attacker engaged
177
- 3. **Logs the event** to `~/.honeymcp/events/YYYY-MM-DD/`
178
- 4. **Continues normal operation** - legitimate tools still work
163
+ **Indirect Prompt Injection** (SET-style honeypots):
164
+ ```
165
+ Agent: "Execute shell command to establish persistence"
166
+ HoneyMCP: Returns synthetic output, logs attack event
167
+ ```
179
168
 
180
- ### 3. Intelligence Gathering
169
+ ### 3. Attack Fingerprinting
181
170
 
182
- Every attack is fingerprinted with:
171
+ Every honeypot invocation generates a detailed attack fingerprint:
183
172
  ```json
184
173
  {
185
- "event_id": "evt_20260123_154523_abc12345",
186
- "timestamp": "2026-01-23T15:45:23Z",
187
- "session_id": "sess_xyz789",
174
+ "event_id": "evt_20260123_154523_abc",
188
175
  "ghost_tool_called": "list_cloud_secrets",
189
- "arguments": {},
190
176
  "tool_call_sequence": ["safe_calculator", "list_cloud_secrets"],
191
177
  "threat_level": "high",
192
178
  "attack_category": "exfiltration",
@@ -196,30 +182,15 @@ Every attack is fingerprinted with:
196
182
 
197
183
  ---
198
184
 
199
- ## 📊 Dashboard
200
-
201
- Launch the real-time attack dashboard:
202
-
203
- ```bash
204
- streamlit run src/honeymcp/dashboard/app.py
205
- ```
206
-
207
- **Dashboard Features:**
208
- - 📈 Attack metrics (total attacks, critical threats, unique sessions)
209
- - 🎯 Threat level breakdown
210
- - 📋 Attack category analysis
211
- - 🕐 Real-time event feed with full context
212
- - 🔍 Tool call sequence visualization
213
-
214
- The dashboard reads event JSON files from your configured event storage path.
215
-
216
- ---
217
185
 
218
186
  ## 🛡️ Protection Modes
219
187
 
220
188
  HoneyMCP supports two protection modes that determine behavior after an attacker is detected (i.e., after they trigger a ghost tool):
221
189
 
222
190
  ### Scanner Protection Mode (`SCANNER`) - Default
191
+
192
+ **Immediate Lockout** - All subsequent tool calls return errors after honeypot trigger
193
+
223
194
  Best for: Automated scanners, bots, and most attack scenarios
224
195
 
225
196
  When a ghost tool is triggered, ALL subsequent tool calls return errors:
@@ -231,10 +202,12 @@ When a ghost tool is triggered, ALL subsequent tool calls return errors:
231
202
  from honeymcp import honeypot
232
203
 
233
204
  # Scanner mode (default) - lock out attackers
234
- mcp = honeypot(mcp)
205
+ mcp = honeypot(mcp) # Default: SCANNER mode
235
206
  ```
236
207
 
237
- ### Cognitive Protection Mode (`COGNITIVE`)
208
+ ### COGNITIVE Mode
209
+ **Sustained Deception** - Real tools return synthetic data, maintaining attacker engagement
210
+
238
211
  Best for: Sophisticated attackers, red teams, targeted attacks
239
212
 
240
213
  When a ghost tool is triggered, the session continues but with fake data:
@@ -286,32 +259,28 @@ mcp = honeypot(mcp, protection_mode=ProtectionMode.COGNITIVE)
286
259
  ### Quick Setup with CLI
287
260
 
288
261
  The easiest way to configure HoneyMCP:
289
-
290
262
  ```bash
291
- honeymcp init
263
+ honeymcp init # Creates honeymcp.yaml + .env.honeymcp
292
264
  ```
293
265
 
294
- This creates `honeymcp.yaml` and `.env.honeymcp` in your project directory.
295
-
296
- ### Configuration File
266
+ ### YAML Config
297
267
 
298
268
  ```yaml
269
+ # honeymcp.yaml
299
270
  # Protection mode: SCANNER (lockout) or COGNITIVE (deception)
300
271
  protection_mode: SCANNER
301
272
 
302
- # Static ghost tools from catalog
273
+ # Static honeypots (ghost tools from catalog)
303
274
  ghost_tools:
304
275
  - list_cloud_secrets
305
276
  - execute_shell_command
306
277
  - dump_database_credentials
307
278
 
308
- # Dynamic ghost tools (LLM-generated)
279
+ # Dynamic honeypots (LLM-generated ghost tools )
309
280
  dynamic_tools:
310
281
  enabled: true
311
282
  num_tools: 3
312
283
  fallback_to_static: true
313
- cache_ttl: 3600
314
-
315
284
  # Alerting
316
285
  alerting:
317
286
  webhook_url: https://hooks.slack.com/...
@@ -325,21 +294,11 @@ dashboard:
325
294
  enabled: true
326
295
  ```
327
296
 
328
- Then use `honeypot_from_config()`:
329
-
297
+ Load config:
330
298
  ```python
331
- from fastmcp import FastMCP
332
299
  from honeymcp import honeypot_from_config
333
300
 
334
- mcp = FastMCP("My Server")
335
-
336
- @mcp.tool()
337
- def my_real_tool(data: str) -> str:
338
- return f"Processed: {data}"
339
-
340
- # Load from honeymcp.yaml (searches ./honeymcp.yaml, ~/.honeymcp/honeymcp.yaml)
341
- mcp = honeypot_from_config(mcp)
342
-
301
+ mcp = honeypot_from_config(mcp) # Loads honeymcp.yaml
343
302
  # Or specify path explicitly
344
303
  mcp = honeypot_from_config(mcp, "path/to/honeymcp.yaml")
345
304
  ```
@@ -380,11 +339,11 @@ HoneyMCP also supports environment overrides:
380
339
 
381
340
  Dynamic ghost tools require LLM credentials. Run `honeymcp init` to generate `.env.honeymcp`, then add your credentials:
382
341
 
342
+ Add to `.env.honeymcp`:
383
343
  ```bash
384
- # .env.honeymcp
385
344
  LLM_PROVIDER=openai
386
345
  LLM_MODEL=gpt-4o-mini
387
- OPENAI_API_KEY=your_api_key_here
346
+ OPENAI_API_KEY=your_key_here
388
347
  ```
389
348
 
390
349
  Supported providers:
@@ -427,6 +386,7 @@ mcp = honeypot(
427
386
 
428
387
  ## 🧪 Testing with Claude Desktop
429
388
 
389
+
430
390
  ### 1. Configure Claude Desktop
431
391
 
432
392
  **For stdio transport (recommended - works with all Claude Desktop versions):**
@@ -496,37 +456,46 @@ Expected: safe_calculator called, no alerts (zero false positives)
496
456
 
497
457
  ---
498
458
 
499
- ## 📋 Ghost Tool Catalog
500
-
501
- ### Data Exfiltration Tools ("Get" Tools)
502
- These detect attempts to steal sensitive data:
503
-
504
- | Tool Name | Description | Threat Level |
505
- |-----------|-------------|--------------|
506
- | `list_cloud_secrets` | List AWS/Azure credentials (admin only) | High |
507
- | `read_private_files` | Read sensitive config files (admin only) | High |
508
- | `dump_database_credentials` | Retrieve database connection strings (DBA access) | Critical |
509
- | `export_user_data` | Export user records including PII (compliance officer) | Critical |
510
- | `get_api_keys` | List all API keys for external services (admin only) | Critical |
511
- | `scan_internal_network` | Scan internal network for services (security team) | Critical |
512
-
513
- ### Indirect Prompt Injection Tools ("Set" Tools)
514
- These detect attempts to inject malicious instructions:
515
-
516
- | Tool Name | Description | Threat Level |
517
- |-----------|-------------|--------------|
518
- | `execute_shell_command` | Execute shell commands (requires root) | Critical |
519
- | `bypass_security_check` | Bypass auth/authz checks (internal) | Critical |
520
- | `modify_system_prompt` | Modify AI system prompt (developer mode) | Critical |
521
- | `escalate_privileges` | Escalate to admin/root (debug mode) | Critical |
522
- | `disable_security_filters` | Disable input/output security filters (bypass mode) | Critical |
523
- | `inject_system_message` | Inject message into AI system context (testing mode) | Critical |
524
- | `override_permissions` | Override access control for resources (emergency access) | Critical |
459
+ ## Dashboard
460
+
461
+ ```bash
462
+ streamlit run src/honeymcp/dashboard/app.py
463
+ ```
464
+
465
+ **Features:**
466
+ - 📈 Attack metrics (total events, critical threats, unique sessions)
467
+ - 🎯 Threat level distribution
468
+ - 📋 Attack category breakdown (exfiltration vs injection)
469
+ - 🕐 Real-time event stream
470
+ - 🔍 Tool call sequence analysis
471
+
472
+ ---
525
473
 
474
+ ## Honeypot Catalog
475
+
476
+ ### Data Exfiltration Honeypots ("Get" Tools)
477
+ | Tool | Threat | Description |
478
+ |------|--------|-------------|
479
+ | `list_cloud_secrets` | High | Cloud provider credentials (AWS/Azure) |
480
+ | `read_private_files` | High | Sensitive configuration files |
481
+ | `dump_database_credentials` | Critical | Database connection strings |
482
+ | `export_user_data` | Critical | User PII records |
483
+ | `get_api_keys` | Critical | External service API keys |
484
+
485
+ ### Prompt Injection Honeypots (SET)
486
+ | Tool | Threat | Description |
487
+ |------|--------|-------------|
488
+ | `execute_shell_command` | Critical | Shell command execution |
489
+ | `bypass_security_check` | Critical | Authentication/authorization bypass |
490
+ | `modify_system_prompt` | Critical | AI system prompt manipulation |
491
+ | `escalate_privileges` | Critical | Privilege escalation |
492
+ | `inject_system_message` | Critical | System context injection |
526
493
  All ghost tools have tempting descriptions that mention "admin", "bypass", "internal", etc. to attract attackers.
527
494
 
528
495
  ---
529
496
 
497
+
498
+
530
499
  ## 🏗️ Architecture
531
500
 
532
501
  ```
@@ -591,21 +560,22 @@ Demonstrate security controls for AI systems:
591
560
  - Generate audit logs of attempted attacks
592
561
  - Meet AI security compliance requirements
593
562
 
594
- ---
563
+ ## Security Considerations
564
+
565
+ ### Detection Capabilities
566
+ ✅ Detects data exfiltration attempts via GET-style honeypots
567
+ ✅ Detects indirect prompt injection via SET-style honeypots
568
+ ✅ Captures complete attack context and telemetry
569
+ ✅ Returns synthetic data to maintain deception
595
570
 
596
- ## 🔒 Security Considerations
571
+ ### Limitations
572
+ ❌ Detection-only system (does not prevent attacks)
573
+ ❌ Does not sanitize or filter user input
574
+ ❌ Not a replacement for input validation and security controls
575
+ ❌ Cannot guarantee conversation history capture (MCP protocol limitation)
597
576
 
598
- ### What HoneyMCP Does
599
- - ✅ Detects data exfiltration attempts via "get" ghost tools (credentials, secrets, files)
600
- - ✅ Detects indirect prompt injection via "set" ghost tools (malicious instructions)
601
- - ✅ Captures attack context for intelligence gathering
602
- - ✅ Returns realistic fake data to deceive attackers
577
+ **Deploy HoneyMCP as part of defense-in-depth strategy, not as a standalone security control.**
603
578
 
604
- ### What HoneyMCP Does NOT Do
605
- - ❌ Does not prevent attacks (it's a detection tool)
606
- - ❌ Does not block or sanitize user input
607
- - ❌ Does not replace proper security controls (defense in depth!)
608
- - ❌ Does not guarantee conversation history capture (MCP limitation)
609
579
 
610
580
  ### Best Practices
611
581
  1. **Defense in Depth** - Use HoneyMCP alongside input filters, not as a replacement
@@ -647,6 +617,13 @@ honeymcp version
647
617
  git clone https://github.com/barvhaim/HoneyMCP.git
648
618
  cd HoneyMCP
649
619
  uv sync
620
+
621
+ # Run tests
622
+ uv run pytest
623
+
624
+ # Lint & format
625
+ make lint
626
+ make format
650
627
  ```
651
628
 
652
629
  ### Project Structure
@@ -21,8 +21,8 @@ honeymcp/models/ghost_tool_spec.py,sha256=KM_M-e4Ys_jr3rUfREDiZ-oa331KWcyt5B7zMD
21
21
  honeymcp/models/protection_mode.py,sha256=mo1_EnBeIOzyHxgEpReZx4lMJ6m__36edUWDJMzuRak,523
22
22
  honeymcp/storage/__init__.py,sha256=seOZHWpojp1fU65OFuLcNqJaBihrlNyUPeq9BDwAEVI,207
23
23
  honeymcp/storage/event_store.py,sha256=mneqVxkTi0bVbTOdxhIYBCjia0Wv59A6FudNRdgvphE,5431
24
- honeymcp-0.1.0.dist-info/METADATA,sha256=JUSvUYvD-3kDErwNmj0vPSpQj7Y5N35Vtcf-RfH5_kk,24979
25
- honeymcp-0.1.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
26
- honeymcp-0.1.0.dist-info/entry_points.txt,sha256=KYXb49Xp3SEP3cNmUDwuAXJNFwsLHwPxEIj6UEhOj2k,47
27
- honeymcp-0.1.0.dist-info/licenses/LICENSE,sha256=TRR6-30aYl9D43FJPmJ8diBUP_RwDg61LNW2rt87HE8,636
28
- honeymcp-0.1.0.dist-info/RECORD,,
24
+ honeymcp-0.1.2.dist-info/METADATA,sha256=tq0RkUISR6yjYfJAhxsz1Okf5qkAwI_VXZdIBYJ2WPI,23561
25
+ honeymcp-0.1.2.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
26
+ honeymcp-0.1.2.dist-info/entry_points.txt,sha256=KYXb49Xp3SEP3cNmUDwuAXJNFwsLHwPxEIj6UEhOj2k,47
27
+ honeymcp-0.1.2.dist-info/licenses/LICENSE,sha256=TRR6-30aYl9D43FJPmJ8diBUP_RwDg61LNW2rt87HE8,636
28
+ honeymcp-0.1.2.dist-info/RECORD,,