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