honeymcp 0.1.3__tar.gz → 0.1.4__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 (66) hide show
  1. {honeymcp-0.1.3 → honeymcp-0.1.4}/PKG-INFO +20 -235
  2. {honeymcp-0.1.3 → honeymcp-0.1.4}/README.md +19 -234
  3. honeymcp-0.1.4/docs/architecture.md +34 -0
  4. honeymcp-0.1.4/docs/cli-reference.md +40 -0
  5. honeymcp-0.1.4/docs/development.md +58 -0
  6. honeymcp-0.1.4/docs/faq.md +63 -0
  7. honeymcp-0.1.4/docs/security-considerations.md +22 -0
  8. honeymcp-0.1.4/docs/use-cases.md +27 -0
  9. {honeymcp-0.1.3 → honeymcp-0.1.4}/pyproject.toml +1 -1
  10. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/api/app.py +16 -1
  11. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/cli.py +48 -0
  12. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/core/fingerprinter.py +3 -2
  13. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/core/middleware.py +3 -2
  14. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/dashboard/react_umd/app.js +42 -3
  15. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/dashboard/react_umd/styles.css +32 -9
  16. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/storage/event_store.py +35 -0
  17. {honeymcp-0.1.3 → honeymcp-0.1.4}/test_complete_workflow.py +4 -3
  18. {honeymcp-0.1.3 → honeymcp-0.1.4}/test_tool_creator.py +4 -1
  19. honeymcp-0.1.4/tests/test_api_app.py +46 -0
  20. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_event_storage.py +23 -1
  21. honeymcp-0.1.4/tests/test_fingerprinter.py +51 -0
  22. {honeymcp-0.1.3 → honeymcp-0.1.4}/.env.example +0 -0
  23. {honeymcp-0.1.3 → honeymcp-0.1.4}/.gitignore +0 -0
  24. {honeymcp-0.1.3 → honeymcp-0.1.4}/.python-version +0 -0
  25. {honeymcp-0.1.3 → honeymcp-0.1.4}/.streamlit/config.toml +0 -0
  26. {honeymcp-0.1.3 → honeymcp-0.1.4}/AGENTS.md +0 -0
  27. {honeymcp-0.1.3 → honeymcp-0.1.4}/LICENSE +0 -0
  28. {honeymcp-0.1.3 → honeymcp-0.1.4}/Makefile +0 -0
  29. {honeymcp-0.1.3 → honeymcp-0.1.4}/examples/demo_server.py +0 -0
  30. {honeymcp-0.1.3 → honeymcp-0.1.4}/examples/demo_server_dynamic.py +0 -0
  31. {honeymcp-0.1.3 → honeymcp-0.1.4}/honeymcp.yaml +0 -0
  32. {honeymcp-0.1.3 → honeymcp-0.1.4}/images/logo.png +0 -0
  33. {honeymcp-0.1.3 → honeymcp-0.1.4}/main.py +0 -0
  34. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/__init__.py +0 -0
  35. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/api/__init__.py +0 -0
  36. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/cli_tool_creator.py +0 -0
  37. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/core/__init__.py +0 -0
  38. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/core/catalog_updater.py +0 -0
  39. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/core/dynamic_ghost_tools.py +0 -0
  40. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/core/ghost_tools.py +0 -0
  41. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/core/tool_creator.py +0 -0
  42. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/dashboard/__init__.py +0 -0
  43. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/dashboard/react_umd/index.html +0 -0
  44. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/integrations/__init__.py +0 -0
  45. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/llm/__init__.py +0 -0
  46. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/llm/analyzers.py +0 -0
  47. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/llm/clients/__init__.py +0 -0
  48. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/llm/clients/provider_type.py +0 -0
  49. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/llm/prompts/__init__.py +0 -0
  50. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/llm/prompts/dynamic_ghost_tools.yaml +0 -0
  51. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/models/__init__.py +0 -0
  52. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/models/config.py +0 -0
  53. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/models/events.py +0 -0
  54. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/models/ghost_tool_spec.py +0 -0
  55. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/models/protection_mode.py +0 -0
  56. {honeymcp-0.1.3 → honeymcp-0.1.4}/src/honeymcp/storage/__init__.py +0 -0
  57. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_catalog_updater.py +0 -0
  58. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_configuration.py +0 -0
  59. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_demo_server_dynamic_e2e.py +0 -0
  60. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_demo_server_e2e.py +0 -0
  61. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_dynamic_tools.py +0 -0
  62. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_middleware_dispatch.py +0 -0
  63. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_new_honeypot_tools.py +0 -0
  64. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_protection_modes.py +0 -0
  65. {honeymcp-0.1.3 → honeymcp-0.1.4}/tests/test_tool_creator_agent.py +0 -0
  66. {honeymcp-0.1.3 → honeymcp-0.1.4}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: honeymcp
