mcpwarden-gate 1.1.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.
- mcpwarden_gate-1.1.0/LICENSE +21 -0
- mcpwarden_gate-1.1.0/PKG-INFO +378 -0
- mcpwarden_gate-1.1.0/README.md +348 -0
- mcpwarden_gate-1.1.0/pyproject.toml +48 -0
- mcpwarden_gate-1.1.0/setup.cfg +4 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/__init__.py +11 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/__main__.py +1595 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/anchor.py +357 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/approval.py +77 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/approve.py +298 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/audit.py +276 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/audit_export.py +123 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/catalog/__init__.py +1 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/cli_help.py +186 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/cloud_auth.py +312 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/compat.py +120 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/compliance.py +218 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/config.py +775 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/evidence.py +767 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/explain.py +622 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/gateway.py +1484 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/hook.py +174 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/http_server.py +747 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/http_upstream.py +403 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/inbox.py +837 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/init_wizard.py +128 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/install_client.py +324 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/logmodel.py +666 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/logstats.py +547 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/logtail.py +896 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage.py +1869 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_check.py +146 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_cli.py +278 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_edit.py +420 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_grammar.py +84 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_lexer.py +602 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_log.py +227 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_model.py +116 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_oracle.py +53 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_types.py +93 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/oauth.py +462 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/oauth_client.py +315 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/onboarding.py +422 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/pinning.py +258 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/policy.py +245 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/policydiff.py +602 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/policygen.py +192 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/probe.py +283 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/public_suffixes.txt +277 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/quota.py +163 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/report.py +715 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/sandbox.py +250 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/sanitize.py +541 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/scan.py +1958 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/secret.py +113 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate/stdio.py +293 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/PKG-INFO +378 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/SOURCES.txt +138 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/dependency_links.txt +1 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/entry_points.txt +2 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/requires.txt +7 -0
- mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/top_level.txt +1 -0
- mcpwarden_gate-1.1.0/tests/test_approve.py +57 -0
- mcpwarden_gate-1.1.0/tests/test_audit_v2.py +922 -0
- mcpwarden_gate-1.1.0/tests/test_audit_v2_builder.py +142 -0
- mcpwarden_gate-1.1.0/tests/test_audit_v2_review.py +632 -0
- mcpwarden_gate-1.1.0/tests/test_b10_hook.py +427 -0
- mcpwarden_gate-1.1.0/tests/test_b1_http_upstream.py +724 -0
- mcpwarden_gate-1.1.0/tests/test_b2_http_server.py +585 -0
- mcpwarden_gate-1.1.0/tests/test_b3_oauth.py +685 -0
- mcpwarden_gate-1.1.0/tests/test_b4_cloud_auth.py +720 -0
- mcpwarden_gate-1.1.0/tests/test_b4_logging.py +342 -0
- mcpwarden_gate-1.1.0/tests/test_b4_prompts.py +296 -0
- mcpwarden_gate-1.1.0/tests/test_b4_resources.py +375 -0
- mcpwarden_gate-1.1.0/tests/test_b5_sandbox.py +354 -0
- mcpwarden_gate-1.1.0/tests/test_b5_sandbox_macos_real.py +163 -0
- mcpwarden_gate-1.1.0/tests/test_b8_sampling_roots.py +531 -0
- mcpwarden_gate-1.1.0/tests/test_base_review.py +1139 -0
- mcpwarden_gate-1.1.0/tests/test_cli_help.py +87 -0
- mcpwarden_gate-1.1.0/tests/test_compliance.py +308 -0
- mcpwarden_gate-1.1.0/tests/test_d2_anchor.py +784 -0
- mcpwarden_gate-1.1.0/tests/test_datalayer_review.py +878 -0
- mcpwarden_gate-1.1.0/tests/test_derive_evidence.py +93 -0
- mcpwarden_gate-1.1.0/tests/test_diff_explain_builder.py +277 -0
- mcpwarden_gate-1.1.0/tests/test_end_to_end.py +62 -0
- mcpwarden_gate-1.1.0/tests/test_explain.py +1471 -0
- mcpwarden_gate-1.1.0/tests/test_flow_marker.py +587 -0
- mcpwarden_gate-1.1.0/tests/test_g1_spec_check.py +952 -0
- mcpwarden_gate-1.1.0/tests/test_g2_spec_check.py +270 -0
- mcpwarden_gate-1.1.0/tests/test_g3_spec_check.py +491 -0
- mcpwarden_gate-1.1.0/tests/test_g4_spec_check.py +365 -0
- mcpwarden_gate-1.1.0/tests/test_gateway.py +109 -0
- mcpwarden_gate-1.1.0/tests/test_hardening_rest.py +310 -0
- mcpwarden_gate-1.1.0/tests/test_inbox_builder.py +399 -0
- mcpwarden_gate-1.1.0/tests/test_inbox_cli.py +684 -0
- mcpwarden_gate-1.1.0/tests/test_inbox_protocol.py +1163 -0
- mcpwarden_gate-1.1.0/tests/test_init_wizard.py +44 -0
- mcpwarden_gate-1.1.0/tests/test_install_client.py +368 -0
- mcpwarden_gate-1.1.0/tests/test_live_mcp_servers.py +386 -0
- mcpwarden_gate-1.1.0/tests/test_logmodel.py +1279 -0
- mcpwarden_gate-1.1.0/tests/test_logmodel_builder.py +291 -0
- mcpwarden_gate-1.1.0/tests/test_logstats.py +941 -0
- mcpwarden_gate-1.1.0/tests/test_logstats_builder.py +225 -0
- mcpwarden_gate-1.1.0/tests/test_logtail.py +1238 -0
- mcpwarden_gate-1.1.0/tests/test_m2a_builder_smoke.py +291 -0
- mcpwarden_gate-1.1.0/tests/test_manage_apply.py +701 -0
- mcpwarden_gate-1.1.0/tests/test_manage_cli.py +282 -0
- mcpwarden_gate-1.1.0/tests/test_manage_editor.py +740 -0
- mcpwarden_gate-1.1.0/tests/test_manage_escalation.py +369 -0
- mcpwarden_gate-1.1.0/tests/test_manage_integration.py +55 -0
- mcpwarden_gate-1.1.0/tests/test_manage_interface.py +350 -0
- mcpwarden_gate-1.1.0/tests/test_manage_log.py +683 -0
- mcpwarden_gate-1.1.0/tests/test_manage_ops.py +486 -0
- mcpwarden_gate-1.1.0/tests/test_manage_proposal.py +674 -0
- mcpwarden_gate-1.1.0/tests/test_oauth_client.py +558 -0
- mcpwarden_gate-1.1.0/tests/test_oauth_flow.py +36 -0
- mcpwarden_gate-1.1.0/tests/test_onboarding_add.py +351 -0
- mcpwarden_gate-1.1.0/tests/test_onboarding_init.py +266 -0
- mcpwarden_gate-1.1.0/tests/test_onboarding_update.py +384 -0
- mcpwarden_gate-1.1.0/tests/test_path_args.py +260 -0
- mcpwarden_gate-1.1.0/tests/test_pinning_and_approval.py +76 -0
- mcpwarden_gate-1.1.0/tests/test_policy.py +163 -0
- mcpwarden_gate-1.1.0/tests/test_policydiff.py +1358 -0
- mcpwarden_gate-1.1.0/tests/test_probe.py +49 -0
- mcpwarden_gate-1.1.0/tests/test_probe_config.py +95 -0
- mcpwarden_gate-1.1.0/tests/test_rename.py +70 -0
- mcpwarden_gate-1.1.0/tests/test_report.py +1093 -0
- mcpwarden_gate-1.1.0/tests/test_report_builder.py +278 -0
- mcpwarden_gate-1.1.0/tests/test_report_review.py +578 -0
- mcpwarden_gate-1.1.0/tests/test_review4b_core.py +255 -0
- mcpwarden_gate-1.1.0/tests/test_review5a.py +769 -0
- mcpwarden_gate-1.1.0/tests/test_review5b.py +786 -0
- mcpwarden_gate-1.1.0/tests/test_review_ui2_core.py +156 -0
- mcpwarden_gate-1.1.0/tests/test_sandbox.py +213 -0
- mcpwarden_gate-1.1.0/tests/test_scan.py +2424 -0
- mcpwarden_gate-1.1.0/tests/test_scan_builder.py +128 -0
- mcpwarden_gate-1.1.0/tests/test_scan_review.py +696 -0
- mcpwarden_gate-1.1.0/tests/test_sdk_interop.py +115 -0
- mcpwarden_gate-1.1.0/tests/test_secret_redaction.py +177 -0
- mcpwarden_gate-1.1.0/tests/test_tech_debt.py +155 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Tim Gelzleichter, A+43 Studios
|
|
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.
|
|
@@ -0,0 +1,378 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: mcpwarden-gate
|
|
3
|
+
Version: 1.1.0
|
|
4
|
+
Summary: Policy gateway for the Model Context Protocol: tool pinning, least privilege, egress allowlist, Rule of Two, approvals, and audit log.
|
|
5
|
+
Author: Tim Gelzleichter, A+43 Studios
|
|
6
|
+
License: MIT
|
|
7
|
+
Project-URL: Homepage, https://www.a043.xyz
|
|
8
|
+
Project-URL: Source, https://github.com/A043-studios/mcp-policy-gateway
|
|
9
|
+
Project-URL: Documentation, https://www.a043.xyz/mcpwarden
|
|
10
|
+
Keywords: mcp,security,gateway,ai-safety,policy
|
|
11
|
+
Classifier: Development Status :: 4 - Beta
|
|
12
|
+
Classifier: Intended Audience :: Developers
|
|
13
|
+
Classifier: Intended Audience :: System Administrators
|
|
14
|
+
Classifier: Topic :: Security
|
|
15
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: HTTP Servers
|
|
16
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
17
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
18
|
+
Classifier: Programming Language :: Python :: 3
|
|
19
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
20
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE
|
|
24
|
+
Provides-Extra: dev
|
|
25
|
+
Requires-Dist: pytest>=8; extra == "dev"
|
|
26
|
+
Requires-Dist: mcp>=2; extra == "dev"
|
|
27
|
+
Provides-Extra: ui
|
|
28
|
+
Requires-Dist: mcpwarden-ui; extra == "ui"
|
|
29
|
+
Dynamic: license-file
|
|
30
|
+
|
|
31
|
+
# mcpwarden-gate
|
|
32
|
+
|
|
33
|
+
**A policy gateway for the Model Context Protocol.** It sits between your AI client (Claude Desktop, Cursor, VS Code, your own agent) and the MCP servers it uses, and decides every tool call. The model proposes. The gateway decides.
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
AI Client ──stdio──▶ mcpwarden-gate ──stdio──▶ mail server
|
|
37
|
+
│ ──stdio──▶ file server
|
|
38
|
+
│ ──stdio──▶ weather server
|
|
39
|
+
gateway.toml
|
|
40
|
+
mcp.lock.json
|
|
41
|
+
audit.jsonl
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Companion code to the **"Notes on agentic AI security"** working-paper series by [A+43 Studios](https://www.a043.xyz). MIT licence.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## What it stops
|
|
49
|
+
|
|
50
|
+
| Control | What it blocks |
|
|
51
|
+
|---|---|
|
|
52
|
+
| **Pinning** | A changed tool description (rug pull), a new tool or a swapped start command is quarantined until a human reviews and re-locks it. The model only sees the pinned definition — never a live, possibly-poisoned one. |
|
|
53
|
+
| **Least privilege** | Each task runs under a profile. Tools outside it are neither shown to the model nor callable — the model cannot even ask for them. |
|
|
54
|
+
| **Egress allowlist** | Recipients and URLs in arguments must point to allowed domains. Encoded forms, backslash variants, `//host`, scheme-less URLs and hidden fields like `bcc`, `reply_to`, `host` are all checked. Arguments outside the reviewed schema are refused. |
|
|
55
|
+
| **Flow rules (taint)** | Tracks untrusted input (U) and private data (D). Sending data out after U+D, or changing state after U, requires a human approval. |
|
|
56
|
+
| **Approvals** | Raised through MCP elicitation or the local inbox (`--inbox`). The prompt names recipients and hosts before the arguments — a long argument cannot push them out of view. The decision is signed, call-bound, and single-use. |
|
|
57
|
+
| **Sanitising** | Strips hidden HTML, invisible characters, scripts and off-screen elements from tool results. |
|
|
58
|
+
| **Outbound filter** | Removes markdown and HTML images and links to foreign hosts from results (the rendering-exfiltration channel). |
|
|
59
|
+
| **Audit + circuit breaker** | Every decision in `audit.jsonl` with a hash chain. Call budgets per session and per tool; the session is locked after too many rejections. |
|
|
60
|
+
|
|
61
|
+
**Demo result** — directly connected, a gullible agent sends 4 emails to the attacker (3 with secrets), deletes 4 and leaks an image. Behind the gateway: 0 emails, 0 deleted, no leak, task completed.
|
|
62
|
+
|
|
63
|
+
---
|
|
64
|
+
|
|
65
|
+
## Install
|
|
66
|
+
|
|
67
|
+
**From PyPI (recommended):**
|
|
68
|
+
|
|
69
|
+
```bash
|
|
70
|
+
pip install mcpwarden-gate # gateway only
|
|
71
|
+
pip install "mcpwarden-gate[ui]" # gateway + dashboard (mcpwarden-ui + mcpwarden-mcp)
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
**From source:**
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
git clone https://github.com/A043-studios/mcpwarden-gate.git
|
|
78
|
+
cd mcpwarden-gate
|
|
79
|
+
pip install -e . # Python 3.11+, no runtime dependencies
|
|
80
|
+
pip install -e ui/ # dashboard (mcpwarden-ui + mcpwarden-mcp)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
---
|
|
84
|
+
|
|
85
|
+
## Get started in 3 steps
|
|
86
|
+
|
|
87
|
+
**Step 1 — Initialise** (reads your existing client configs, writes `gateway.toml`):
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
mcpwarden-gate init
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Step 2 — Add a server** (starts it once in quarantine, shows its tools, locks them on your approval):
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
mcpwarden-gate add myserver
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
**Step 3 — Point your AI client at the gateway**
|
|
100
|
+
|
|
101
|
+
Add this to your MCP client config. `--profile` controls which tools the AI is allowed to call (defined in `gateway.toml`).
|
|
102
|
+
|
|
103
|
+
**Claude Desktop** — edit `claude_desktop_config.json`:
|
|
104
|
+
- macOS: `~/Library/Application Support/Claude/claude_desktop_config.json`
|
|
105
|
+
- Windows: `%APPDATA%\Claude\claude_desktop_config.json`
|
|
106
|
+
- Linux: `~/.config/Claude/claude_desktop_config.json`
|
|
107
|
+
|
|
108
|
+
```json
|
|
109
|
+
{
|
|
110
|
+
"mcpServers": {
|
|
111
|
+
"gateway": {
|
|
112
|
+
"command": "mcpwarden-gate",
|
|
113
|
+
"args": ["run", "--policy", "/path/to/gateway.toml", "--profile", "default"]
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
**VS Code / Cursor** — see [docs/Integrations.md](docs/Integrations.md) for IDE-specific snippets.
|
|
120
|
+
|
|
121
|
+
After any server update: `mcpwarden-gate update myserver` — it shows what changed and asks before locking the new state.
|
|
122
|
+
|
|
123
|
+
---
|
|
124
|
+
|
|
125
|
+
## Dashboard
|
|
126
|
+
|
|
127
|
+
```bash
|
|
128
|
+
mcpwarden-ui --policy gateway.toml # read-only dashboard
|
|
129
|
+
mcpwarden-ui --policy gateway.toml --inbox # + live approvals inbox
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Opens at `http://127.0.0.1:8421` with a bearer-token link. No data leaves your machine.
|
|
133
|
+
|
|
134
|
+
---
|
|
135
|
+
|
|
136
|
+
### 1 · Übersicht (Overview)
|
|
137
|
+
|
|
138
|
+
The landing page: session counts, call timeline, top tools by call volume, egress targets, the most recent sessions with their label strip, and the last label events.
|
|
139
|
+
|
|
140
|
+

|
|
141
|
+

|
|
142
|
+
|
|
143
|
+
**What you see:**
|
|
144
|
+
- **Sessions** — how many ran and how many are still active
|
|
145
|
+
- **Aufrufe / Blockiert / Gefragt / Aktiv** — total calls, blocks, approval requests, active sessions at a glance
|
|
146
|
+
- **Aufrufe über die Zeit** — stacked area chart: allowed / blocked / approval-requested / unknown / stamp
|
|
147
|
+
- **Blockierungen nach Kontrolle** — donut chart: which controls blocked how many calls
|
|
148
|
+
- **Top-Tools** — horizontal bar: the busiest tools this run
|
|
149
|
+
- **Ziele** — egress hosts seen, with allowlist status
|
|
150
|
+
- **Letzte Sessions** — sortable table linking to individual session timelines
|
|
151
|
+
- **Label-Verlauf** — when taint labels (U, D, E) entered or left each session
|
|
152
|
+
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
### 2 · Live feed
|
|
156
|
+
|
|
157
|
+
Real-time stream of every gateway decision as it happens. Pause/resume, search by session or tool, label badges on each row.
|
|
158
|
+
|
|
159
|
+

|
|
160
|
+
|
|
161
|
+
**Each row shows:**
|
|
162
|
+
- Timestamp and session ID (clickable → session detail)
|
|
163
|
+
- Tool called, arguments summary
|
|
164
|
+
- Decision: `erlaubt` / `blockiert` / `gefragt` / `gestempelt` / `unbekannt`
|
|
165
|
+
- The control that triggered the decision (e.g. `egress_allowlist`, `pinning`, `integrity`)
|
|
166
|
+
- Current label state: U (untrusted input), D (private data), E (egress seen)
|
|
167
|
+
|
|
168
|
+
---
|
|
169
|
+
|
|
170
|
+
### 3 · Sessions
|
|
171
|
+
|
|
172
|
+
All sessions in one sortable, searchable table. Click any session ID to open its full timeline.
|
|
173
|
+
|
|
174
|
+

|
|
175
|
+
|
|
176
|
+
**Columns:** Session ID · State (running / ended) · Start · End · Profile · Events · Calls · Blocked · Asked (approvals) · Stamped
|
|
177
|
+
|
|
178
|
+
---
|
|
179
|
+
|
|
180
|
+
### 4 · Session Detail — Timeline
|
|
181
|
+
|
|
182
|
+
Every event of one session in chronological order. The label strip at the top shows when taint labels arrived. The flow-status panel explains whether the session's information-flow rules were satisfied.
|
|
183
|
+
|
|
184
|
+

|
|
185
|
+

|
|
186
|
+
|
|
187
|
+
**What you see per row:**
|
|
188
|
+
- Relative timestamp from session start
|
|
189
|
+
- Session and sequence number
|
|
190
|
+
- Tool name and decision badge (colour-coded)
|
|
191
|
+
- Control that decided it, with the exact reason from the audit log
|
|
192
|
+
- Label change: which labels were on this call (U, D, E) and after which labels are set
|
|
193
|
+
- Flow-rule evaluation icon per call
|
|
194
|
+
|
|
195
|
+
---
|
|
196
|
+
|
|
197
|
+
### 5 · Blockierungen (Blocks)
|
|
198
|
+
|
|
199
|
+
Summary view: for each control, how many calls it blocked, which tools, and the exact reasons — verbatim from the audit log.
|
|
200
|
+
|
|
201
|
+

|
|
202
|
+
|
|
203
|
+
**Columns:** Control · Count · Tools · Reasons (with occurrence counts)
|
|
204
|
+
|
|
205
|
+
Useful for diagnosing over-tight policies: if `least_privilege` blocks a tool you expected to allow, the reason column tells you exactly which profile was active and which tool was missing from its allowlist.
|
|
206
|
+
|
|
207
|
+
---
|
|
208
|
+
|
|
209
|
+
### 6 · Ziele (Egress targets)
|
|
210
|
+
|
|
211
|
+
All hosts that appeared as destinations in tool arguments across all sessions — with allowlist status and a link to the first occurrence.
|
|
212
|
+
|
|
213
|
+

|
|
214
|
+
|
|
215
|
+
**Columns:** Host · Calls with this target · Of those forwarded · Allowlist status · First seen (session + seq)
|
|
216
|
+
|
|
217
|
+
Hosts not on the egress allowlist are highlighted in red. Click the session link to jump straight to that event.
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
### 7 · Freigaben (Approvals)
|
|
222
|
+
|
|
223
|
+
Aggregated approval statistics per control: how many were requested, how many granted by a human, how many stamped (auto-approved without review), and the grant rate.
|
|
224
|
+
|
|
225
|
+

|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
### 8 · Quarantäne
|
|
230
|
+
|
|
231
|
+
All tools and servers the gateway refused to start because their definition changed, they are new, or they have not been reviewed yet.
|
|
232
|
+
|
|
233
|
+

|
|
234
|
+
|
|
235
|
+
**Columns:** Session · Seq · Type · Server / Tool · Reason (`changed` / `new` / `not_reviewed`)
|
|
236
|
+
|
|
237
|
+
After running `mcpwarden-gate review` and locking the new state, the tool leaves quarantine in the next session.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
### 9 · Policy
|
|
242
|
+
|
|
243
|
+
Full view of the loaded `gateway.toml`: gateway settings, all controls with their current state, every server with its tools and their effect/label/path annotations, and all profiles with their allowlists.
|
|
244
|
+
|
|
245
|
+

|
|
246
|
+
|
|
247
|
+
**Sections:**
|
|
248
|
+
- **Gateway settings** — owner, egress allowlist, max calls per session, max calls per tool
|
|
249
|
+
- **Controls** — which of the 8 controls are on/off, approval mode
|
|
250
|
+
- **Servers** — per server: transport, trust level, lock status, every tool with effect annotation, labels, path_args, recipient_args, and whether it is in the profile allowlist
|
|
251
|
+
- **Profiles** — the full `allow = [...]` list of each profile
|
|
252
|
+
|
|
253
|
+
When started with `--policy`, the policy page also lets you **edit** the config: add/remove servers and profiles, toggle controls, change allowlists — all written atomically to `gateway.toml`.
|
|
254
|
+
|
|
255
|
+
---
|
|
256
|
+
|
|
257
|
+
### 10 · Inbox (Approvals — live, with `--inbox`)
|
|
258
|
+
|
|
259
|
+
When the gateway is started with `approval = "inbox"` in its policy, approval requests arrive here in real time. A human reads the structured prompt (recipient and host shown before the arguments) and clicks Grant or Deny.
|
|
260
|
+
|
|
261
|
+

|
|
262
|
+
|
|
263
|
+
Each decision is **signed, call-bound, and single-use**: a replay, a swap, a tamper, or an expiry check all fail. The decision is written to the state directory as a `.json` file — not on the MCP channel, so a prompt-injected model cannot forge it.
|
|
264
|
+
|
|
265
|
+
---
|
|
266
|
+
|
|
267
|
+
## MCP server bridge — `mcpwarden-mcp`
|
|
268
|
+
|
|
269
|
+
Lets a Claude model **control the dashboard via MCP** — read audit data, edit the policy, and decide approval requests, all through tool calls.
|
|
270
|
+
|
|
271
|
+
```
|
|
272
|
+
Claude Desktop / Claude Code
|
|
273
|
+
│ stdio
|
|
274
|
+
▼
|
|
275
|
+
mcpwarden-mcp ←─ --url http://127.0.0.1:8421 --token <token>
|
|
276
|
+
│ HTTP + Bearer
|
|
277
|
+
▼
|
|
278
|
+
mcpwarden-ui :8421
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
**Setup** in `claude_desktop_config.json`:
|
|
282
|
+
|
|
283
|
+
```json
|
|
284
|
+
{
|
|
285
|
+
"mcpServers": {
|
|
286
|
+
"mcpwarden": {
|
|
287
|
+
"command": "mcpwarden-mcp",
|
|
288
|
+
"args": ["--url", "http://127.0.0.1:8421", "--token", "<token-from-ui-startup>"]
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
The token is printed by `mcpwarden-ui` at startup in the `#t=…` fragment of the URL.
|
|
295
|
+
|
|
296
|
+
### Tools
|
|
297
|
+
|
|
298
|
+
| Group | Tool | What it does |
|
|
299
|
+
|---|---|---|
|
|
300
|
+
| **Read** | `get_health` | Dashboard health + capability flags (`config_editable`, `read_errors`) |
|
|
301
|
+
| | `get_model` | Full dashboard model: sessions, call counts, egress events |
|
|
302
|
+
| | `get_stats` | Call statistics for a time window (bucket: hour/day/week, optional profile filter) |
|
|
303
|
+
| | `get_session` | Event timeline of one session (paginated by cursor) |
|
|
304
|
+
| | `get_policy` | Current policy: servers, profiles, controls, gateway settings |
|
|
305
|
+
| | `get_clients` | AI-client routing status (Claude Desktop, Claude Code, Cursor, VS Code) |
|
|
306
|
+
| | `get_inbox` | Open approval requests (requires `--inbox`) |
|
|
307
|
+
| **Config writes** | `add_server` | Add a server block to `gateway.toml` |
|
|
308
|
+
| *(requires `--policy`)* | `delete_server` | Remove a server and all its tool policies |
|
|
309
|
+
| | `update_gateway` | Change owner, egress allowlist, max_calls, initial_labels |
|
|
310
|
+
| | `update_controls` | Toggle any of the 8 controls, set approval mode |
|
|
311
|
+
| | `add_profile` | Add a new profile |
|
|
312
|
+
| | `update_profile` | Replace a profile's allowlist |
|
|
313
|
+
| | `delete_profile` | Remove a profile |
|
|
314
|
+
| | `add_tool_policy` | Add a `[servers.S.tools.T]` block (effect, labels, path_args, …) |
|
|
315
|
+
| | `update_tool_policy` | Replace a tool policy block |
|
|
316
|
+
| **Inbox** | `decide` | Grant or deny one approval request (requires `--inbox`) |
|
|
317
|
+
|
|
318
|
+
### Resources
|
|
319
|
+
|
|
320
|
+
| URI | Content |
|
|
321
|
+
|---|---|
|
|
322
|
+
| `mcpwarden://health` | Live health and capability flags |
|
|
323
|
+
| `mcpwarden://policy` | Current policy as JSON |
|
|
324
|
+
| `mcpwarden://sessions` | Live dashboard model (sessions, egress, counts) |
|
|
325
|
+
|
|
326
|
+
### Prompts
|
|
327
|
+
|
|
328
|
+
| Name | Purpose |
|
|
329
|
+
|---|---|
|
|
330
|
+
| `audit_review` | Step-by-step audit review of one session (sid + focus area) |
|
|
331
|
+
| `security_check` | Full security posture review — controls, trust surface, egress, client coverage |
|
|
332
|
+
| `add_server_guided` | Guided dialog to add a new server: collects transport, trust, tools and effects before writing |
|
|
333
|
+
|
|
334
|
+
---
|
|
335
|
+
|
|
336
|
+
## What you can connect
|
|
337
|
+
|
|
338
|
+
| Server type | Supported |
|
|
339
|
+
|---|---|
|
|
340
|
+
| Local stdio servers (files, mail, git, databases, most npm/pip community servers) | Yes — needs a policy entry and a reviewed lock |
|
|
341
|
+
| Remote servers over Streamable HTTP/SSE (`url = "https://…"`) with a static token | Yes — configure via `http_headers` / `env_passthrough` |
|
|
342
|
+
| Tools, resources, prompts, logging through the gateway | Yes — same controls apply |
|
|
343
|
+
| Servers that require OAuth | No — static tokens only |
|
|
344
|
+
| AI clients that connect to a URL (some web-chat connectors) | No — client side is stdio only |
|
|
345
|
+
|
|
346
|
+
---
|
|
347
|
+
|
|
348
|
+
## Working-paper series
|
|
349
|
+
|
|
350
|
+
| # | Paper | Capability added |
|
|
351
|
+
|---|---|---|
|
|
352
|
+
| 2 | Who Decides (2026-02) | `mcpwarden-gate run · review · lock` |
|
|
353
|
+
| 3 | What Holds (2026-03) | `mcpwarden-gate probe`: attacks your own policy |
|
|
354
|
+
| 4 | Who Says Yes (2026-04) | `mcpwarden-gate approve`: human-readable approvals |
|
|
355
|
+
| 5 | Who Writes the Rules (2026-05) | `mcpwarden-gate derive · test · export · evidence` |
|
|
356
|
+
|
|
357
|
+
Each paper is reproducible from its release tag. See [papers/](papers/) for reproduction scripts.
|
|
358
|
+
|
|
359
|
+
---
|
|
360
|
+
|
|
361
|
+
## Layout
|
|
362
|
+
|
|
363
|
+
```
|
|
364
|
+
src/mcpwarden_gate/ gateway · policy · pinning · approval · inbox
|
|
365
|
+
sanitize · audit · config · stdio · http_upstream
|
|
366
|
+
scan · report · evidence · logmodel · logstats · __main__
|
|
367
|
+
ui/
|
|
368
|
+
src/mcpwarden_ui/ server.py (HTTP) · api.py (data) · mcp_server.py (MCP bridge)
|
|
369
|
+
frontend/ React 18 + Vite 6 + Tailwind v4 (build checked in)
|
|
370
|
+
ops/ Docker · backup · demo audit log
|
|
371
|
+
demo/ mail/files/weather servers · agent · run_demo · ablation · bench
|
|
372
|
+
tests/ policy · pinning · approvals · proxy · end-to-end · SDK interop
|
|
373
|
+
docs/ threat-model · SPEC-base-hardening · ui limits
|
|
374
|
+
```
|
|
375
|
+
|
|
376
|
+
---
|
|
377
|
+
|
|
378
|
+
MIT · Tim Gelzleichter, A+43 Studios · [a043.xyz](https://www.a043.xyz)
|