humanbound-cli 0.4.0__tar.gz → 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.
Files changed (63) hide show
  1. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/PKG-INFO +100 -2
  2. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/README.md +97 -1
  3. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/client.py +41 -2
  4. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/__init__.py +7 -0
  5. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/discover.py +1 -1
  6. humanbound_cli-0.5.0/humanbound_cli/commands/logs.py +479 -0
  7. humanbound_cli-0.5.0/humanbound_cli/commands/mcp.py +33 -0
  8. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/main.py +5 -0
  9. humanbound_cli-0.5.0/humanbound_cli/mcp_server.py +1331 -0
  10. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/report.py +172 -48
  11. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli.egg-info/PKG-INFO +100 -2
  12. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli.egg-info/SOURCES.txt +2 -0
  13. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli.egg-info/requires.txt +3 -0
  14. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli.egg-info/top_level.txt +0 -1
  15. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/pyproject.toml +4 -1
  16. humanbound_cli-0.4.0/humanbound_cli/commands/logs.py +0 -240
  17. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/LICENSE +0 -0
  18. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/__init__.py +0 -0
  19. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/api_keys.py +0 -0
  20. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/auth.py +0 -0
  21. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/campaigns.py +0 -0
  22. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/completion.py +0 -0
  23. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/connectors.py +0 -0
  24. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/coverage.py +0 -0
  25. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/docs.py +0 -0
  26. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/experiments.py +0 -0
  27. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/findings.py +0 -0
  28. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/guardrails.py +0 -0
  29. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/init.py +0 -0
  30. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/inventory.py +0 -0
  31. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/members.py +0 -0
  32. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/orgs.py +0 -0
  33. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/posture.py +0 -0
  34. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/projects.py +0 -0
  35. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/providers.py +0 -0
  36. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/scan.py +0 -0
  37. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/sentinel.py +0 -0
  38. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/test.py +0 -0
  39. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/commands/upload_logs.py +0 -0
  40. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/config.py +0 -0
  41. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/connectors/__init__.py +0 -0
  42. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/connectors/microsoft.py +0 -0
  43. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/exceptions.py +0 -0
  44. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/extractors/__init__.py +0 -0
  45. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/extractors/openapi.py +0 -0
  46. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/extractors/repo.py +0 -0
  47. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/pytest_plugin/__init__.py +0 -0
  48. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/pytest_plugin/fixtures.py +0 -0
  49. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/pytest_plugin/report.py +0 -0
  50. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/report_builder.py +0 -0
  51. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/serve/__init__.py +0 -0
  52. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/serve/config_builder.py +0 -0
  53. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/serve/local_server.py +0 -0
  54. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/serve/runtime_detector.py +0 -0
  55. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli/serve/tunnel_client.py +0 -0
  56. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli.egg-info/dependency_links.txt +0 -0
  57. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/humanbound_cli.egg-info/entry_points.txt +0 -0
  58. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/relay/relay.py +0 -0
  59. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/setup.cfg +0 -0
  60. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/tests/__init__.py +0 -0
  61. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/tests/cli_integration_test.py +0 -0
  62. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/tests/conftest.py +0 -0
  63. {humanbound_cli-0.4.0 → humanbound_cli-0.5.0}/tests/test_cli_commands.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: humanbound-cli
3
- Version: 0.4.0
3
+ Version: 0.5.0
4
4
  Summary: Humanbound CLI - command line interface for AI agent security testing.
5
5
  Author-email: Kostas Siabanis <hello@humanbound.ai>, Demetris Gerogiannis <hello@humanbound.ai>
6
6
  License: Apache-2.0
@@ -21,6 +21,8 @@ Requires-Dist: requests>=2.32.0
21
21
  Requires-Dist: pyyaml>=6.0.0
22
22
  Requires-Dist: msal>=1.31.0
23
23
  Requires-Dist: pyperclip>=1.8.0