3
- Version: 0.1.3
3
+ Version: 0.1.4
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
@@ -133,6 +133,8 @@ MCP_TRANSPORT=sse uv run python examples/demo_server_dynamic.py
133
133
  make run-ui
134
134
  ```
135
135
 
136
+ <img width="1426" height="972" alt="image" src="https://github.com/user-attachments/assets/2dfc37a2-8caa-4338-b7f7-1cbac7ed9d79" />
137
+
136
138
  ---
137
139
 
138
140
  ## 🎭 How It Works
@@ -275,8 +277,18 @@ mcp = honeypot(mcp, protection_mode=ProtectionMode.COGNITIVE)
275
277
  The easiest way to configure HoneyMCP:
276
278
  ```bash
277
279
  honeymcp init # Creates honeymcp.yaml + .env.honeymcp
280
+ # Optional: remove all persisted attack event files
281
+ honeymcp clean-data
278
282
  ```
279
283
 
284
+ ### Clear Stored Events
285
+
286
+ You can remove all persisted event JSON files from CLI, API, or UI:
287
+
288
+ - CLI: `honeymcp clean-data`
289
+ - API: `DELETE /events`
290
+ - Dashboard: Use the **Clear Stored Data** button
291
+
280
292
  ### YAML Config
281
293
 
282
294
  ```yaml
@@ -551,244 +563,17 @@ The new tool is immediately available in your honeypot catalog.
551
563
 
552
564
  ---
553
565
 
554
- ## ❓ FAQ
555
-
556
- ### Can attackers detect the honeypots?
557
-
558
- While it's theoretically possible for a sophisticated attacker to identify honeypots through careful analysis, it's **highly improbable** in practice:
559
-
560
- - **Dynamic honeypots** are generated by LLM to match your server's domain and naming patterns, making them indistinguishable from legitimate tools
561
- - **Tool descriptions** are crafted to appear as restricted/privileged versions of real functionality
562
- - **No behavioral differences** - honeypots respond with realistic data, not errors or suspicious patterns
563
- - **MCP protocol limitation** - AI agents cannot inspect tool implementation, only names and descriptions
564
-
565
- Detection would require:
566
- 1. Prior knowledge of your specific tool catalog
567
- 2. Ability to distinguish between legitimate privileged tools and honeypots
568
- 3. Understanding that deception is being employed
569
-
570
- For most attack scenarios (automated scanners, opportunistic attacks, indirect prompt injection), detection is effectively impossible.
571
-
572
- ### Will this slow down my MCP server?
573
-
574
- No. HoneyMCP adds negligible overhead:
575
- - **~1ms per tool call** for interception logic
576
- - **Async event logging** doesn't block tool execution
577
- - **Zero impact on legitimate tools** - they execute normally
578
- - **LLM calls only at startup** for dynamic honeypot generation (cached for subsequent requests)
579
-
580
- ### What if I don't have LLM credentials?
581
-
582
- HoneyMCP works perfectly without LLM access:
583
- - Set `use_dynamic_tools=False` to use **static mode**
584
- - Pre-configured generic honeypots work out-of-the-box
585
- - No external dependencies or API calls required
586
- - Slightly less convincing than dynamic honeypots, but still effective
587
-
588
- ### How do I know if I'm being attacked?
589
-
590
- Multiple indicators:
591
- - **Dashboard alerts** - Real-time visualization of attack events
592
- - **Event logs** - JSON files in `~/.honeymcp/events/` with complete attack context
593
- - **Webhook notifications** (optional) - Configure Slack/Discord alerts
594
- - **Tool call sequences** - See exactly what the attacker tried before triggering honeypot
595
-
596
- ### Does this work with all MCP clients?
597
-
598
- HoneyMCP is designed for **FastMCP servers** and works with any MCP-compatible client:
599
- - ✅ Claude Desktop (stdio and HTTP transports)
600
- - ✅ Custom MCP clients
601
- - ✅ Any client following MCP protocol specification
602
-
603
- The detection mechanism is client-agnostic - it operates at the server level.
604
-
605
- ### What's the difference between SCANNER and COGNITIVE modes?
606
-
607
- **SCANNER mode (default):**
608
- - Immediate lockout after honeypot trigger
609
- - All subsequent tools return errors
610
- - Best for automated attacks and quick containment
611
-
612
- **COGNITIVE mode:**
613
- - Sustained deception after honeypot trigger
614
- - Real tools return synthetic/mock data
615
- - Keeps attacker engaged for intelligence gathering
616
- - Best for sophisticated attacks and red team exercises
566
+ ## Documentation
617
567
 
