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.
Files changed (140) hide show
  1. mcpwarden_gate-1.1.0/LICENSE +21 -0
  2. mcpwarden_gate-1.1.0/PKG-INFO +378 -0
  3. mcpwarden_gate-1.1.0/README.md +348 -0
  4. mcpwarden_gate-1.1.0/pyproject.toml +48 -0
  5. mcpwarden_gate-1.1.0/setup.cfg +4 -0
  6. mcpwarden_gate-1.1.0/src/mcpwarden_gate/__init__.py +11 -0
  7. mcpwarden_gate-1.1.0/src/mcpwarden_gate/__main__.py +1595 -0
  8. mcpwarden_gate-1.1.0/src/mcpwarden_gate/anchor.py +357 -0
  9. mcpwarden_gate-1.1.0/src/mcpwarden_gate/approval.py +77 -0
  10. mcpwarden_gate-1.1.0/src/mcpwarden_gate/approve.py +298 -0
  11. mcpwarden_gate-1.1.0/src/mcpwarden_gate/audit.py +276 -0
  12. mcpwarden_gate-1.1.0/src/mcpwarden_gate/audit_export.py +123 -0
  13. mcpwarden_gate-1.1.0/src/mcpwarden_gate/catalog/__init__.py +1 -0
  14. mcpwarden_gate-1.1.0/src/mcpwarden_gate/cli_help.py +186 -0
  15. mcpwarden_gate-1.1.0/src/mcpwarden_gate/cloud_auth.py +312 -0
  16. mcpwarden_gate-1.1.0/src/mcpwarden_gate/compat.py +120 -0
  17. mcpwarden_gate-1.1.0/src/mcpwarden_gate/compliance.py +218 -0
  18. mcpwarden_gate-1.1.0/src/mcpwarden_gate/config.py +775 -0
  19. mcpwarden_gate-1.1.0/src/mcpwarden_gate/evidence.py +767 -0
  20. mcpwarden_gate-1.1.0/src/mcpwarden_gate/explain.py +622 -0
  21. mcpwarden_gate-1.1.0/src/mcpwarden_gate/gateway.py +1484 -0
  22. mcpwarden_gate-1.1.0/src/mcpwarden_gate/hook.py +174 -0
  23. mcpwarden_gate-1.1.0/src/mcpwarden_gate/http_server.py +747 -0
  24. mcpwarden_gate-1.1.0/src/mcpwarden_gate/http_upstream.py +403 -0
  25. mcpwarden_gate-1.1.0/src/mcpwarden_gate/inbox.py +837 -0
  26. mcpwarden_gate-1.1.0/src/mcpwarden_gate/init_wizard.py +128 -0
  27. mcpwarden_gate-1.1.0/src/mcpwarden_gate/install_client.py +324 -0
  28. mcpwarden_gate-1.1.0/src/mcpwarden_gate/logmodel.py +666 -0
  29. mcpwarden_gate-1.1.0/src/mcpwarden_gate/logstats.py +547 -0
  30. mcpwarden_gate-1.1.0/src/mcpwarden_gate/logtail.py +896 -0
  31. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage.py +1869 -0
  32. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_check.py +146 -0
  33. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_cli.py +278 -0
  34. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_edit.py +420 -0
  35. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_grammar.py +84 -0
  36. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_lexer.py +602 -0
  37. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_log.py +227 -0
  38. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_model.py +116 -0
  39. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_oracle.py +53 -0
  40. mcpwarden_gate-1.1.0/src/mcpwarden_gate/manage_types.py +93 -0
  41. mcpwarden_gate-1.1.0/src/mcpwarden_gate/oauth.py +462 -0
  42. mcpwarden_gate-1.1.0/src/mcpwarden_gate/oauth_client.py +315 -0
  43. mcpwarden_gate-1.1.0/src/mcpwarden_gate/onboarding.py +422 -0
  44. mcpwarden_gate-1.1.0/src/mcpwarden_gate/pinning.py +258 -0
  45. mcpwarden_gate-1.1.0/src/mcpwarden_gate/policy.py +245 -0
  46. mcpwarden_gate-1.1.0/src/mcpwarden_gate/policydiff.py +602 -0
  47. mcpwarden_gate-1.1.0/src/mcpwarden_gate/policygen.py +192 -0
  48. mcpwarden_gate-1.1.0/src/mcpwarden_gate/probe.py +283 -0
  49. mcpwarden_gate-1.1.0/src/mcpwarden_gate/public_suffixes.txt +277 -0
  50. mcpwarden_gate-1.1.0/src/mcpwarden_gate/quota.py +163 -0
  51. mcpwarden_gate-1.1.0/src/mcpwarden_gate/report.py +715 -0
  52. mcpwarden_gate-1.1.0/src/mcpwarden_gate/sandbox.py +250 -0
  53. mcpwarden_gate-1.1.0/src/mcpwarden_gate/sanitize.py +541 -0
  54. mcpwarden_gate-1.1.0/src/mcpwarden_gate/scan.py +1958 -0
  55. mcpwarden_gate-1.1.0/src/mcpwarden_gate/secret.py +113 -0
  56. mcpwarden_gate-1.1.0/src/mcpwarden_gate/stdio.py +293 -0
  57. mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/PKG-INFO +378 -0
  58. mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/SOURCES.txt +138 -0
  59. mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/dependency_links.txt +1 -0
  60. mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/entry_points.txt +2 -0
  61. mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/requires.txt +7 -0
  62. mcpwarden_gate-1.1.0/src/mcpwarden_gate.egg-info/top_level.txt +1 -0
  63. mcpwarden_gate-1.1.0/tests/test_approve.py +57 -0
  64. mcpwarden_gate-1.1.0/tests/test_audit_v2.py +922 -0
  65. mcpwarden_gate-1.1.0/tests/test_audit_v2_builder.py +142 -0
  66. mcpwarden_gate-1.1.0/tests/test_audit_v2_review.py +632 -0
  67. mcpwarden_gate-1.1.0/tests/test_b10_hook.py +427 -0
  68. mcpwarden_gate-1.1.0/tests/test_b1_http_upstream.py +724 -0
  69. mcpwarden_gate-1.1.0/tests/test_b2_http_server.py +585 -0
  70. mcpwarden_gate-1.1.0/tests/test_b3_oauth.py +685 -0
  71. mcpwarden_gate-1.1.0/tests/test_b4_cloud_auth.py +720 -0
  72. mcpwarden_gate-1.1.0/tests/test_b4_logging.py +342 -0
  73. mcpwarden_gate-1.1.0/tests/test_b4_prompts.py +296 -0
  74. mcpwarden_gate-1.1.0/tests/test_b4_resources.py +375 -0
  75. mcpwarden_gate-1.1.0/tests/test_b5_sandbox.py +354 -0
  76. mcpwarden_gate-1.1.0/tests/test_b5_sandbox_macos_real.py +163 -0
  77. mcpwarden_gate-1.1.0/tests/test_b8_sampling_roots.py +531 -0
  78. mcpwarden_gate-1.1.0/tests/test_base_review.py +1139 -0
  79. mcpwarden_gate-1.1.0/tests/test_cli_help.py +87 -0
  80. mcpwarden_gate-1.1.0/tests/test_compliance.py +308 -0
  81. mcpwarden_gate-1.1.0/tests/test_d2_anchor.py +784 -0
  82. mcpwarden_gate-1.1.0/tests/test_datalayer_review.py +878 -0
  83. mcpwarden_gate-1.1.0/tests/test_derive_evidence.py +93 -0
  84. mcpwarden_gate-1.1.0/tests/test_diff_explain_builder.py +277 -0
  85. mcpwarden_gate-1.1.0/tests/test_end_to_end.py +62 -0
  86. mcpwarden_gate-1.1.0/tests/test_explain.py +1471 -0
  87. mcpwarden_gate-1.1.0/tests/test_flow_marker.py +587 -0
  88. mcpwarden_gate-1.1.0/tests/test_g1_spec_check.py +952 -0
  89. mcpwarden_gate-1.1.0/tests/test_g2_spec_check.py +270 -0
  90. mcpwarden_gate-1.1.0/tests/test_g3_spec_check.py +491 -0
  91. mcpwarden_gate-1.1.0/tests/test_g4_spec_check.py +365 -0
  92. mcpwarden_gate-1.1.0/tests/test_gateway.py +109 -0
  93. mcpwarden_gate-1.1.0/tests/test_hardening_rest.py +310 -0
  94. mcpwarden_gate-1.1.0/tests/test_inbox_builder.py +399 -0
  95. mcpwarden_gate-1.1.0/tests/test_inbox_cli.py +684 -0
  96. mcpwarden_gate-1.1.0/tests/test_inbox_protocol.py +1163 -0
  97. mcpwarden_gate-1.1.0/tests/test_init_wizard.py +44 -0
  98. mcpwarden_gate-1.1.0/tests/test_install_client.py +368 -0
  99. mcpwarden_gate-1.1.0/tests/test_live_mcp_servers.py +386 -0
  100. mcpwarden_gate-1.1.0/tests/test_logmodel.py +1279 -0
  101. mcpwarden_gate-1.1.0/tests/test_logmodel_builder.py +291 -0
  102. mcpwarden_gate-1.1.0/tests/test_logstats.py +941 -0
  103. mcpwarden_gate-1.1.0/tests/test_logstats_builder.py +225 -0
  104. mcpwarden_gate-1.1.0/tests/test_logtail.py +1238 -0
  105. mcpwarden_gate-1.1.0/tests/test_m2a_builder_smoke.py +291 -0
  106. mcpwarden_gate-1.1.0/tests/test_manage_apply.py +701 -0
  107. mcpwarden_gate-1.1.0/tests/test_manage_cli.py +282 -0
  108. mcpwarden_gate-1.1.0/tests/test_manage_editor.py +740 -0
  109. mcpwarden_gate-1.1.0/tests/test_manage_escalation.py +369 -0
  110. mcpwarden_gate-1.1.0/tests/test_manage_integration.py +55 -0
  111. mcpwarden_gate-1.1.0/tests/test_manage_interface.py +350 -0
  112. mcpwarden_gate-1.1.0/tests/test_manage_log.py +683 -0
  113. mcpwarden_gate-1.1.0/tests/test_manage_ops.py +486 -0
  114. mcpwarden_gate-1.1.0/tests/test_manage_proposal.py +674 -0
  115. mcpwarden_gate-1.1.0/tests/test_oauth_client.py +558 -0
  116. mcpwarden_gate-1.1.0/tests/test_oauth_flow.py +36 -0
  117. mcpwarden_gate-1.1.0/tests/test_onboarding_add.py +351 -0
  118. mcpwarden_gate-1.1.0/tests/test_onboarding_init.py +266 -0
  119. mcpwarden_gate-1.1.0/tests/test_onboarding_update.py +384 -0
  120. mcpwarden_gate-1.1.0/tests/test_path_args.py +260 -0
  121. mcpwarden_gate-1.1.0/tests/test_pinning_and_approval.py +76 -0
  122. mcpwarden_gate-1.1.0/tests/test_policy.py +163 -0
  123. mcpwarden_gate-1.1.0/tests/test_policydiff.py +1358 -0
  124. mcpwarden_gate-1.1.0/tests/test_probe.py +49 -0
  125. mcpwarden_gate-1.1.0/tests/test_probe_config.py +95 -0
  126. mcpwarden_gate-1.1.0/tests/test_rename.py +70 -0
  127. mcpwarden_gate-1.1.0/tests/test_report.py +1093 -0
  128. mcpwarden_gate-1.1.0/tests/test_report_builder.py +278 -0
  129. mcpwarden_gate-1.1.0/tests/test_report_review.py +578 -0
  130. mcpwarden_gate-1.1.0/tests/test_review4b_core.py +255 -0
  131. mcpwarden_gate-1.1.0/tests/test_review5a.py +769 -0
  132. mcpwarden_gate-1.1.0/tests/test_review5b.py +786 -0
  133. mcpwarden_gate-1.1.0/tests/test_review_ui2_core.py +156 -0
  134. mcpwarden_gate-1.1.0/tests/test_sandbox.py +213 -0
  135. mcpwarden_gate-1.1.0/tests/test_scan.py +2424 -0
  136. mcpwarden_gate-1.1.0/tests/test_scan_builder.py +128 -0
  137. mcpwarden_gate-1.1.0/tests/test_scan_review.py +696 -0
  138. mcpwarden_gate-1.1.0/tests/test_sdk_interop.py +115 -0
  139. mcpwarden_gate-1.1.0/tests/test_secret_redaction.py +177 -0
  140. 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
+ ![Overview — dark mode](docs/e2e/screenshots/02-overview-dark.png)
141
+ ![Overview — light mode](docs/e2e/screenshots/01-overview-light.png)
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
+ ![Live feed](docs/e2e/screenshots/03-live.png)
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
+ ![Sessions](docs/e2e/screenshots/04-sessions.png)
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
+ ![Session detail — pinning triggered](docs/e2e/screenshots/05-session-detail-pinning.png)
185
+ ![Session detail — session reviewed](docs/e2e/screenshots/06-session-detail-reviewed.png)
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
+ ![Blocks](docs/e2e/screenshots/07-blocks.png)
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
+ ![Egress targets](docs/e2e/screenshots/08-egress.png)
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
+ ![Approvals](docs/e2e/screenshots/13-inbox-run-approvals.png)
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
+ ![Quarantine](docs/e2e/screenshots/09-quarantine.png)
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
+ ![Policy](docs/e2e/screenshots/10-policy.png)
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
+ ![Inbox — overview with pending approval](docs/e2e/screenshots/12-inbox-run-overview.png)
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)