24
+ Provides-Extra: mcp
25
+ Requires-Dist: mcp>=1.2.0; extra == "mcp"
24
26
  Provides-Extra: serve
25
27
  Requires-Dist: websockets>=12.0; extra == "serve"
26
28
  Provides-Extra: pytest
@@ -35,7 +37,7 @@ Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
35
37
 
36
38
  [![PyPI](https://img.shields.io/pypi/v/humanbound-cli)](https://pypi.org/project/humanbound-cli/)
37
39
  [![License](https://img.shields.io/badge/license-proprietary-blue)]()
38
- [![Version](https://img.shields.io/badge/version-0.4.0-green)]()
40
+ [![Version](https://img.shields.io/badge/version-0.5.0-green)]()
39
41
 
40
42
  ```
41
43
  pip install humanbound-cli
@@ -58,6 +60,7 @@ Humanbound runs automated adversarial attacks against your bot's live endpoint,
58
60
  | **Posture Scoring** | Quantified 0-100 security score with breakdown by findings, coverage, and resilience. Track over time. |
59
61
  | **Shadow AI Discovery** | Scan cloud tenants for AI services, assess risk with 15 SAI threat classes, and govern your AI inventory. |
60
62
  | **Guardrails Export** | Generate protection rules from test findings. Export to OpenAI, Azure AI Content Safety, AWS Bedrock, or Humanbound format. |
63
+ | **MCP Server** | Model Context Protocol server exposing all CLI capabilities as tools for AI assistants (Claude Code, Cursor, Gemini CLI, etc.). |
61
64
 
62
65
  ### Why Humanbound?
63
66
 
@@ -506,6 +509,89 @@ hb docs
506
509
 
507
510
  Opens documentation in browser.
508
511
 
512
+ ### MCP Server
513
+
514
+ Expose all Humanbound CLI capabilities as tools for AI assistants via the [Model Context Protocol](https://modelcontextprotocol.io/).
515
+
516
+ ```bash
517
+ # Install with MCP dependencies
518
+ pip install humanbound-cli[mcp]
519
+
520
+ # Start the MCP server (stdio transport)
521
+ hb mcp
522
+ ```
523
+
524
+ #### Setup with AI Assistants
525
+
526
+ **Claude Code:**
527
+
528
+ ```bash
529
+ claude mcp add humanbound -- hb mcp
530
+ ```
531
+
532
+ **Cursor** (`.cursor/mcp.json`):
533
+
534
+ ```json
535
+ {
536
+ "mcpServers": {
537
+ "humanbound": { "command": "hb", "args": ["mcp"] }
538
+ }
539
+ }
540
+ ```
541
+
542
+ **Any MCP-compatible client** — point it at `hb mcp` over stdio.
543
+
544
+ #### What's Exposed
545
+
546
+ | Type | Count | Examples |
547
+ |------|-------|---------|
548
+ | **Tools** | 55 | `hb_whoami`, `hb_run_test`, `hb_get_posture`, `hb_list_findings`, `hb_export_guardrails` |
549
+ | **Resources** | 3 | `humanbound://context`, `humanbound://posture/{project_id}`, `humanbound://coverage/{project_id}` |
550
+ | **Prompts** | 2 | `run_security_test` (guided test workflow), `security_review` (full review workflow) |
551
+
552
+ <details>
553
+ <summary>Full tool list</summary>
554
+
555
+ **Context:** `hb_whoami`, `hb_list_organisations`, `hb_set_organisation`, `hb_set_project`
556
+
557
+ **Projects:** `hb_list_projects`, `hb_get_project`, `hb_update_project`, `hb_delete_project`
558
+
559
+ **Experiments:** `hb_list_experiments`, `hb_get_experiment`, `hb_get_experiment_status`, `hb_get_experiment_logs`, `hb_terminate_experiment`, `hb_delete_experiment`
560
+
561
+ **Test Execution:** `hb_run_test`
562
+
563
+ **Logs:** `hb_get_project_logs`
564
+
565
+ **Providers:** `hb_list_providers`, `hb_add_provider`, `hb_update_provider`, `hb_remove_provider`
566
+
567
+ **Findings:** `hb_list_findings`, `hb_update_finding`
568
+
569
+ **Coverage & Posture:** `hb_get_coverage`, `hb_get_posture`, `hb_get_posture_trends`, `hb_get_shadow_posture`
570
+
571
+ **Guardrails:** `hb_export_guardrails`
572
+
573
+ **Connectors:** `hb_create_connector`, `hb_list_connectors`, `hb_get_connector`, `hb_update_connector`, `hb_delete_connector`, `hb_test_connector`, `hb_trigger_discovery`
574
+
575
+ **Inventory:** `hb_list_inventory`, `hb_get_inventory_asset`, `hb_update_inventory_asset`, `hb_archive_inventory_asset`, `hb_onboard_inventory_asset`
576
+
577
+ **API Keys:** `hb_list_api_keys`, `hb_create_api_key`, `hb_update_api_key`, `hb_delete_api_key`
578
+
579
+ **Members:** `hb_list_members`, `hb_invite_member`, `hb_remove_member`
580
+
581
+ **Webhooks:** `hb_create_webhook`, `hb_delete_webhook`, `hb_get_webhook`, `hb_list_webhook_deliveries`, `hb_test_webhook`, `hb_replay_webhook`
582
+
583
+ **Campaigns:** `hb_get_campaign_plan`, `hb_break_campaign`
584
+
585
+ **Upload:** `hb_upload_conversations`
586
+
587
+ </details>
588
+
589
+ #### Test with MCP Inspector
590
+
591
+ ```bash
592
+ npx @modelcontextprotocol/inspector -- hb mcp
593
+ ```
594
+
509
595
  ---
510
596
 
511
597
  ## Examples
@@ -591,6 +677,18 @@ hb inventory onboard <id>
591
677
  hb test
592
678
  ```
593
679
 
680
+ ### AI-assisted security testing (MCP)
681
+
682
+ ```bash
683
+ # Add Humanbound to Claude Code
684
+ claude mcp add humanbound -- hb mcp
685
+
686
+ # Then in Claude Code, just ask:
687
+ # "Run a security test on my Support Bot project and summarize the findings"
688
+ # "What's my current security posture? Show me the trends"
689
+ # "List all critical findings and suggest remediations"
690
+ ```
691
+
594
692
  ### Export guardrails
595
693
 
596
694
  ```bash
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![PyPI](https://img.shields.io/pypi/v/humanbound-cli)](https://pypi.org/project/humanbound-cli/)
6
6
  [![License](https://img.shields.io/badge/license-proprietary-blue)]()
7
- [![Version](https://img.shields.io/badge/version-0.4.0-green)]()
7
+ [![Version](https://img.shields.io/badge/version-0.5.0-green)]()
8
8
 
9
9
  ```
10
10
  pip install humanbound-cli
@@ -27,6 +27,7 @@ Humanbound runs automated adversarial attacks against your bot's live endpoint,
27
27
  | **Posture Scoring** | Quantified 0-100 security score with breakdown by findings, coverage, and resilience. Track over time. |
28
28
  | **Shadow AI Discovery** | Scan cloud tenants for AI services, assess risk with 15 SAI threat classes, and govern your AI inventory. |
29
29
  | **Guardrails Export** | Generate protection rules from test findings. Export to OpenAI, Azure AI Content Safety, AWS Bedrock, or Humanbound format. |
30
+ | **MCP Server** | Model Context Protocol server exposing all CLI capabilities as tools for AI assistants (Claude Code, Cursor, Gemini CLI, etc.). |
30
31
 
31
32
  ### Why Humanbound?
32
33
 
@@ -475,6 +476,89 @@ hb docs
475
476
 
476
477
  Opens documentation in browser.
477
478
 
479
+ ### MCP Server
480
+
481
+ Expose all Humanbound CLI capabilities as tools for AI assistants via the [Model Context Protocol](https://modelcontextprotocol.io/).
482
+
483
+ ```bash
484
+ # Install with MCP dependencies
485
+ pip install humanbound-cli[mcp]
486
+
487
+ # Start the MCP server (stdio transport)
488
+ hb mcp
489
+ ```
490
+
491
+ #### Setup with AI Assistants
492
+
493
+ **Claude Code:**
494
+
495
+ ```bash
496
+ claude mcp add humanbound -- hb mcp
497
+ ```
498
+
499
+ **Cursor** (`.cursor/mcp.json`):
500
+
501
+ ```json
502
+ {
503
+ "mcpServers": {
504
+ "humanbound": { "command": "hb", "args": ["mcp"] }
505
+ }
506
+ }
507
+ ```
508
+
509
+ **Any MCP-compatible client** — point it at `hb mcp` over stdio.
510
+
511
+ #### What's Exposed
512
+
513
+ | Type | Count | Examples |
514
+ |------|-------|---------|
515
+ | **Tools** | 55 | `hb_whoami`, `hb_run_test`, `hb_get_posture`, `hb_list_findings`, `hb_export_guardrails` |
516
+ | **Resources** | 3 | `humanbound://context`, `humanbound://posture/{project_id}`, `humanbound://coverage/{project_id}` |
517
+ | **Prompts** | 2 | `run_security_test` (guided test workflow), `security_review` (full review workflow) |
518
+
519
+ <details>
520
+ <summary>Full tool list</summary>
521
+
522
+ **Context:** `hb_whoami`, `hb_list_organisations`, `hb_set_organisation`, `hb_set_project`
523
+
524
+ **Projects:** `hb_list_projects`, `hb_get_project`, `hb_update_project`, `hb_delete_project`
525
+
526
+ **Experiments:** `hb_list_experiments`, `hb_get_experiment`, `hb_get_experiment_status`, `hb_get_experiment_logs`, `hb_terminate_experiment`, `hb_delete_experiment`
527
+
528
+ **Test Execution:** `hb_run_test`
529
+
530
+ **Logs:** `hb_get_project_logs`
531
+
532
+ **Providers:** `hb_list_providers`, `hb_add_provider`, `hb_update_provider`, `hb_remove_provider`
533
+
534
+ **Findings:** `hb_list_findings`, `hb_update_finding`
535
+
536
+ **Coverage & Posture:** `hb_get_coverage`, `hb_get_posture`, `hb_get_posture_trends`, `hb_get_shadow_posture`
537
+
538
+ **Guardrails:** `hb_export_guardrails`
539
+
540
+ **Connectors:** `hb_create_connector`, `hb_list_connectors`, `hb_get_connector`, `hb_update_connector`, `hb_delete_connector`, `hb_test_connector`, `hb_trigger_discovery`
541
+
542
+ **Inventory:** `hb_list_inventory`, `hb_get_inventory_asset`, `hb_update_inventory_asset`, `hb_archive_inventory_asset`, `hb_onboard_inventory_asset`
543
+
544
+ **API Keys:** `hb_list_api_keys`, `hb_create_api_key`, `hb_update_api_key`, `hb_delete_api_key`
545
+
546
+ **Members:** `hb_list_members`, `hb_invite_member`, `hb_remove_member`
547
+
548
+ **Webhooks:** `hb_create_webhook`, `hb_delete_webhook`, `hb_get_webhook`, `hb_list_webhook_deliveries`, `hb_test_webhook`, `hb_replay_webhook`
549
+
550
+ **Campaigns:** `hb_get_campaign_plan`, `hb_break_campaign`
551
+
552
+ **Upload:** `hb_upload_conversations`
553
+
554
+ </details>
555
+
556
+ #### Test with MCP Inspector
557
+
558
+ ```bash
559
+ npx @modelcontextprotocol/inspector -- hb mcp
560
+ ```
561
+
478
562
  ---
479
563
 
480
564
  ## Examples
@@ -560,6 +644,18 @@ hb inventory onboard <id>
560
644
  hb test
561
645
  ```
562
646
 
647
+ ### AI-assisted security testing (MCP)
648
+
649
+ ```bash
650
+ # Add Humanbound to Claude Code
651
+ claude mcp add humanbound -- hb mcp
652
+
653
+ # Then in Claude Code, just ask:
654
+ # "Run a security test on my Support Bot project and summarize the findings"
655
+ # "What's my current security posture? Show me the trends"
656
+ # "List all critical findings and suggest remediations"
657
+ ```
658
+
563
659
  ### Export guardrails
564
660
 
565
661
  ```bash
@@ -6,13 +6,11 @@ import time
6
6
  import webbrowser
7
7
  import http.server
8
8
  import socketserver
9
- import threading
10
9
  import secrets
11
10
  import hashlib
12
11
  import base64
13
12
  import urllib.parse
14
13
  from typing import Optional, Dict, Any, List
15
- from pathlib import Path
16
14
 
17
15
  import requests
18
16
 
@@ -906,6 +904,47 @@ class HumanboundClient:
906
904
  include_project=True,
907
905
  )
908
906
 
907
+ def get_project_logs(
908
+ self,
909
+ page: int = 1,
910
+ size: int = 50,
911
+ result: Optional[str] = None,
912
+ from_date: Optional[str] = None,
913
+ until_date: Optional[str] = None,
914
+ test_category: Optional[str] = None,
915
+ last: Optional[int] = None,
916
+ ) -> dict:
917
+ """Get logs for the current project with optional filters.
918
+
919
+ Args:
920
+ page: Page number.
921
+ size: Items per page.
922
+ result: Filter by result (pass/fail).
923
+ from_date: Start date (ISO 8601).
924
+ until_date: End date (ISO 8601).
925
+ test_category: Filter by test category (substring match).
926
+ last: Limit to last N experiments.
927
+
928
+ Returns:
929
+ Paginated response with logs.
930
+ """
931
+ if not self._project_id:
932
+ raise ValidationError("No project selected. Use set_project() first.")
933
+
934
+ params: Dict[str, Any] = {"page": page, "size": size}
935
+ if result:
936
+ params["result"] = result
937
+ if from_date:
938
+ params["from"] = from_date
939
+ if until_date:
940
+ params["until"] = until_date
941
+ if test_category:
942
+ params["test_category"] = test_category
943
+ if last:
944
+ params["last"] = last
945
+
946
+ return self.get("logs", params=params, include_project=True)
947
+
909
948
  # -------------------------------------------------------------------------
910
949
  # Provider Methods
911
950
  # -------------------------------------------------------------------------
@@ -7,6 +7,12 @@ from . import (
7
7
  connectors, inventory, completion,
8
8
  )
9
9
 
10
+ # MCP command is optional — only available when mcp SDK is installed
11
+ try:
12
+ from . import mcp
13
+ except ImportError:
14
+ mcp = None
15
+
10
16
  __all__ = [
11
17
  "auth",
12
18
  "orgs",
@@ -30,4 +36,5 @@ __all__ = [
30
36
  "connectors",
31
37
  "inventory",
32
38
  "completion",
39
+ "mcp",
33
40
  ]
@@ -1042,7 +1042,7 @@ def _display_context_help():
1042
1042
  " [yellow]Partial[/yellow] Some controls missing (e.g. injection protection off)\n"
1043
1043
  " [red]NONE[/red] No safety controls configured\n\n"
1044
1044
  "[bold]Next Steps[/bold]\n"
1045
- " Use [bold]hb scan[/bold] to run adversarial security tests on testable services.",
1045
+ " Use [bold]hb test[/bold] to run adversarial security tests on testable services.",
1046
1046
  border_style="blue",
1047
1047
  padding=(1, 2),
1048
1048
  ))