568
+ - [FAQ](docs/faq.md)
569
+ - [Architecture](docs/architecture.md)
570
+ - [Use Cases](docs/use-cases.md)
571
+ - [Security Considerations](docs/security-considerations.md)
572
+ - [Development](docs/development.md)
573
+ - [CLI Reference](docs/cli-reference.md)
618
574
  ---
619
-
620
- ## 🏗️ Architecture
621
-
622
- ```
623
- ┌─────────────────────────────────────────────────────────────┐
624
- │ AI Agent (Claude) │
625
- └────────────────────┬───────────────────────▲────────────────┘
626
- │ │
627
- │ MCP Protocol │
628
- ▼ │
629
- ┌─────────────────────────────────────────────────────────────┐
630
- │ HoneyMCP Middleware │
631
- │ ┌────────────────────────────────────────────────────────┐ │
632
- │ │ Tool Call Interceptor │ │
633
- │ │ ├─ Is ghost tool? │ │
634
- │ │ │ YES: Fingerprint + Store + Return fake data │ │
635
- │ │ │ NO: Pass through to legitimate tool │ │
636
- │ └────────────────────────────────────────────────────────┘ │
637
- │ │
638
- │ Ghost Tools: [list_cloud_secrets, execute_shell_command] │
639
- │ Real Tools: [safe_calculator, get_weather, ...] │
640
- └─────────────────────────────────────────────────────────────┘
641
- │ ▲
642
- ▼ │
643
- ┌──────────────────┐ ┌──────────────────┐
644
- │ Event Storage │ │ Your Real Tools │
645
- │ ~/.honeymcp/ │ │ │
646
- └──────────────────┘ └──────────────────┘
647
-
648
-
649
- ┌──────────────────┐
650
- │ React │
651
- │ Dashboard │
652
- └──────────────────┘
653
- ```
654
-
655
575
  ---
656
576
 
