agentsentinel-cli 0.3.0__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.
@@ -0,0 +1,187 @@
1
+ Metadata-Version: 2.4
2
+ Name: agentsentinel-cli
3
+ Version: 0.3.0
4
+ Summary: Security scanner for AI agents and MCP servers — finds exfiltration paths, unauthenticated tool exposure, code execution risks, and misconfigured agents
5
+ Project-URL: Homepage, https://github.com/jaydenaung/agentsentinel
6
+ Project-URL: Repository, https://github.com/jaydenaung/agentsentinel
7
+ License: Apache-2.0
8
+ Keywords: agent-security,ai-security,cli,devsecops,discovery,langchain,llm,mcp,openai,scanner
9
+ Classifier: Development Status :: 3 - Alpha
10
+ Classifier: Environment :: Console
11
+ Classifier: Intended Audience :: Developers
12
+ Classifier: License :: OSI Approved :: Apache Software License
13
+ Classifier: Topic :: Security
14
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
15
+ Requires-Python: >=3.10
16
+ Requires-Dist: click>=8.0.0
17
+ Requires-Dist: rich>=13.0.0
18
+ Provides-Extra: all
19
+ Requires-Dist: httpx>=0.24.0; extra == 'all'
20
+ Requires-Dist: psutil>=5.9.0; extra == 'all'
21
+ Provides-Extra: connect
22
+ Requires-Dist: httpx>=0.24.0; extra == 'connect'
23
+ Provides-Extra: discover
24
+ Requires-Dist: httpx>=0.24.0; extra == 'discover'
25
+ Requires-Dist: psutil>=5.9.0; extra == 'discover'
26
+ Provides-Extra: mcp
27
+ Requires-Dist: httpx>=0.24.0; extra == 'mcp'
28
+ Description-Content-Type: text/markdown
29
+
30
+ # agentsentinel-cli
31
+
32
+ One-command security scanner for AI agents and MCP servers. No server, no Docker, no setup.
33
+
34
+ ```bash
35
+ pip install agentsentinel-cli
36
+ sentinel scan my_agent.py
37
+ sentinel mcp scan http://localhost:3000
38
+ ```
39
+
40
+ ---
41
+
42
+ ## Install
43
+
44
+ ```bash
45
+ pip install agentsentinel-cli
46
+
47
+ # With MCP server scanning (HTTP transport):
48
+ pip install "agentsentinel-cli[mcp]"
49
+
50
+ # With agent discovery (process + network scanning):
51
+ pip install "agentsentinel-cli[discover]"
52
+
53
+ # Everything:
54
+ pip install "agentsentinel-cli[all]"
55
+ ```
56
+
57
+ ---
58
+
59
+ ## Commands
60
+
61
+ ### `sentinel scan` — audit an agent file
62
+
63
+ Detects exfiltration paths, dangerous grants, hardcoded credentials, and more
64
+ from static analysis of Python agent files.
65
+
66
+ ```bash
67
+ # Scan a single file
68
+ sentinel scan my_agent.py
69
+
70
+ # Scan a directory recursively
71
+ sentinel scan ./agents/
72
+
73
+ # Fail with exit code 1 if CRITICAL findings exist (for CI)
74
+ sentinel scan my_agent.py --fail-on CRITICAL
75
+
76
+ # Output JSON (for piping into other tools)
77
+ sentinel scan my_agent.py --format json
78
+
79
+ # Include live behavior data from a running AgentSentinel instance
80
+ sentinel scan my_agent.py --connect http://localhost:9000
81
+ ```
82
+
83
+ **What it detects:**
84
+
85
+ | Rule | Severity | Description |
86
+ |------|----------|-------------|
87
+ | `EXFILTRATION_PATH` | CRITICAL | Agent holds internal-read AND external-write grants |
88
+ | `CODE_EXECUTION_GRANT` | CRITICAL | Agent holds bash/exec/shell grants |
89
+ | `HARDCODED_CREDENTIALS` | CRITICAL | API keys or secrets hardcoded in source |
90
+ | `SECRETS_ACCESS_GRANT` | HIGH | Agent holds runtime access to vaults or tokens |
91
+ | `PROMPT_INJECTION_VECTOR` | HIGH | Agent reads from web AND holds write grants |
92
+ | `LATERAL_MOVEMENT_PATH` | HIGH | Admin/IAM grants combined with infrastructure grants |
93
+ | `UNBOUNDED_FILE_ACCESS` | HIGH | Filesystem write grants with no scoped description |
94
+ | `PRIVILEGE_EXCESS` | HIGH | Write grants on a read-only described agent |
95
+ | `DANGEROUS_GRANTS` | HIGH | Agent holds dangerous tool grants |
96
+ | `TOOL_SPRAWL` | MEDIUM | Too many tools across too many categories |
97
+ | `UNDESCRIBED_WRITE_AGENT` | MEDIUM | Write grants with no agent description |
98
+ | `MISSING_RATE_LIMIT` | LOW | Dangerous grants without rate limit configuration |
99
+
100
+ ---
101
+
102
+ ### `sentinel mcp scan` — audit an MCP server
103
+
104
+ Connects to any MCP server, enumerates all exposed tools, and checks for
105
+ authentication gaps, exfiltration paths, code execution exposure, and input
106
+ validation weaknesses.
107
+
108
+ ```bash
109
+ # Scan an HTTP MCP server
110
+ sentinel mcp scan http://localhost:3000
111
+
112
+ # Scan with authentication
113
+ sentinel mcp scan http://localhost:3000 --auth-header "Authorization: Bearer token"
114
+
115
+ # Scan a stdio-transport server (launch as subprocess)
116
+ sentinel mcp scan --stdio "python my_mcp_server.py"
117
+
118
+ # JSON output for CI pipelines
119
+ sentinel mcp scan http://localhost:3000 --format json
120
+
121
+ # Fail CI on CRITICAL findings
122
+ sentinel mcp scan http://localhost:3000 --fail-on CRITICAL
123
+ ```
124
+
125
+ **What it detects:**
126
+
127
+ | Rule | Severity | Description |
128
+ |------|----------|-------------|
129
+ | `NO_AUTH` | CRITICAL | Server accepts tool enumeration with no credentials (HTTP) |
130
+ | `UNAUTH_DANGEROUS_EXEC` | CRITICAL | Dangerous tools callable without authentication (HTTP) |
131
+ | `EXFILTRATION_PATH` | CRITICAL | Server exposes internal-read AND external-write tools |
132
+ | `CODE_EXECUTION_TOOL` | CRITICAL | Server exposes code execution tools |
133
+ | `UNBOUNDED_INPUT` | HIGH | Tools accept unconstrained string inputs — injection surface |
134
+ | `TOOL_SPRAWL` | MEDIUM | Excessive tool count or category breadth |
135
+ | `VAGUE_TOOL_DESCRIPTIONS` | MEDIUM | Short/missing descriptions expand injection surface |
136
+ | `MISSING_RATE_LIMIT` | LOW | Dangerous tools present with no visible rate limiting |
137
+
138
+ See [`docs/mcp-scan-testing.md`](../docs/mcp-scan-testing.md) for test server examples
139
+ that trigger every finding.
140
+
141
+ ---
142
+
143
+ ### `sentinel discover` — find AI agents in your environment
144
+
145
+ ```bash
146
+ sentinel discover # scan processes + network
147
+ sentinel discover --docker # include Docker containers
148
+ sentinel discover --path ./agents # scan a source directory
149
+ sentinel discover --subnet 10.0.0.0/24 # scan an internal subnet
150
+ sentinel discover --format json # machine-readable output
151
+ ```
152
+
153
+ ---
154
+
155
+ ## CI/CD integration
156
+
157
+ ```yaml
158
+ # .github/workflows/security.yml
159
+ - name: Scan AI agents
160
+ run: |
161
+ pip install agentsentinel-cli
162
+ sentinel scan ./agents/ --fail-on CRITICAL
163
+
164
+ - name: Scan MCP server
165
+ run: |
166
+ pip install "agentsentinel-cli[mcp]"
167
+ sentinel mcp scan http://localhost:3000 --fail-on CRITICAL
168
+ ```
169
+
170
+ ---
171
+
172
+ ## Tool detection (`sentinel scan`)
173
+
174
+ The scanner detects tools defined via:
175
+ - `@tool` decorator (LangChain)
176
+ - `@SentinelTool` decorator (AgentSentinel middleware)
177
+ - `BaseTool` / `StructuredTool` subclasses
178
+ - `Tool(name=...)` and `StructuredTool(name=...)` instantiations
179
+
180
+ ---
181
+
182
+ ## Requirements
183
+
184
+ - Python 3.10+
185
+ - No running server required for static scan or stdio MCP scan
186
+ - `httpx` required for HTTP MCP scanning: `pip install "agentsentinel-cli[mcp]"`
187
+ - `psutil` + `httpx` required for `sentinel discover`: `pip install "agentsentinel-cli[discover]"`
@@ -0,0 +1,15 @@
1
+ agentsentinel_cli/__init__.py,sha256=4JlFsZX__o3sUnN0nPS_fWgMO1_Z2R0fBoz7cEJ4B7I,95
2
+ agentsentinel_cli/cli.py,sha256=s-kG2c09R0ZVSVT1WZPietah7V1tot22RV7qtmjry_Q,13499
3
+ agentsentinel_cli/discover.py,sha256=U88xaETPPhAmbF6BWHVJfElPwBQ1vHIQE1mk12iUoCk,25365
4
+ agentsentinel_cli/discover_report.py,sha256=qZzpzPSa6-jUabXubv7aLwxyzgjYb91mA7Lu69Y6kNM,6728
5
+ agentsentinel_cli/frameworks.py,sha256=c_Qzp2m3R8VRBh0ToWbEh5HZ8S4LWmh_54lmGiF4Vyg,5774
6
+ agentsentinel_cli/mcp_client.py,sha256=9LG25fBCnbJ4bApDy3hGcEFO4hNrARSSjSzxf1rbQwE,7978
7
+ agentsentinel_cli/mcp_report.py,sha256=JfLen1atTBdIB8o-ZaCGwKDJ0t85ztPMIylChtPG2Ic,5866
8
+ agentsentinel_cli/mcp_rules.py,sha256=qnfk5hAZw6R4ILgcGb_UW_r4ZjLneGcqfS_mv4ObKKw,8591
9
+ agentsentinel_cli/report.py,sha256=nrY60VHC7t8cBxbrTSusjB6-Rcv6kA9tqJpwUNqgciU,6652
10
+ agentsentinel_cli/rules.py,sha256=xp5BkIFcE6o6lgl93whl-VTcHpASy2-Kyph0boiiuQY,9142
11
+ agentsentinel_cli/scanner.py,sha256=hXq_SdEkW8RDeMdo4yNjpz8VElCbyGa2xltFkRYE2LM,11856
12
+ agentsentinel_cli-0.3.0.dist-info/METADATA,sha256=efpAcqyiO-bjDgwQ66be5mvTNnvbNlUR6QOJOidpino,6350
13
+ agentsentinel_cli-0.3.0.dist-info/WHEEL,sha256=QccIxa26bgl1E6uMy58deGWi-0aeIkkangHcxk2kWfw,87
14
+ agentsentinel_cli-0.3.0.dist-info/entry_points.txt,sha256=mGQRrH7sA0Namh4xq7fkAAYHLR5aitUXx3utLzbO4H8,56
15
+ agentsentinel_cli-0.3.0.dist-info/RECORD,,
@@ -0,0 +1,4 @@
1
+ Wheel-Version: 1.0
2
+ Generator: hatchling 1.29.0
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ sentinel = agentsentinel_cli.cli:main