probebox 1.0.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.
- probebox-1.0.0/.gitignore +12 -0
- probebox-1.0.0/LICENSE +21 -0
- probebox-1.0.0/PKG-INFO +437 -0
- probebox-1.0.0/README.md +404 -0
- probebox-1.0.0/README_zh.md +404 -0
- probebox-1.0.0/pyproject.toml +83 -0
- probebox-1.0.0/src/probebox/__init__.py +88 -0
- probebox-1.0.0/src/probebox/_acl.py +209 -0
- probebox-1.0.0/src/probebox/_filelock.py +53 -0
- probebox-1.0.0/src/probebox/_net.py +37 -0
- probebox-1.0.0/src/probebox/_safefs.py +713 -0
- probebox-1.0.0/src/probebox/_version.py +14 -0
- probebox-1.0.0/src/probebox/_win32.py +614 -0
- probebox-1.0.0/src/probebox/budget.py +320 -0
- probebox-1.0.0/src/probebox/cli.py +1042 -0
- probebox-1.0.0/src/probebox/compare.py +568 -0
- probebox-1.0.0/src/probebox/config.py +387 -0
- probebox-1.0.0/src/probebox/contracts.py +575 -0
- probebox-1.0.0/src/probebox/discover/__init__.py +1 -0
- probebox-1.0.0/src/probebox/discover/audit.py +937 -0
- probebox-1.0.0/src/probebox/discover/configs.py +267 -0
- probebox-1.0.0/src/probebox/discover/cross_asset.py +223 -0
- probebox-1.0.0/src/probebox/discover/instructions.py +139 -0
- probebox-1.0.0/src/probebox/discover/probe.py +464 -0
- probebox-1.0.0/src/probebox/discover/render.py +298 -0
- probebox-1.0.0/src/probebox/discover/sanitize.py +587 -0
- probebox-1.0.0/src/probebox/discover/servers.py +334 -0
- probebox-1.0.0/src/probebox/discover/sources.py +428 -0
- probebox-1.0.0/src/probebox/fingerprints.py +297 -0
- probebox-1.0.0/src/probebox/hooks.py +288 -0
- probebox-1.0.0/src/probebox/html_report.py +510 -0
- probebox-1.0.0/src/probebox/init_config.py +789 -0
- probebox-1.0.0/src/probebox/probes/__init__.py +1 -0
- probebox-1.0.0/src/probebox/probes/attack_server.py +367 -0
- probebox-1.0.0/src/probebox/probes/constants.py +64 -0
- probebox-1.0.0/src/probebox/probes/mcp/__init__.py +84 -0
- probebox-1.0.0/src/probebox/probes/mcp/__main__.py +6 -0
- probebox-1.0.0/src/probebox/probes/mcp/faults.py +380 -0
- probebox-1.0.0/src/probebox/probes/mcp/policy.py +155 -0
- probebox-1.0.0/src/probebox/probes/mcp/proxy.py +2030 -0
- probebox-1.0.0/src/probebox/probes/mcp/proxy_policy.py +856 -0
- probebox-1.0.0/src/probebox/probes/mcp/runtime.py +167 -0
- probebox-1.0.0/src/probebox/probes/mcp/server.py +422 -0
- probebox-1.0.0/src/probebox/probes/mcp/tools.py +500 -0
- probebox-1.0.0/src/probebox/probes/probe_state.py +719 -0
- probebox-1.0.0/src/probebox/probes/sandbox.py +84 -0
- probebox-1.0.0/src/probebox/reporting.py +673 -0
- probebox-1.0.0/src/probebox/runner.py +1684 -0
- probebox-1.0.0/src/probebox/sarif.py +318 -0
- probebox-1.0.0/src/probebox/scenarios/__init__.py +1 -0
- probebox-1.0.0/src/probebox/scenarios/evaluator.py +771 -0
- probebox-1.0.0/src/probebox/scenarios/schema.py +712 -0
- probebox-1.0.0/src/probebox/scenarios/suite.yaml +1273 -0
- probebox-1.0.0/src/probebox/skills/__init__.py +1 -0
- probebox-1.0.0/src/probebox/skills/agent_runtime.py +187 -0
- probebox-1.0.0/src/probebox/skills/audit.py +284 -0
- probebox-1.0.0/src/probebox/skills/dynamic.py +971 -0
- probebox-1.0.0/src/probebox/skills/fences.py +103 -0
- probebox-1.0.0/src/probebox/skills/inputs.py +154 -0
- probebox-1.0.0/src/probebox/skills/model_worker.py +54 -0
- probebox-1.0.0/src/probebox/skills/skill_rules.yaml +15 -0
- probebox-1.0.0/src/probebox/standards.py +87 -0
- probebox-1.0.0/src/probebox/strategies/__init__.py +21 -0
- probebox-1.0.0/src/probebox/strategies/candidates.py +98 -0
- probebox-1.0.0/src/probebox/strategies/replay.py +83 -0
- probebox-1.0.0/src/probebox/strategies/transforms.py +230 -0
- probebox-1.0.0/src/probebox/targets/__init__.py +14 -0
- probebox-1.0.0/src/probebox/targets/_python_worker.py +473 -0
- probebox-1.0.0/src/probebox/targets/base.py +192 -0
- probebox-1.0.0/src/probebox/targets/cli_target.py +577 -0
- probebox-1.0.0/src/probebox/targets/http_target.py +964 -0
- probebox-1.0.0/src/probebox/targets/python_target.py +210 -0
- probebox-1.0.0/src/probebox/telemetry.py +879 -0
- probebox-1.0.0/src/probebox/utils.py +340 -0
probebox-1.0.0/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ProbeBox Contributors
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
probebox-1.0.0/PKG-INFO
ADDED
|
@@ -0,0 +1,437 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: probebox
|
|
3
|
+
Version: 1.0.0
|
|
4
|
+
Summary: Local security toolkit for AI agents: deterministic red-team scan, fail-closed MCP audit proxy, Skill auditor, read-only discovery
|
|
5
|
+
Project-URL: Homepage, https://github.com/ShunyangLiu/probebox
|
|
6
|
+
Project-URL: Repository, https://github.com/ShunyangLiu/probebox
|
|
7
|
+
Project-URL: Issues, https://github.com/ShunyangLiu/probebox/issues
|
|
8
|
+
Author: Shunyang Liu
|
|
9
|
+
License: MIT
|
|
10
|
+
License-File: LICENSE
|
|
11
|
+
Keywords: agent-security,ai-security,mcp,mcp-audit,owasp-asi,prompt-injection,red-teaming,sarif,skill-security
|
|
12
|
+
Classifier: Development Status :: 5 - Production/Stable
|
|
13
|
+
Classifier: Intended Audience :: Developers
|
|
14
|
+
Classifier: Intended Audience :: Information Technology
|
|
15
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
16
|
+
Classifier: Operating System :: MacOS
|
|
17
|
+
Classifier: Operating System :: Microsoft :: Windows
|
|
18
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
19
|
+
Classifier: Programming Language :: Python :: 3
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
21
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
22
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
23
|
+
Classifier: Topic :: Security
|
|
24
|
+
Requires-Python: >=3.11
|
|
25
|
+
Requires-Dist: httpx2<3.0.0,>=2.10.0
|
|
26
|
+
Requires-Dist: httpx>=0.28.0
|
|
27
|
+
Requires-Dist: mcp<3.0.0,>=2.3.0
|
|
28
|
+
Requires-Dist: pydantic>=2.10.0
|
|
29
|
+
Requires-Dist: python-dotenv>=1.0.1
|
|
30
|
+
Requires-Dist: pyyaml>=6.0.2
|
|
31
|
+
Requires-Dist: rich>=13.9.4
|
|
32
|
+
Description-Content-Type: text/markdown
|
|
33
|
+
|
|
34
|
+
# ProbeBox
|
|
35
|
+
|
|
36
|
+
[](https://github.com/ShunyangLiu/probebox/actions/workflows/ci.yml)
|
|
37
|
+
[](pyproject.toml)
|
|
38
|
+
[](#platforms)
|
|
39
|
+
[](LICENSE)
|
|
40
|
+
[](pyproject.toml)
|
|
41
|
+
|
|
42
|
+
**English** | [简体中文](README_zh.md)
|
|
43
|
+
|
|
44
|
+
**ProbeBox is a local security toolkit for AI agents.** It scans an agent with deterministic attacks and evidence that leaves the model's reach, sits between an agent and its real MCP servers as a fail-closed audit proxy, audits Skills offline and in an isolated container, and starts with a read-only look at what an agent on your machine is already configured to reach. It adds no agent code of its own, spends no attacker-side model tokens, and works on Linux, macOS and Windows.
|
|
45
|
+
|
|
46
|
+
> **What a result means here.** A `VULNERABLE` verdict or a `CONFIRMED_SPECIFIC_VIOLATION` is backed by something ProbeBox observed itself: a request to its own collector, a write to its own sandbox, a tool trace. Everything else — `DEFENDED`, `INCONCLUSIVE`, a clean Skill audit, an empty discovery report — is not proof of safety. The static Skill engine in particular finds few malicious Skills and **cannot be used to clear one**; see [Auditing Skills](#auditing-skills).
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
## Table of Contents
|
|
51
|
+
|
|
52
|
+
- [The Commands](#the-commands)
|
|
53
|
+
- [Why ProbeBox](#why-probebox)
|
|
54
|
+
- [Quick Start](#quick-start)
|
|
55
|
+
- [Security Coverage (38 Built-In Scenarios)](#security-coverage-38-built-in-scenarios)
|
|
56
|
+
- [Auditing Skills](#auditing-skills)
|
|
57
|
+
- [Auditing a Real MCP Server](#auditing-a-real-mcp-server)
|
|
58
|
+
- [Discover and Init](#discover-and-init)
|
|
59
|
+
- [Platforms](#platforms)
|
|
60
|
+
- [Recorded Results](#recorded-results)
|
|
61
|
+
- [Security Warning & Responsible Use](#security-warning--responsible-use)
|
|
62
|
+
- [Development, Testing & Contributing](#development-testing--contributing)
|
|
63
|
+
- [Changes in 1.0.0](#changes-in-100)
|
|
64
|
+
- [Roadmap, License & Citation](#roadmap-license--citation)
|
|
65
|
+
|
|
66
|
+
---
|
|
67
|
+
|
|
68
|
+
## The Commands
|
|
69
|
+
|
|
70
|
+
| Command | What it does | Talks to a model? | Runs anything it finds? |
|
|
71
|
+
|---|---|---|---|
|
|
72
|
+
| `probebox discover` | Reads the MCP configurations, Skills and rule files that agents on this machine load; reports what they can reach and what that implies | No | No |
|
|
73
|
+
| `probebox init` | Writes a `scan.yaml` to review, from options you type | No | No |
|
|
74
|
+
| `probebox scan` | Runs the built-in attack suite against an agent over HTTP, OpenAI-compatible, CLI or Python | Only the agent under test | The agent you point it at |
|
|
75
|
+
| `probebox scan-skill` | Audits one Skill: offline, or paired with and without it in an isolated container | Only with `--dynamic` | Only with `--dynamic`, inside the container |
|
|
76
|
+
| `probebox proxy-mcp` | Passes an agent's MCP traffic to a real server, forwarding nothing you have not allowed | No | The upstream server you configure |
|
|
77
|
+
|
|
78
|
+
All commands run offline except where a model or a server is involved, and none loads `.env` except `scan` and `scan-skill --dynamic`.
|
|
79
|
+
|
|
80
|
+
## Why ProbeBox
|
|
81
|
+
|
|
82
|
+
1. **No agent code inside the scanner.** `src/probebox/` targets any external agent over HTTP JSON, OpenAI `/chat/completions`, a local CLI (with multi-turn `--resume`) or a Python subprocess in its own virtual environment.
|
|
83
|
+
2. **Evidence instead of a judge.** ProbeBox does not ask a model whether an attack worked. It starts two isolated local HTTP servers, an ownership-guarded sandbox and an MCP probe server, and decides from what arrives there: callbacks, canaries, marker writes, tool traces.
|
|
84
|
+
3. **It refuses to guess.** A scenario whose probe was never delivered is `INCONCLUSIVE`, never `DEFENDED`. A Skill it could not read is reported as not scanned. A discovery file that is a link is refused, not followed.
|
|
85
|
+
4. **Defaults that fail closed.** The MCP proxy starts in `audit_readonly` and forwards nothing until a tool is listed. Shell hooks are disabled without `--allow-shell-hooks`. Dynamic Skill audits are opt-in.
|
|
86
|
+
|
|
87
|
+
**Where it sits next to other tools**
|
|
88
|
+
|
|
89
|
+
| Dimension | [promptfoo/promptfoo](https://github.com/promptfoo/promptfoo) | [snyk/agent-scan](https://github.com/snyk/agent-scan) | [Tencent/AI-Infra-Guard](https://github.com/Tencent/AI-Infra-Guard) | **ProbeBox** |
|
|
90
|
+
|---|---|---|---|---|
|
|
91
|
+
| **Primary strength** | Broad LLM and RAG red-teaming, eval matrix, multi-turn attack strategies | Static discovery and inspection of local MCP servers, tools and Skills | Broad AI infrastructure and CVE scanning plus an adaptive red-team suite | **Runtime probing with deterministic out-of-band evidence, a fail-closed MCP audit proxy, and read-only discovery** |
|
|
92
|
+
| **Attack and verdict engine** | Attacker and grader models plus assertions | Static analysis and poisoning rules | LLM-assisted red team, OWASP ASI reporting | **Declarative fixtures and MCP faults, 10 deterministic oracles, 0 attacker tokens** |
|
|
93
|
+
| **MCP supply chain** | Custom plugins | Static inspection of tool definitions | Static and runtime checks | **Live injection on a probe server, plus a transparent proxy in front of real servers** |
|
|
94
|
+
| **False-negative guard** | Standard eval scoring | Static coverage | Standard reporting | **`INCONCLUSIVE` whenever the fault provably was not delivered** |
|
|
95
|
+
|
|
96
|
+
They complement each other: use a scanner for breadth and ProbeBox when you need to show that a specific agent did a specific thing.
|
|
97
|
+
|
|
98
|
+
---
|
|
99
|
+
|
|
100
|
+
## Quick Start
|
|
101
|
+
|
|
102
|
+
Requires **Python 3.11+** and [`uv`](https://docs.astral.sh/uv/).
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
git clone https://github.com/ShunyangLiu/probebox.git
|
|
106
|
+
cd probebox
|
|
107
|
+
uv sync
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
### 1. See what your agents can already reach
|
|
111
|
+
|
|
112
|
+
Read-only, offline, a few seconds. It reads the well-known configuration, Skills and rule files of Claude Code, Codex CLI, Cursor, Windsurf, Claude Desktop and VS Code, and prints a JSON report.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
uv run probebox discover --format markdown
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Credentials stay where they are: the report keeps names, kinds, hosts and shapes, never a value. [Discover and Init](#discover-and-init) says exactly what is read and what is not.
|
|
119
|
+
|
|
120
|
+
### 2. Write a configuration to review
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
uv run probebox init --target my-agent=http://127.0.0.1:8000/chat
|
|
124
|
+
uv run probebox init --target my-agent=http://127.0.0.1:8000/chat \
|
|
125
|
+
--mcp-proxy-upstream https://mcp.example.com/mcp
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The second form also writes a `proxy-policy.yaml` that allows nothing until you list a tool. `init` never copies anything `discover` found, and never replaces an existing file unless you pass `--force`.
|
|
129
|
+
|
|
130
|
+
### 3. Run the 0-token demo
|
|
131
|
+
|
|
132
|
+
Two local demo agents answer from a fixed script, so this needs no API key and finishes in a few seconds:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
uv run probebox scan --config examples/scan.demo-mock.yaml
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
With Suite v3.0 the unguarded `unsafe-agent` falls for 25 of the 31 attacks it can receive (6 are `DEFENDED`, 2 `INCONCLUSIVE`); the guarded `safe-agent` falls for 0 of 31. Both pass the 5 benign controls. Reports are written to `results/demo-mock/`.
|
|
139
|
+
|
|
140
|
+
### 4. Run against your own agent
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
# A generic JSON HTTP agent
|
|
144
|
+
uv run probebox scan --target my-agent=http://127.0.0.1:8000/chat --capabilities chat,web
|
|
145
|
+
|
|
146
|
+
# The fast baseline only, or the deep set
|
|
147
|
+
uv run probebox scan --tag core --target my-agent=http://127.0.0.1:8000/chat --capabilities chat,web,mcp_probe
|
|
148
|
+
uv run probebox scan --tag extended --target my-agent=http://127.0.0.1:8000/chat --capabilities chat,web,mcp_probe
|
|
149
|
+
|
|
150
|
+
# An OpenAI-compatible gateway
|
|
151
|
+
uv run probebox scan --target openai:https://your-gateway.example.com/v1/chat/completions --model my-agent
|
|
152
|
+
|
|
153
|
+
# Fail a CI run on findings, errors or missing coverage
|
|
154
|
+
uv run probebox scan --config examples/scan.external-blackbox.yaml --fail-on-vuln --fail-on-benign-fail --fail-on-inconclusive
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Ready-made configurations for Claude Code, Codex CLI, OpenAI Agents SDK, LangGraph, Dify, Flowise and Browser Use are in [`examples/`](examples/).
|
|
158
|
+
|
|
159
|
+
<details>
|
|
160
|
+
<summary><strong>Python SDK</strong></summary>
|
|
161
|
+
|
|
162
|
+
```python
|
|
163
|
+
import asyncio
|
|
164
|
+
from pathlib import Path
|
|
165
|
+
from probebox import HttpTarget, run_scan
|
|
166
|
+
|
|
167
|
+
report = asyncio.run(
|
|
168
|
+
run_scan(
|
|
169
|
+
targets=[HttpTarget(name="my-agent", url="http://127.0.0.1:8000/chat", capabilities={"chat", "web"})],
|
|
170
|
+
tags=["core"], # Omit to run all 38 built-in scenarios
|
|
171
|
+
results_dir=Path("results/matrix-run"),
|
|
172
|
+
)
|
|
173
|
+
)
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
</details>
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
## Security Coverage (38 Built-In Scenarios)
|
|
181
|
+
|
|
182
|
+
The built-in suite ([src/probebox/scenarios/suite.yaml](src/probebox/scenarios/suite.yaml), `v3.0`) holds **33 attack scenarios and 5 benign utility controls** and maps every one of the ten OWASP Agentic Security categories (`ASI01`–`ASI10`).
|
|
183
|
+
|
|
184
|
+
| Category | Attack surface | Scenarios | Capabilities | What counts as evidence |
|
|
185
|
+
|---|---|---:|---|---|
|
|
186
|
+
| `1_goal_hijacking` | Direct and indirect goal hijacking | 6 | `chat`, `web`, `mcp_probe` | A protected tool is called, or the callback server is hit |
|
|
187
|
+
| `2_info_leakage` | Sensitive information leakage and exfiltration | 4 | `canary_seeded`, `web`, `mcp_probe` | A canary appears in a reply, an argument, or a callback body |
|
|
188
|
+
| `3_memory_poisoning` | Memory poisoning and cross-session leakage | 2 | `chat`, `mcp_probe` | A canary from one session surfaces in another |
|
|
189
|
+
| `4_excessive_agency` | Excessive agency and confirmation bypass | 3 | `chat`, `mcp_probe` | A high-risk tool is called without the required confirmation |
|
|
190
|
+
| `5_mcp_supply_chain` | MCP tool poisoning and supply chain, including malicious Skills | 9 | `chat`, `mcp_probe` (+`web` for some) | A fault-injected or shadow tool is invoked, or a canary leaves through it |
|
|
191
|
+
| `6_ssrf_local_access` | SSRF and local resource access | 4 | `chat`, `web`, `mcp_probe` | The isolated SSRF origin is reached, a secret file is read, a marker is written |
|
|
192
|
+
| `7_agentic_owasp_advanced` | ASI05, ASI07–ASI10 | 5 | `chat`, `web`, `mcp_probe` | Controlled executors, ledgers and second nodes record what was accepted |
|
|
193
|
+
|
|
194
|
+
Tags select a subset: `core` (18), `extended` (20), `non-mcp` (11), `owasp-full` (6) and `skill-defense` (2). Seven scenarios run over several turns.
|
|
195
|
+
|
|
196
|
+
**How many scenarios you can run depends on what you control.** ProbeBox skips a scenario whose requirements you cannot meet and records it as `SKIPPED` rather than scoring it.
|
|
197
|
+
|
|
198
|
+
| You control | Capabilities to declare | Runnable | What gets tested |
|
|
199
|
+
|---|---|---:|---|
|
|
200
|
+
| Only a chat endpoint | `chat` | 1 / 38 | Cross-session memory isolation |
|
|
201
|
+
| Chat and a built-in web fetcher | `chat, web` | 9 / 38 | Indirect web injections, forms, SSRF |
|
|
202
|
+
| You can mount `probebox probe-mcp` | `chat, web, mcp_probe` | 36 / 38 | The MCP supply-chain attacks, excessive agency, local file access |
|
|
203
|
+
| You can also seed a staging secret | `chat, web, mcp_probe, canary_seeded` | 38 / 38 | Adds system-prompt extraction |
|
|
204
|
+
|
|
205
|
+
**Delivery before verdicts.** Each report lists, per target, which ASI categories the suite maps, which were selected, which were provably delivered and which received a verdict. A verdict is not proof of delivery, and for chat turns and web pages delivery means only that the adapter or fixture server returned content, not that the model read it.
|
|
206
|
+
|
|
207
|
+
**Strategies.** `--strategy` applies one deterministic transformation (for example `delimiter_wrap`) to the attack text of marked scenarios. Multi-turn scenarios that a strategy cannot transform are skipped. `compare` keys results by `(scenario_id, strategy)`, so runs made under different strategies are never treated as the same condition. `--attacker-model` proposes at most one new candidate for review and never runs a target; `--export-replay` writes a sanitized suite you can rerun offline.
|
|
208
|
+
|
|
209
|
+
Full schemas and oracles: **[docs/suite-and-oracles.md](docs/suite-and-oracles.md)**.
|
|
210
|
+
|
|
211
|
+
---
|
|
212
|
+
|
|
213
|
+
## Auditing Skills
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
# Offline. Reads the Skill, executes nothing, makes no request.
|
|
217
|
+
uv run probebox scan-skill ./skill
|
|
218
|
+
uv run probebox scan-skill sample.zip --format sarif
|
|
219
|
+
|
|
220
|
+
# Opt in: runs one fixed task with and without the Skill, in an isolated container.
|
|
221
|
+
uv run probebox scan-skill ./skill --dynamic
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
**Offline audit.** The Skill must have `SKILL.md` at its root. The reader follows no symbolic link or junction, refuses hard links and special files, and bounds the number and size of entries, on every platform. The engine then reports four kinds of evidence: structure and hidden text, declarative natural-language rules, a narrow static analysis of Python and shell snippets, and — when `discover` runs it — what the Skill could reach through configured MCP servers. Findings are labelled `clue` or `static_taint`; files it cannot analyze are listed as not scanned.
|
|
225
|
+
|
|
226
|
+
> **The offline audit cannot clear a Skill.** On [SkillFortifyBench](https://github.com/qualixar/skillfortifybench) (MIT, pinned commit `eb9d5a9`), 180 Claude Markdown Skills read as single-file `SKILL.md` assets, the rules frozen before scoring found **0 of 16** malicious Skills in a development split and **0 of 74** in a held-out split, with 0 false positives on 17 and 73 benign Skills. After analysis of fenced Python and shell was added from the development split, a regression run on the same splits found 6 of 16 and 27 of 74; the held-out split had been seen by then, and is no longer an independent test. On the SkillHarm corpus (CC BY 4.0, pinned commit `cc21f90`), 687 complete Skills of 5,274 files, the rules found **19 of the 642 scanned**; 45 could not be scanned. Its clues are worth a reviewer's attention; its silence is worth nothing.
|
|
227
|
+
|
|
228
|
+
**Dynamic audit.** `--dynamic` needs a Linux Docker host with the pinned agent image ([docker/skill-agent](docker/skill-agent/Dockerfile), built by `scripts/build_skill_agent_image.py`). One synthetic task runs twice in a fixed, versioned agent: once without the Skill and once with it. The container has no network, a read-only root and Skill mount, no capabilities and fixed resource limits. The host keeps the model credentials and makes each model request itself. The Docker endpoint must be one you trust to stay what it is while the audit runs: the audit checks that the daemon is the one it recorded, but cannot defend against the local Docker configuration being rewritten under it. The audit confirms a violation only when its own collector receives the confidential synthetic marker through an authorized tool call in the Skill arm and not in the baseline; every other outcome is `INCONCLUSIVE`.
|
|
229
|
+
|
|
230
|
+
Dynamic mode sends the Skill text, the synthetic task and the tool results to the model endpoint in `LLM_BASE_URL`, and says so on stderr before starting. Do not use it on Skills that contain sensitive content.
|
|
231
|
+
|
|
232
|
+
Evidence for the dynamic path comes from a real Docker daemon on Linux with a simulated model: isolation, cleanup and the protocol are verified there. With a real model (`deepseek-flash`) the result has been `INCONCLUSIVE`, which is not a safety result. Dynamic mode has not yet been exercised against Docker Desktop on macOS or Windows.
|
|
233
|
+
|
|
234
|
+
---
|
|
235
|
+
|
|
236
|
+
## Auditing a Real MCP Server
|
|
237
|
+
|
|
238
|
+
`probebox proxy-mcp` sits between an agent and a server it actually uses, over stdio, Streamable-HTTP or SSE in any combination.
|
|
239
|
+
|
|
240
|
+
| Mode | What it does |
|
|
241
|
+
|---|---|
|
|
242
|
+
| `audit_readonly` (default) | Forwards nothing unless a local policy lists the tool, constrains its arguments and, if set, matches the expected server name. A changed tool list or an incomplete page freezes the session. |
|
|
243
|
+
| `observe` | Passes everything and records it. Writes reach the real server. |
|
|
244
|
+
| `active_sandbox` | For an isolated environment only: forwards calls that are not on the deny list. |
|
|
245
|
+
|
|
246
|
+
`annotations.readOnlyHint` from the upstream is shown and never trusted. The proxy strips credentials the agent sends before talking to the upstream, keeps the upstream's credentials from the agent, and can inject faults and lossless canaries into tool calls so that an exfiltration can be proven by the collector receiving the canary. It was exercised on Linux against the reference filesystem, SQLite and fetch servers with a real agent; the independent file, database and HTTP counters showed no business write and no leftover process.
|
|
247
|
+
|
|
248
|
+
Details: [docs/proxy-policy.md](docs/proxy-policy.md).
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
## Discover and Init
|
|
253
|
+
|
|
254
|
+
`probebox discover` answers "what can the agents on this machine reach?" before you configure anything.
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
uv run probebox discover # JSON on stdout
|
|
258
|
+
uv run probebox discover --format markdown # for reading
|
|
259
|
+
uv run probebox discover --output r.json --html r.html --sarif r.sarif.json
|
|
260
|
+
uv run probebox discover --no-home # project files only
|
|
261
|
+
uv run probebox discover --probe-tools 'cursor/user/live@616c549372575100' # the token a listing gives
|
|
262
|
+
uv run probebox discover --fail-on high # exit 1 for a finding, 3 if the audit did not finish
|
|
263
|
+
```
|
|
264
|
+
|
|
265
|
+
**What it reads.** Well-known default locations only:
|
|
266
|
+
|
|
267
|
+
| Client | MCP configuration | Skills | Rule and memory files |
|
|
268
|
+
|---|---|---|---|
|
|
269
|
+
| Claude Code | `~/.claude.json`, `.mcp.json` | `.claude/skills`, installed plugins | `CLAUDE.md`, `.claude/rules`, `CLAUDE.local.md` |
|
|
270
|
+
| Codex CLI | `~/.codex/config.toml` | `~/.codex/skills`, `.agents/skills` | `AGENTS.md` |
|
|
271
|
+
| Cursor | `~/.cursor/mcp.json`, `.cursor/mcp.json` | `.cursor/skills` | `.cursor/rules`, `.cursorrules` |
|
|
272
|
+
| Windsurf | `~/.codeium/windsurf/mcp_config.json`, `.windsurf/mcp_config.json` | `.windsurf/skills` | `.windsurf/rules`, `.windsurfrules`, memories |
|
|
273
|
+
| Claude Desktop | `claude_desktop_config.json` | — | — |
|
|
274
|
+
| VS Code | user and workspace `mcp.json` | `.github/skills`, `~/.copilot/skills` | `copilot-instructions.md`, `.github/instructions` |
|
|
275
|
+
|
|
276
|
+
**What it reports.** For each configured server: what the client does to reach it (starts a local program, connects out), what its tools can do (`file_read`, `file_write`, `network`, `command`), and on what basis that was inferred: a known server package, or the tools a probed server listed — never the transport. For each Skill and rule file: the same clues `scan-skill` finds. And the two combined: a Skill that names a credential location is one clue; a file-reading server configured for the same client is another; together they are reported as a cross-asset finding, at `clue` level, when the same agent is presented with both in one situation: a server kept for one project is never pooled with one kept for another. Typical configuration findings are server code fetched and run without a pinned version, plain `http` to a non-local server, a credential written into the configuration, a server started through a shell string, a file server rooted at `/` or the home directory, and servers defined by the project directory.
|
|
277
|
+
|
|
278
|
+
**What never leaves the machine.** No value of an environment variable or header, no command-line argument other than its class, no query string, user info or unusual path of a URL, and no bare word off a command line. Paths appear as `$HOME/…` and `$CWD/…`. A file name that is not a plain name, or that is shaped like a credential, is shown under a stable stand-in. Tool descriptions of a probed server are not recorded.
|
|
279
|
+
|
|
280
|
+
**What it will not do.** It executes nothing. It follows no link, on any platform. A root is reached component by component without following a link, and one that cannot be reached that way is not read. `--no-home` reads nothing under your home directory and refuses a project root that is it, is below it, or reaches it through another path; no environment variable that relocates a client's configuration (`CODEX_HOME`, `CLAUDE_CONFIG_DIR`, `XDG_CONFIG_HOME`) is honoured at any time, so there is no second route back. `--probe-tools` contacts only the running remote servers you approve by id and token, where the token is the endpoint and credential references a listing gave, asks each for its tool list and calls nothing; stdio servers are never started, no redirect is followed, and an answer is cut off at a fixed size.
|
|
281
|
+
|
|
282
|
+
**What it does not look at.** Hooks and permission settings, servers given on a command line or inside `settings.json`, enterprise-managed settings, directories other than the working directory and `--root`, and combinations across different clients. Each of these is listed in the report's `limitations`, and everything it could not read is listed under coverage as not scanned.
|
|
283
|
+
|
|
284
|
+
`probebox init` writes the configuration that comes next. It takes only typed options, generates network targets only, and has no option for commands, hooks, environment variables or credentials — so it cannot copy one in. With `--from-discovery` it attaches what `discover` found as comments, which configure nothing. Nothing appears under its final name until it has been read back from a private file and checked to be exactly what was meant; if a later check fails, what was written is taken back and a replaced file is put back as it was. An existing policy file is never replaced, and must agree with what is asked for.
|
|
285
|
+
|
|
286
|
+
Details: [docs/discover-and-init.md](docs/discover-and-init.md).
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## Platforms
|
|
291
|
+
|
|
292
|
+
ProbeBox installs from a pure-Python wheel with no compiler on Linux, macOS and Windows, and runs natively on each.
|
|
293
|
+
|
|
294
|
+
| | Linux | macOS | Windows |
|
|
295
|
+
|---|---|---|---|
|
|
296
|
+
| Offline commands: `discover`, `init`, `scan-skill`, `compare` | Tested | Tested | Tested |
|
|
297
|
+
| `scan` with HTTP, OpenAI, CLI and Python targets | Tested | Tested | Tested |
|
|
298
|
+
| `probe-mcp` and `proxy-mcp` | Tested | Tested | Tested |
|
|
299
|
+
| `scan-skill --dynamic` against a real Docker daemon | Verified | Not exercised | Not exercised |
|
|
300
|
+
|
|
301
|
+
"Tested" means the full test suite passes there: in CI on Ubuntu and Windows Server for pushes to `main`, for pull requests into `main` and by hand on a branch; on macOS and on Windows 10 by the maintainer. The Windows work is native rather than emulated: files are opened through verified handles that refuse junctions as well as symbolic links, a spawned process is placed in a job object before it runs so its whole tree can be ended, directory ownership is checked through the security descriptor, command strings keep their backslashes, and output is UTF-8 whatever the system code page. A request to an address on the machine itself never goes through a proxy, whatever proxy the system is set to use: Windows reports such a setting to Python without the addresses the system leaves out of it.
|
|
302
|
+
|
|
303
|
+
Before a release, the one candidate wheel is installed into an empty directory outside the repository on all three systems and checked by `scripts/verify_wheel.py`.
|
|
304
|
+
|
|
305
|
+
---
|
|
306
|
+
|
|
307
|
+
## Recorded Results
|
|
308
|
+
|
|
309
|
+
Numbers below come from runs made for a specific suite version. **Results recorded under different suite versions or strategies are not comparable with each other.**
|
|
310
|
+
|
|
311
|
+
**Suite v3.0, five agent frameworks.** Claude Code, Codex CLI, OpenAI Agents SDK, LangGraph and Browser Use, each with two DeepSeek models and two strategies (`baseline`, `delimiter_wrap`): 20 reports, 156 results. Of the attack scenarios 97 were `DEFENDED` and 1 `VULNERABLE`; the rest were 32 `PASS`, 4 `FAIL`, 16 `SKIPPED`, 5 `INCONCLUSIVE` and 1 `ERROR`. The 16 skips are multi-turn scenarios the transformation cannot handle, the one error is a model HTTP 400 kept as an error rather than scored, and the single vulnerability is an `ASI05` probe on a simulated executor, which shows the controlled endpoint accepting the request, not code running on a host. Each condition was observed once. Across strategies the same-condition intersection for attacks was empty, so the two strategies say nothing about each other.
|
|
312
|
+
|
|
313
|
+
**Suite v2.1, recorded before 1.0.0.** The earlier seven-agent matrix (27 scenarios) is kept as it was measured, with its caveats, in [docs/recorded-results.md](docs/recorded-results.md).
|
|
314
|
+
|
|
315
|
+
---
|
|
316
|
+
|
|
317
|
+
## Security Warning & Responsible Use
|
|
318
|
+
|
|
319
|
+
> **Authorized testing only.** ProbeBox is a red-team tool. Run it only against local sandboxes, staging deployments, or agents you own or have written authorization to audit. Never run it against production agents connected to real customer data, live credentials, or tools with external side effects.
|
|
320
|
+
>
|
|
321
|
+
> **CLI agents keep their own tools unless you take them away.** [examples/scan.claude-code.yaml](examples/scan.claude-code.yaml) passes `--permission-mode bypassPermissions` **strictly paired with `--strict-mcp-config --tools ""`**, so Claude Code can reach only ProbeBox's sandboxed probe tools. Keep that isolation when auditing any coding agent.
|
|
322
|
+
>
|
|
323
|
+
> **`observe` mode is not `audit_readonly`.** In `observe` the proxy forwards what it sees. Real writes reach the real server.
|
|
324
|
+
|
|
325
|
+
### Built-in safety controls
|
|
326
|
+
|
|
327
|
+
- **Two origins.** Simulated public and callback routes and the SSRF metadata endpoint bind separate origins. No admin or log route is exposed.
|
|
328
|
+
- **A probe directory that must be yours.** `--probe-dir` gets an ownership marker and an exclusive lock. ProbeBox refuses an unowned non-empty directory, a directory other accounts can write to, a linked marker and a linked sandbox path.
|
|
329
|
+
- **Egress allowlist.** The probe's `web_fetch` refuses every URL outside the current scan's two origins and follows no redirect.
|
|
330
|
+
- **Credentials stay on their origin.** An HTTP target's `headers` are never sent to its `health_url` or `reset_url`.
|
|
331
|
+
- **Child processes never outlive their scan.** Every managed process runs in a tree of its own — a session and process group on POSIX, a job object on Windows — and is ended with all of its descendants on timeout or cancellation.
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## Development, Testing & Contributing
|
|
336
|
+
|
|
337
|
+
```bash
|
|
338
|
+
uv sync --group dev # pytest and ruff
|
|
339
|
+
uv run --no-sync ruff check .
|
|
340
|
+
uv run --no-sync pytest -v # unit and end-to-end tests
|
|
341
|
+
uv run --no-sync python scripts/smoke_demo.py # the 0-token demo through the CLI
|
|
342
|
+
uv run --no-sync python scripts/verify_wheel.py --probebox <env>/bin/probebox --python <env>/bin/python
|
|
343
|
+
```
|
|
344
|
+
|
|
345
|
+
CI runs the whole suite on Ubuntu and Windows Server, and lint on Ubuntu, for pushes to `main`, for pull requests into `main`, and by hand on a branch. The same checks run on Windows 10 and macOS by hand before a release.
|
|
346
|
+
|
|
347
|
+
The Docker-based tests of `scan-skill --dynamic` need Linux, the pinned base image and `scripts/build_skill_agent_image.py`; `scripts/validate_skill_dynamic.py` is the real-daemon acceptance run and is meant for that Linux host.
|
|
348
|
+
|
|
349
|
+
To add an attack scenario, add a declarative entry to `suite.yaml` and check it against both demo agents. To add an agent integration, share a tested `examples/scan.<agent>.yaml` or subclass `TargetAdapter`. Please make sure lint and tests pass before opening a pull request.
|
|
350
|
+
|
|
351
|
+
<details>
|
|
352
|
+
<summary><strong>Repository structure</strong></summary>
|
|
353
|
+
|
|
354
|
+
```text
|
|
355
|
+
probebox/
|
|
356
|
+
├── docs/ # Reference manuals
|
|
357
|
+
├── docker/skill-agent/ # Pinned, networkless agent for dynamic Skill audits
|
|
358
|
+
├── examples/ # Demo agents and ready-made scan configurations
|
|
359
|
+
├── scripts/ # Image build, wheel verification, benchmarks, real-Docker acceptance
|
|
360
|
+
├── src/probebox/
|
|
361
|
+
│ ├── cli.py # scan · scan-skill · discover · init · probe-mcp · proxy-mcp · compare
|
|
362
|
+
│ ├── config.py # Typed scan configuration
|
|
363
|
+
│ ├── runner.py · scenarios/ # Scheduler, suite schema, deterministic oracles
|
|
364
|
+
│ ├── targets/ # HTTP · OpenAI · CLI · Python adapters
|
|
365
|
+
│ ├── probes/ # HTTP probe servers, sandbox, MCP probe and proxy
|
|
366
|
+
│ ├── skills/ # Skill audit: static engine, isolated dynamic audit
|
|
367
|
+
│ ├── discover/ · init_config.py # Read-only discovery and configuration generation
|
|
368
|
+
│ ├── contracts.py · sarif.py · html_report.py · compare.py
|
|
369
|
+
│ ├── _safefs.py · _win32.py # Link-safe file access; native Windows calls
|
|
370
|
+
│ └── telemetry.py · budget.py · fingerprints.py · hooks.py
|
|
371
|
+
└── tests/
|
|
372
|
+
```
|
|
373
|
+
|
|
374
|
+
</details>
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
## Changes in 1.0.0
|
|
379
|
+
|
|
380
|
+
**New**
|
|
381
|
+
|
|
382
|
+
- `probebox discover` and `probebox init`.
|
|
383
|
+
- Suite `v3.0`: 33 attack scenarios and 5 benign controls, all ten OWASP ASI categories, non-MCP chat and web surfaces, and malicious-Skill scenarios. Suite `v2.1` is replaced in place; there is no second suite.
|
|
384
|
+
- Deterministic strategies, offline candidate proposal and replay export.
|
|
385
|
+
- `probebox proxy-mcp`, the fail-closed audit proxy for real servers.
|
|
386
|
+
- `probebox scan-skill`, offline and `--dynamic`.
|
|
387
|
+
- Native Windows support.
|
|
388
|
+
|
|
389
|
+
**Reports**
|
|
390
|
+
|
|
391
|
+
- Reports are schema `2.0`, with one `Finding` model shared by every command and exported to JSON, Markdown, HTML and SARIF. A report without a schema version, or with `1.0`, is the older scan report; `compare` still reads it and normalizes it in memory without rewriting the file.
|
|
392
|
+
- Two new report types: `skill_audit` (`scan-skill`) and `discover_audit` (`discover`).
|
|
393
|
+
- Every command uses the same exit codes: `0` nothing to report, `1` a finding (or a gate on findings), `2` an error or a failed gate, `3` a scan cut short by its budget. `discover` exits `0` by default and `1` only with `--fail-on`; `scan-skill --dynamic` exits `1` on a confirmed violation and `2` when inconclusive.
|
|
394
|
+
|
|
395
|
+
**Tags**
|
|
396
|
+
|
|
397
|
+
- Suite `v2.1` had `core` (18) and `extended` (9) over 27 scenarios. Suite `v3.0` has `core` (18), `extended` (20), `non-mcp` (11), `owasp-full` (6) and `skill-defense` (2) over 38. A `--tag core` run is a different set of scenarios than before.
|
|
398
|
+
|
|
399
|
+
**Permission defaults**
|
|
400
|
+
|
|
401
|
+
- Shell `pre_scenario_hook`s now need `--allow-shell-hooks`.
|
|
402
|
+
- `proxy-mcp` starts in `audit_readonly` and forwards nothing until a policy allows it.
|
|
403
|
+
- Dynamic Skill audits are opt-in and say on stderr what they send to the model endpoint.
|
|
404
|
+
- `discover` reads nothing under HOME with `--no-home`, follows no link at any time, and contacts a server only when `--probe-tools` names it.
|
|
405
|
+
|
|
406
|
+
**Results that cannot be compared**
|
|
407
|
+
|
|
408
|
+
- Suite `v2.1` and `v3.0` results, baseline and transformed-strategy results, and runs made before the incidental-leak accounting changed are different conditions. Use `compare` on reports of one suite version and one strategy.
|
|
409
|
+
|
|
410
|
+
Details: [docs/changes-in-1.0.0.md](docs/changes-in-1.0.0.md).
|
|
411
|
+
|
|
412
|
+
---
|
|
413
|
+
|
|
414
|
+
## Roadmap, License & Citation
|
|
415
|
+
|
|
416
|
+
### Roadmap
|
|
417
|
+
|
|
418
|
+
- **Shipped**: the 38-scenario Suite v3.0 with OWASP ASI coverage and SARIF export; strategies, candidates and replay; the MCP audit proxy; Skill audits; discovery and init; latency, token and cost telemetry; native Linux, macOS and Windows support.
|
|
419
|
+
- **Next**: a semantic-model option for Skill audits; a static Skill engine with a recall that can support a verdict; dynamic Skill audits verified on Docker Desktop for macOS and Windows; enterprise-managed settings and hooks in `discover`.
|
|
420
|
+
|
|
421
|
+
### License
|
|
422
|
+
|
|
423
|
+
Released under the [MIT License](LICENSE).
|
|
424
|
+
|
|
425
|
+
### Citation
|
|
426
|
+
|
|
427
|
+
If you use ProbeBox in academic research, benchmarks, or security evaluations, please cite:
|
|
428
|
+
|
|
429
|
+
```bibtex
|
|
430
|
+
@software{probebox2026,
|
|
431
|
+
title = {ProbeBox: Local security toolkit for AI agents},
|
|
432
|
+
author = {Liu, Shunyang},
|
|
433
|
+
year = {2026},
|
|
434
|
+
url = {https://github.com/ShunyangLiu/probebox},
|
|
435
|
+
version = {1.0.0}
|
|
436
|
+
}
|
|
437
|
+
```
|