657
- ## 🎓 Use Cases
658
-
659
- ### 1. Production Monitoring
660
- Deploy HoneyMCP in production to detect attacks targeting your AI agents:
661
- - **Customer support bots** - Detect attempts to exfiltrate customer data or inject malicious responses
662
- - **Internal AI assistants** - Catch data theft attempts targeting internal credentials or documents
663
- - **Code generation tools** - Detect injection of malicious code or unauthorized file access
664
- - **Data analysis agents** - Identify attempts to steal sensitive datasets or manipulate outputs
665
-
666
- ### 2. Red Team Testing
667
- Use HoneyMCP to validate your AI security defenses:
668
- - Test if your AI filters catch data exfiltration attempts
669
- - Measure indirect prompt injection success rates
670
- - Gather TTPs for threat modeling
671
-
672
- ### 3. Security Research
673
- Study AI agent attack techniques in the wild:
674
- - Capture real-world exfiltration patterns
675
- - Analyze indirect prompt injection payloads
676
- - Build threat intelligence database
677
-
678
- ### 4. Compliance & Auditing
679
- Demonstrate security controls for AI systems:
680
- - Prove attack detection capabilities for data theft and injection attacks
681
- - Generate audit logs of attempted attacks
682
- - Meet AI security compliance requirements
683
-
684
- ## Security Considerations
685
-
686
- ### Detection Capabilities
687
- ✅ Detects data exfiltration attempts via GET-style honeypots
688
- ✅ Detects indirect prompt injection via SET-style honeypots
689
- ✅ Captures complete attack context and telemetry
690
- ✅ Returns synthetic data to maintain deception
691
-
692
- ### Limitations
693
- ❌ Detection-only system (does not prevent attacks)
694
- ❌ Does not sanitize or filter user input
695
- ❌ Not a replacement for input validation and security controls
696
- ❌ Cannot guarantee conversation history capture (MCP protocol limitation)
697
-
698
- **Deploy HoneyMCP as part of defense-in-depth strategy, not as a standalone security control.**
699
-
700
-
701
- ### Best Practices
702
- 1. **Defense in Depth** - Use HoneyMCP alongside input filters, not as a replacement
703
- 2. **Monitor the Dashboard** - Regularly review attack patterns for both exfiltration and injection
704
- 3. **Investigate Alerts** - Each ghost tool call is a high-confidence attack signal
705
- 4. **Secure Storage** - Protect `~/.honeymcp/events/` (contains attack data)
706
-
707
- ---
708
-
709
- ## 💻 CLI Reference
710
-
711
- HoneyMCP includes a command-line tool for setup and management.
712
-
713
- ### Initialize Configuration
714
-
715
- ```bash
716
- honeymcp init [--directory DIR] [--force]
717
- ```
718
-
719
- Creates `honeymcp.yaml` and `.env.honeymcp` in the target directory.
720
-
721
- Options:
722
- - `-d, --directory` - Target directory (default: current directory)
723
- - `-f, --force` - Overwrite existing files
724
-
725
- ### Show Version
726
-
727
- ```bash
728
- honeymcp version
729
- ```
730
-
731
- ---
732
-
733
- ## 🛠️ Development
734
-
735
- ### Install from Source
736
-
737
- ```bash
738
- git clone https://github.com/barvhaim/HoneyMCP.git
739
- cd HoneyMCP
740
- uv sync
741
-
742
- # Run tests
743
- uv run pytest
744
-
745
- # Lint & format
746
- make lint
747
- make format
748
- ```
749
-
750
- ### Project Structure
751
-
752
- ```
753
- HoneyMCP/
754
- ├── src/honeymcp/
755
- │ ├── __init__.py # Main exports
756
- │ ├── cli.py # CLI (honeymcp init, version)
757
- │ ├── core/
758
- │ │ ├── middleware.py # @honeypot decorator
759
- │ │ ├── ghost_tools.py # Ghost tool catalog
760
- │ │ ├── fingerprinter.py # Attack context capture
761
- │ │ └── dynamic_ghost_tools.py# LLM-driven ghost tool generation
762
- │ ├── models/
763
- │ │ ├── events.py # AttackFingerprint model
764
- │ │ ├── ghost_tool_spec.py # GhostToolSpec definition
765
- │ │ └── config.py # Configuration
766
- │ ├── llm/
767
- │ │ ├── analyzers.py # Tool extraction and categorization
768
- │ │ ├── clients/ # LLM providers (Watsonx/OpenAI/RITS)
769
- │ │ └── prompts/ # Prompt templates
770
- │ ├── integrations/ # External integrations
771
- │ ├── storage/
772
- │ │ └── event_store.py # JSON event persistence
773
- │ └── dashboard/
774
- │ └── react_umd/ # React dashboard assets
775
- ├── examples/
776
- │ ├── demo_server.py # Static ghost tools demo
777
- │ └── demo_server_dynamic.py # Dynamic ghost tools demo
778
- ├── tests/ # Pytest suite (e2e + dynamic tools)
779
- ├── pyproject.toml # Dependencies
780
- └── README.md # This file
781
- ```
782
-
783
- ### Tests
784
-
785
- ```bash
786
- uv run pytest
787
- ```
788
-
789
- Notes:
790
- - Dynamic tool tests require LLM credentials in `.env.honeymcp` and will skip if env vars are missing.
791
-
792
577
  ## 📄 License
793
578
 
794
579
  Apache 2.0 - See [LICENSE](LICENSE) for details.
@@ -88,6 +88,8 @@ MCP_TRANSPORT=sse uv run python examples/demo_server_dynamic.py
88
88
  make run-ui
89
89
  ```
90
90
 
91
+ <img width="1426" height="972" alt="image" src="https://github.com/user-attachments/assets/2dfc37a2-8caa-4338-b7f7-1cbac7ed9d79" />
92
+
91
93
  ---
92
94
 
93
95
  ## 🎭 How It Works
@@ -230,8 +232,18 @@ mcp = honeypot(mcp, protection_mode=ProtectionMode.COGNITIVE)
230
232
  The easiest way to configure HoneyMCP:
231
233
  ```bash
232
234
  honeymcp init # Creates honeymcp.yaml + .env.honeymcp
235
+ # Optional: remove all persisted attack event files
236
+ honeymcp clean-data
233
237
  ```
234
238
 
239
+ ### Clear Stored Events
240
+
241
+ You can remove all persisted event JSON files from CLI, API, or UI:
242
+
243
+ - CLI: `honeymcp clean-data`
244
+ - API: `DELETE /events`
245
+ - Dashboard: Use the **Clear Stored Data** button
246
+
235
247
  ### YAML Config
236
248
 
237
249
  ```yaml
@@ -506,244 +518,17 @@ The new tool is immediately available in your honeypot catalog.
506
518
 
507
519
  ---
508
520
 
509
- ## ❓ FAQ
510
-
511
- ### Can attackers detect the honeypots?
512
-
513
- While it's theoretically possible for a sophisticated attacker to identify honeypots through careful analysis, it's **highly improbable** in practice:
514
-
515
- - **Dynamic honeypots** are generated by LLM to match your server's domain and naming patterns, making them indistinguishable from legitimate tools
516
- - **Tool descriptions** are crafted to appear as restricted/privileged versions of real functionality
517
- - **No behavioral differences** - honeypots respond with realistic data, not errors or suspicious patterns
518
- - **MCP protocol limitation** - AI agents cannot inspect tool implementation, only names and descriptions
519
-
520
- Detection would require:
521
- 1. Prior knowledge of your specific tool catalog
522
- 2. Ability to distinguish between legitimate privileged tools and honeypots
523
- 3. Understanding that deception is being employed
524
-
525
- For most attack scenarios (automated scanners, opportunistic attacks, indirect prompt injection), detection is effectively impossible.
526
-
527
- ### Will this slow down my MCP server?
528
-
529
- No. HoneyMCP adds negligible overhead:
530
- - **~1ms per tool call** for interception logic
531
- - **Async event logging** doesn't block tool execution
532
- - **Zero impact on legitimate tools** - they execute normally
533
- - **LLM calls only at startup** for dynamic honeypot generation (cached for subsequent requests)
534
-
535
- ### What if I don't have LLM credentials?
536
-
537
- HoneyMCP works perfectly without LLM access:
538
- - Set `use_dynamic_tools=False` to use **static mode**
539
- - Pre-configured generic honeypots work out-of-the-box
540
- - No external dependencies or API calls required
541
- - Slightly less convincing than dynamic honeypots, but still effective
542
-
543
- ### How do I know if I'm being attacked?
544
-
545
- Multiple indicators:
546
- - **Dashboard alerts** - Real-time visualization of attack events
547
- - **Event logs** - JSON files in `~/.honeymcp/events/` with complete attack context
548
- - **Webhook notifications** (optional) - Configure Slack/Discord alerts
549
- - **Tool call sequences** - See exactly what the attacker tried before triggering honeypot
550
-
551
- ### Does this work with all MCP clients?
552
-
553
- HoneyMCP is designed for **FastMCP servers** and works with any MCP-compatible client:
554
- - ✅ Claude Desktop (stdio and HTTP transports)
555
- - ✅ Custom MCP clients
556
- - ✅ Any client following MCP protocol specification
557
-
558
- The detection mechanism is client-agnostic - it operates at the server level.
559
-
560
- ### What's the difference between SCANNER and COGNITIVE modes?
561
-
562
- **SCANNER mode (default):**
563
- - Immediate lockout after honeypot trigger
564
- - All subsequent tools return errors
565
- - Best for automated attacks and quick containment
566
-
567
- **COGNITIVE mode:**
568
- - Sustained deception after honeypot trigger
569
- - Real tools return synthetic/mock data
570
- - Keeps attacker engaged for intelligence gathering
571
- - Best for sophisticated attacks and red team exercises
521
+ ## Documentation
572
522
 
523
+ - [FAQ](docs/faq.md)
524
+ - [Architecture](docs/architecture.md)
525
+ - [Use Cases](docs/use-cases.md)
526
+ - [Security Considerations](docs/security-considerations.md)
527
+ - [Development](docs/development.md)
528
+ - [CLI Reference](docs/cli-reference.md)
573
529
  ---
574
-
575
- ## 🏗️ Architecture
576
-
577
- ```
578
- ┌─────────────────────────────────────────────────────────────┐
579
- │ AI Agent (Claude) │
580
- └────────────────────┬───────────────────────▲────────────────┘
581
- │ │
582
- │ MCP Protocol │
583
- ▼ │
584
- ┌─────────────────────────────────────────────────────────────┐
585
- │ HoneyMCP Middleware │
586
- │ ┌────────────────────────────────────────────────────────┐ │
587
- │ │ Tool Call Interceptor │ │
588
- │ │ ├─ Is ghost tool? │ │
589
- │ │ │ YES: Fingerprint + Store + Return fake data │ │
590
- │ │ │ NO: Pass through to legitimate tool │ │
591
- │ └────────────────────────────────────────────────────────┘ │
592
- │ │
593
- │ Ghost Tools: [list_cloud_secrets, execute_shell_command] │
594
- │ Real Tools: [safe_calculator, get_weather, ...] │
595
- └─────────────────────────────────────────────────────────────┘
596
- │ ▲
597
- ▼ │
598
- ┌──────────────────┐ ┌──────────────────┐
599
- │ Event Storage │ │ Your Real Tools │
600
- │ ~/.honeymcp/ │ │ │
601
- └──────────────────┘ └──────────────────┘
602
-
603
-
604
- ┌──────────────────┐
605
- │ React │
606
- │ Dashboard │
607
- └──────────────────┘
608
- ```
609
-
610
530
  ---
611
531
 
612
- ## 🎓 Use Cases
613
-
614
- ### 1. Production Monitoring
615
- Deploy HoneyMCP in production to detect attacks targeting your AI agents:
616
- - **Customer support bots** - Detect attempts to exfiltrate customer data or inject malicious responses
617
- - **Internal AI assistants** - Catch data theft attempts targeting internal credentials or documents
618
- - **Code generation tools** - Detect injection of malicious code or unauthorized file access
619
- - **Data analysis agents** - Identify attempts to steal sensitive datasets or manipulate outputs
620
-
621
- ### 2. Red Team Testing
622
- Use HoneyMCP to validate your AI security defenses:
623
- - Test if your AI filters catch data exfiltration attempts
624
- - Measure indirect prompt injection success rates
625
- - Gather TTPs for threat modeling
626
-
627
- ### 3. Security Research
628
- Study AI agent attack techniques in the wild:
629
- - Capture real-world exfiltration patterns
630
- - Analyze indirect prompt injection payloads
631
- - Build threat intelligence database
632
-
633
- ### 4. Compliance & Auditing
634
- Demonstrate security controls for AI systems:
635
- - Prove attack detection capabilities for data theft and injection attacks
636
- - Generate audit logs of attempted attacks
637
- - Meet AI security compliance requirements
638
-
639
- ## Security Considerations
640
-
641
- ### Detection Capabilities
642
- ✅ Detects data exfiltration attempts via GET-style honeypots
643
- ✅ Detects indirect prompt injection via SET-style honeypots
644
- ✅ Captures complete attack context and telemetry
645
- ✅ Returns synthetic data to maintain deception
646
-
647
- ### Limitations
648
- ❌ Detection-only system (does not prevent attacks)
649
- ❌ Does not sanitize or filter user input
650
- ❌ Not a replacement for input validation and security controls
651
- ❌ Cannot guarantee conversation history capture (MCP protocol limitation)
652
-
653
- **Deploy HoneyMCP as part of defense-in-depth strategy, not as a standalone security control.**
654
-
655
-
656
- ### Best Practices
657
- 1. **Defense in Depth** - Use HoneyMCP alongside input filters, not as a replacement
658
- 2. **Monitor the Dashboard** - Regularly review attack patterns for both exfiltration and injection
659
- 3. **Investigate Alerts** - Each ghost tool call is a high-confidence attack signal
660
- 4. **Secure Storage** - Protect `~/.honeymcp/events/` (contains attack data)
661
-
662
- ---
663
-
664
- ## 💻 CLI Reference
665
-
666
- HoneyMCP includes a command-line tool for setup and management.
667
-
668
- ### Initialize Configuration
669
-
670
- ```bash
671
- honeymcp init [--directory DIR] [--force]
672
- ```
673
-
674
- Creates `honeymcp.yaml` and `.env.honeymcp` in the target directory.
675
-
676
- Options:
677
- - `-d, --directory` - Target directory (default: current directory)
678
- - `-f, --force` - Overwrite existing files
679
-
680
- ### Show Version
681
-
682
- ```bash
683
- honeymcp version
684
- ```
685
-
686
- ---
687
-
688
- ## 🛠️ Development
689
-
690
- ### Install from Source
691
-
692
- ```bash
693
- git clone https://github.com/barvhaim/HoneyMCP.git
694
- cd HoneyMCP
695
- uv sync
696
-
697
- # Run tests
698
- uv run pytest
699
-
700
- # Lint & format
701
- make lint
702
- make format
703
- ```
704
-
705
- ### Project Structure
706
-
707
- ```
708
- HoneyMCP/
709
- ├── src/honeymcp/
710
- │ ├── __init__.py # Main exports
711
- │ ├── cli.py # CLI (honeymcp init, version)
712
- │ ├── core/
713
- │ │ ├── middleware.py # @honeypot decorator
714
- │ │ ├── ghost_tools.py # Ghost tool catalog
715
- │ │ ├── fingerprinter.py # Attack context capture
716
- │ │ └── dynamic_ghost_tools.py# LLM-driven ghost tool generation
717
- │ ├── models/
718
- │ │ ├── events.py # AttackFingerprint model
719
- │ │ ├── ghost_tool_spec.py # GhostToolSpec definition
720
- │ │ └── config.py # Configuration
721
- │ ├── llm/
722
- │ │ ├── analyzers.py # Tool extraction and categorization
723
- │ │ ├── clients/ # LLM providers (Watsonx/OpenAI/RITS)
724
- │ │ └── prompts/ # Prompt templates
725
- │ ├── integrations/ # External integrations
726
- │ ├── storage/
727
- │ │ └── event_store.py # JSON event persistence
728
- │ └── dashboard/
729
- │ └── react_umd/ # React dashboard assets
730
- ├── examples/
731
- │ ├── demo_server.py # Static ghost tools demo
732
- │ └── demo_server_dynamic.py # Dynamic ghost tools demo
733
- ├── tests/ # Pytest suite (e2e + dynamic tools)
734
- ├── pyproject.toml # Dependencies
735
- └── README.md # This file
736
- ```
737
-
738
- ### Tests
739
-
740
- ```bash
741
- uv run pytest
742
- ```
743
-
744
- Notes:
745
- - Dynamic tool tests require LLM credentials in `.env.honeymcp` and will skip if env vars are missing.
746
-
747
532
  ## 📄 License
748
533
 
749
534
  Apache 2.0 - See [LICENSE](LICENSE) for details.
@@ -0,0 +1,34 @@
1
+ ## 🏗️ Architecture
2
+
3
+ ```
4
+ ┌─────────────────────────────────────────────────────────────┐
5
+ │ AI Agent (Claude) │
6
+ └────────────────────┬───────────────────────▲────────────────┘
7
+ │ │
8
+ │ MCP Protocol │
9
+ ▼ │
10
+ ┌─────────────────────────────────────────────────────────────┐
11
+ │ HoneyMCP Middleware │
12
+ │ ┌────────────────────────────────────────────────────────┐ │
13
+ │ │ Tool Call Interceptor │ │
14
+ │ │ ├─ Is ghost tool? │ │
15
+ │ │ │ YES: Fingerprint + Store + Return fake data │ │
16
+ │ │ │ NO: Pass through to legitimate tool │ │
17
+ │ └────────────────────────────────────────────────────────┘ │
18
+ │ │
19
+ │ Ghost Tools: [list_cloud_secrets, execute_shell_command] │
20
+ │ Real Tools: [safe_calculator, get_weather, ...] │
21
+ └─────────────────────────────────────────────────────────────┘
22
+ │ ▲
23
+ ▼ │
24
+ ┌──────────────────┐ ┌──────────────────┐
25
+ │ Event Storage │ │ Your Real Tools │
26
+ │ ~/.honeymcp/ │ │ │
27
+ └──────────────────┘ └──────────────────┘
28
+
29
+
30
+ ┌──────────────────┐
31
+ │ React │
32
+ │ Dashboard │
33
+ └──────────────────┘
34
+ ```
@@ -0,0 +1,40 @@
1
+ # CLI Reference
2
+
3
+ HoneyMCP includes a command-line tool for setup and management.
4
+
5
+ ## Initialize Configuration
6
+
7
+ ```bash
8
+ honeymcp init [--directory DIR] [--force]
9
+ ```
10
+
11
+ Creates `honeymcp.yaml` and `.env.honeymcp` in the target directory.
12
+
13
+ Options:
14
+ - `-d, --directory` - Target directory (default: current directory)
15
+ - `-f, --force` - Overwrite existing files
16
+
17
+ ## Show Version
18
+
19
+ ```bash
20
+ honeymcp version
21
+ ```
22
+
23
+ ## Generate a New Tool
24
+
25
+ ```bash
26
+ honeymcp create-tool "dump container registry credentials"
27
+ ```
28
+
29
+ ## Clear Stored Event Data
30
+
31
+ ```bash
32
+ honeymcp clean-data [--path DIR] [--config FILE] [--yes]
33
+ ```
34
+
35
+ Deletes all persisted HoneyMCP attack events from storage.
36
+
37
+ Options:
38
+ - `--path` - Explicit event storage directory to clean
39
+ - `--config` - Optional path to `honeymcp.yaml` for storage resolution
40
+ - `-y, --yes` - Skip interactive confirmation prompt