dmint 2.0.3__tar.gz → 2.0.4__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.
- {dmint-2.0.3/src/dmint.egg-info → dmint-2.0.4}/PKG-INFO +142 -25
- {dmint-2.0.3 → dmint-2.0.4}/README.md +134 -23
- {dmint-2.0.3 → dmint-2.0.4}/pyproject.toml +26 -2
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/__init__.py +33 -1
- dmint-2.0.4/src/dmint/cli/__init__.py +132 -0
- dmint-2.0.4/src/dmint/cli/__main__.py +266 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/approvals.py +197 -12
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/compile_policy.py +3 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/create_mcp_policy.py +98 -20
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/create_policy.py +198 -8
- dmint-2.0.4/src/dmint/cli/demo.py +418 -0
- dmint-2.0.4/src/dmint/cli/hooks.py +2357 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/install_skill.py +9 -4
- dmint-2.0.4/src/dmint/cli/keys.py +231 -0
- dmint-2.0.4/src/dmint/cli/logs.py +396 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/mcp_auth.py +126 -10
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/mcp_connections.py +11 -11
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/mcp_credentials.py +4 -1
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/mcp_oauth.py +167 -23
- dmint-2.0.4/src/dmint/cli/policy_digest.py +62 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/prompts/policy_skill.md +8 -1
- dmint-2.0.4/src/dmint/cli/ui.py +278 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/verify_policy.py +29 -2
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/__init__.py +19 -1
- dmint-2.0.4/src/dmint/core/audit.py +629 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/enforcement.py +231 -14
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/errors.py +3 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/policy.py +56 -11
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/resources.py +13 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/storage/__init__.py +13 -1
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/storage/base.py +10 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/storage/factory.py +15 -1
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/storage/sql.py +160 -45
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/storage/sqlite.py +80 -28
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/storage/thread_safe.py +14 -2
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/__main__.py +28 -8
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/routes.py +24 -7
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/__main__.py +7 -0
- dmint-2.0.4/src/dmint/mcp/_stdlib_mcp.py +758 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/auth.py +1 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/client.py +28 -5
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/config_loader.py +28 -2
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/gateway.py +63 -10
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/proxy.py +53 -15
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/ssrf.py +26 -5
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/skills/skill.py +12 -1
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/skills/skills/dmint-policy-manager/SKILL.md +32 -1
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/storage/__init__.py +6 -1
- dmint-2.0.4/src/dmint/templates/__init__.py +177 -0
- dmint-2.0.4/src/dmint/templates/data/aws.json +113 -0
- dmint-2.0.4/src/dmint/templates/data/claude-code.json +5018 -0
- dmint-2.0.4/src/dmint/templates/data/cline.json +5004 -0
- dmint-2.0.4/src/dmint/templates/data/codex.json +5099 -0
- dmint-2.0.4/src/dmint/templates/data/cursor.json +6288 -0
- dmint-2.0.4/src/dmint/templates/data/filesystem.json +1384 -0
- dmint-2.0.4/src/dmint/templates/data/github.json +107 -0
- dmint-2.0.4/src/dmint/templates/data/kubernetes.json +107 -0
- dmint-2.0.4/src/dmint/templates/data/opencode.json +3249 -0
- dmint-2.0.4/src/dmint/templates/data/postgres.json +83 -0
- dmint-2.0.4/src/dmint/templates/data/shell.json +663 -0
- dmint-2.0.4/src/dmint/templates/data/stripe.json +125 -0
- dmint-2.0.4/src/dmint/templates/data/windsurf.json +5005 -0
- dmint-2.0.4/src/dmint/templates/py.typed +1 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/version.py +5 -5
- {dmint-2.0.3 → dmint-2.0.4/src/dmint.egg-info}/PKG-INFO +142 -25
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint.egg-info/SOURCES.txt +22 -1
- dmint-2.0.3/src/dmint/cli/__init__.py +0 -74
- dmint-2.0.3/src/dmint/cli/__main__.py +0 -224
- dmint-2.0.3/src/dmint/cli/keys.py +0 -164
- dmint-2.0.3/src/dmint/cli/policy_digest.py +0 -37
- {dmint-2.0.3 → dmint-2.0.4}/LICENSE +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/setup.cfg +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/setup.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/approvals.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/authority.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/canonicalize.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/api.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/dashboard.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/errors.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/io_utils.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/limits.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/prompts/__init__.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/py.typed +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/cli/version.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/approvals.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/authority.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/canonicalize.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/constraints.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/hashing.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/keys.py +4 -4
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/models.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/py.typed +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/redaction.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/request_binding.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/storage/postgres_schema.sql +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/verification.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/versions.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/core/webhooks.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/__init__.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/app.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/auth.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/core_client.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/py.typed +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/static/favicon.svg +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/static/logo.svg +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/static/style.css +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/static/theme.js +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/templates/approval.html +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/templates/audit.html +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/templates/base.html +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/templates/error.html +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/templates/index.html +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/dashboard/templates/login.html +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/enforcement.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/errors.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/hashing.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/__init__.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/config.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/errors.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/mapper.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/mcp/py.typed +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/models.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/policy.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/py.typed +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/request_binding.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/skills/__init__.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/skills/manager.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/skills/py.typed +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/skills/version.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/storage/sqlite.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint/versions.py +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint.egg-info/dependency_links.txt +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint.egg-info/entry_points.txt +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint.egg-info/requires.txt +0 -0
- {dmint-2.0.3 → dmint-2.0.4}/src/dmint.egg-info/top_level.txt +0 -0
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dmint
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.4
|
|
4
4
|
Summary: Deterministic authorization and security enforcement for AI-agent tool execution
|
|
5
5
|
Author: Dmint Authors
|
|
6
6
|
License-Expression: Apache-2.0
|
|
7
|
-
|
|
7
|
+
Project-URL: Homepage, https://github.com/dmint-app/dmint
|
|
8
|
+
Project-URL: Documentation, https://docs.dmint.app
|
|
9
|
+
Project-URL: Repository, https://github.com/dmint-app/dmint
|
|
10
|
+
Project-URL: Issues, https://github.com/dmint-app/dmint/issues
|
|
11
|
+
Project-URL: Changelog, https://github.com/dmint-app/dmint/blob/main/CHANGELOG.md
|
|
12
|
+
Keywords: ai-agents,mcp,model-context-protocol,security,authorization,claude-code,codex,opencode,cursor,windsurf,cline,ed25519,rfc8785
|
|
13
|
+
Classifier: Development Status :: 4 - Beta
|
|
8
14
|
Classifier: Environment :: Console
|
|
9
15
|
Classifier: Intended Audience :: Developers
|
|
10
16
|
Classifier: Operating System :: OS Independent
|
|
@@ -132,7 +138,7 @@ Modern AI agents (Claude Code, Cursor, Antigravity, AutoGPT, custom LangChain/Ll
|
|
|
132
138
|
|
|
133
139
|
## Subsystems
|
|
134
140
|
|
|
135
|
-
`dmint` v2.0.
|
|
141
|
+
`dmint` v2.0.4 is organized as a unified monorepo providing modular packages under a single distribution:
|
|
136
142
|
|
|
137
143
|
| Module | Description | Primary Exports / Entrypoint |
|
|
138
144
|
| :--- | :--- | :--- |
|
|
@@ -173,8 +179,99 @@ pip install "dmint[all]"
|
|
|
173
179
|
|
|
174
180
|
---
|
|
175
181
|
|
|
182
|
+
## 10-Second Live Proof (Zero Configuration)
|
|
183
|
+
|
|
184
|
+
Want to see Dmint defeat 7 real-world AI agent attacks (compound shell smuggling, symlink escape, multi-file patch smuggling, Ed25519 single-use approval, post-approval parameter tampering, and replay/key forgery) right in your terminal?
|
|
185
|
+
|
|
186
|
+
```bash
|
|
187
|
+
pip install dmint
|
|
188
|
+
dmint demo
|
|
189
|
+
```
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## 60-Second Quickstart: Coding Agents (Claude Code, Codex, OpenCode, Cursor, Windsurf, Cline)
|
|
194
|
+
|
|
195
|
+
Protect built-in shell commands (`Bash`, `exec_command`, `run_commands`), file edits (`Read`, `Write`, `Edit`, `apply_patch`), and MCP tools across all 6 major AI coding harnesses with one command:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
# Generates .dmint/ keys (0600), dedicated per-harness policies (.dmint/policies/<harness>.policy.json), and hooks:
|
|
199
|
+
dmint init --harness all
|
|
200
|
+
|
|
201
|
+
# Verify cryptographic engine, keys, per-harness policies, hooks, and 4 built-in security vectors:
|
|
202
|
+
dmint doctor
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Supported harnesses out of the box (`--harness all` or comma-separated):
|
|
206
|
+
- **Claude Code** (`.claude/settings.json` `PreToolUse` hook)
|
|
207
|
+
- **OpenAI Codex CLI** (`.codex/hooks.json` & `.codex/dmint-hook.sh`)
|
|
208
|
+
- **OpenCode** (`.opencode/plugin/dmint-guard.ts` `tool.execute.before` plugin)
|
|
209
|
+
- **Cursor** (`.cursor/hooks.json`), **Windsurf** (`.windsurf/hooks.json`), **Cline / Roo Code** (`.clinerules/hooks.json`)
|
|
210
|
+
|
|
211
|
+
Test how your `policy.json` evaluates any command right from the terminal:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
dmint check -t shell.execute -r "git status" # -> ALLOW (exit 0)
|
|
215
|
+
dmint check -t shell.execute -r "git push origin main" # -> APPROVAL_REQUIRED (exit 1)
|
|
216
|
+
dmint check -t shell.execute -r "rm -rf /" # -> DENY (exit 2)
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
When an agent hits an `APPROVAL_REQUIRED` rule (like `git push origin main`), approve it once from your terminal and ask the agent to retry:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
dmint pending
|
|
223
|
+
dmint approve apr_... --by alice@company.com
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
The next retry automatically verifies the Ed25519 signature against the exact RFC 8785 canonicalized arguments and consumes the approval atomically (`APPROVED -> CONSUMED`). Editing any argument or replaying the call a second time is refused.
|
|
227
|
+
|
|
228
|
+
Inspect and verify the tamper-evident SHA-256 hash-chained audit trail of every tool call your agent made:
|
|
229
|
+
|
|
230
|
+
```bash
|
|
231
|
+
dmint logs # View color-coded audit table
|
|
232
|
+
dmint logs --denied # View only blocked (DENY) tool calls
|
|
233
|
+
dmint logs --verify # Cryptographically verify the SHA-256 hash chain
|
|
234
|
+
dmint logs --follow # Live-tail agent tool calls in real time
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
> **Zero-Friction Onboarding (Shadow Mode & Auto-Learn Policy)**: Want to observe what your coding agent does before blocking anything? Run hooks with `--mode shadow` (or `export DMINT_MODE=shadow`), then synthesize a verified least-privilege `policy.json` from your real session logs with `dmint learn-policy`.
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
176
241
|
## Quickstart: Python SDK
|
|
177
242
|
|
|
243
|
+
### Option A: Zero-Config Local Setup (`Dmint.local`)
|
|
244
|
+
|
|
245
|
+
For local agents and quick evaluation, `Dmint.local()` automatically creates `.dmint/signing.key`, `.dmint/integrity.key`, and `.dmint/approvals.sqlite3`:
|
|
246
|
+
|
|
247
|
+
```python
|
|
248
|
+
from dmint import ApprovalRequiredError, Dmint, Policy, Rule
|
|
249
|
+
|
|
250
|
+
policy = Policy(
|
|
251
|
+
[
|
|
252
|
+
Rule.allow("database", "select"),
|
|
253
|
+
Rule.approval_required("database", "update"),
|
|
254
|
+
Rule.deny("database", "drop"),
|
|
255
|
+
]
|
|
256
|
+
)
|
|
257
|
+
dmint = Dmint.local(policy)
|
|
258
|
+
|
|
259
|
+
|
|
260
|
+
@dmint.protect("database.update")
|
|
261
|
+
def update_user_role(user_id: int, role: str) -> str:
|
|
262
|
+
return f"Updated user {user_id} to {role}"
|
|
263
|
+
|
|
264
|
+
|
|
265
|
+
try:
|
|
266
|
+
update_user_role(1, "admin")
|
|
267
|
+
except ApprovalRequiredError as exc:
|
|
268
|
+
print(f"Paused for human sign-off: dmint approve {exc.approval_id}")
|
|
269
|
+
# After running `dmint approve <id>`, retry without manually passing the credential bytes:
|
|
270
|
+
# dmint.retry(update_user_role, 1, "admin")
|
|
271
|
+
```
|
|
272
|
+
|
|
273
|
+
### Option B: Explicit Production Configuration
|
|
274
|
+
|
|
178
275
|
Dmint's approval store is tamper-evident: pending records are HMAC-signed with a local integrity key, and approvals are signed with an Ed25519 key. Generate both once before running the example:
|
|
179
276
|
|
|
180
277
|
```bash
|
|
@@ -214,7 +311,7 @@ store = SQLiteApprovalStore("./approvals.sqlite3", deployment_epoch="prod-v1")
|
|
|
214
311
|
provenance = PolicyProvenance("prod-v1", policy_digest(policy), datetime.now(timezone.utc))
|
|
215
312
|
|
|
216
313
|
# 3. Initialize Dmint enforcement engine
|
|
217
|
-
|
|
314
|
+
dmint = Dmint(
|
|
218
315
|
policy=policy,
|
|
219
316
|
agent_id="data-analyst-agent",
|
|
220
317
|
context=TrustedContext({"environment": "production"}),
|
|
@@ -225,17 +322,17 @@ engine = Dmint(
|
|
|
225
322
|
|
|
226
323
|
|
|
227
324
|
# 4. Protect your tool callables with decorators
|
|
228
|
-
@
|
|
325
|
+
@dmint.protect("database.select")
|
|
229
326
|
def select_users(query: str) -> list[dict]:
|
|
230
327
|
return [{"id": 1, "username": "alice"}]
|
|
231
328
|
|
|
232
329
|
|
|
233
|
-
@
|
|
330
|
+
@dmint.protect("database.update")
|
|
234
331
|
def update_user_role(user_id: int, role: str) -> str:
|
|
235
332
|
return f"Updated user {user_id} to {role}"
|
|
236
333
|
|
|
237
334
|
|
|
238
|
-
@
|
|
335
|
+
@dmint.protect("database.drop")
|
|
239
336
|
def drop_table(table_name: str) -> str:
|
|
240
337
|
return f"Dropped {table_name}"
|
|
241
338
|
|
|
@@ -261,7 +358,7 @@ except ApprovalRequiredError as exc:
|
|
|
261
358
|
```
|
|
262
359
|
|
|
263
360
|
> [!NOTE]
|
|
264
|
-
> **Supported callable types**: `@
|
|
361
|
+
> **Supported callable types**: `@dmint.protect` supports synchronous functions (`def`), asynchronous functions (`async def`), instance methods, class methods (`@classmethod`), and static methods (`@staticmethod`). Generator and async-generator functions are not supported.
|
|
265
362
|
>
|
|
266
363
|
> **Measured Performance**: In-memory policy evaluation runs in ~3 µs; persistent storage operations (SQLite/PostgreSQL approval lifecycle) take ~2-5 ms.
|
|
267
364
|
|
|
@@ -352,19 +449,27 @@ Add Dmint MCP as a stdio server in your client configuration (e.g. `.cursor/mcp.
|
|
|
352
449
|
|
|
353
450
|
| Command | Usage | Description |
|
|
354
451
|
| :--- | :--- | :--- |
|
|
355
|
-
| `dmint
|
|
356
|
-
| `dmint
|
|
452
|
+
| `dmint init` | `dmint init --harness all` | One-command setup: generates `.dmint/` keys, per-harness policies (`.dmint/policies/*.policy.json`), and pre-tool hooks. |
|
|
453
|
+
| `dmint doctor` | `dmint doctor [--json]` | Verifies Ed25519/HMAC crypto, keys (`0600`), SQLite store, per-harness policies, hooks, and runs a 4-vector security self-test. |
|
|
454
|
+
| `dmint status` | `dmint status [--json]` | Displays installed coding-agent hooks, per-harness policy paths, and key status. |
|
|
455
|
+
| `dmint demo` | `dmint demo [--json]` | Runs a live 7-scenario red-team attack & cryptographic simulation (`dmint redteam` alias). |
|
|
456
|
+
| `dmint logs` | `dmint logs [--level WARNING] [--verify]` | Inspects, filters, tails (`-f`), exports, and verifies the SHA-256 hash-chained audit trail (`dmint audit` alias). |
|
|
457
|
+
| `dmint learn-policy` | `dmint learn-policy [-o policy.json]` | Auto-learns a verified least-privilege `policy.json` from `.dmint/audit.jsonl` (Shadow or Enforce mode). |
|
|
458
|
+
| `dmint check` | `dmint check shell.execute -r "git status"` | Simulates a tool call against `policy.json` (`ALLOW` / `APPROVAL_REQUIRED` / `DENY`) via positional `<tool.action>` or `-t`/`-a`. |
|
|
459
|
+
| `dmint hook` | `dmint hook <install\|list\|status\|run\|uninstall>` | Manages and runs pre-tool hooks for Claude Code, Codex, OpenCode, Cursor, Windsurf, and Cline. |
|
|
460
|
+
| `dmint create-policy` | `dmint create-policy [-t\|-r\|-i\|-p\|-f] -o policy.json` | Creates a verified `policy.json` via 4 modes: `--template` (`-t`), `--rule` (`-r`), `--interactive` (`-i`), or AI prompt (`-p`/`-f`). |
|
|
461
|
+
| `dmint create-mcp-policy` | `dmint create-mcp-policy --command npx ... [--offline]` | Discovers live MCP server tools, pins SHA-256 `schema_hash` digests, and writes `policy.json` + `mcp_protection.json` (offline or AI). |
|
|
357
462
|
| `dmint protect-mcp` | `dmint protect-mcp --url https://api.example.com/mcp` | Compatibility alias for `dmint create-mcp-policy` (identical options). |
|
|
358
|
-
| `dmint verify-policy` | `dmint verify-policy policy.json` | 100% offline schema and
|
|
359
|
-
| `dmint policy-digest` | `dmint policy-digest policy.json` | Computes the SHA-256 digest of the exact policy file bytes (for `DMINT_EXPECTED_POLICY_DIGEST`). |
|
|
360
|
-
| `dmint compile-policy` | `dmint compile-policy -f access.md -o policy.json` | [Compatibility] Legacy LLM
|
|
361
|
-
| `dmint pending` | `dmint pending` | Lists all approval requests currently in `PENDING` state across SQLite or PostgreSQL. |
|
|
362
|
-
| `dmint approve` | `dmint approve <id>
|
|
363
|
-
| `dmint reject` | `dmint reject <id> [--reason "..."]` | Marks a pending request as `REJECTED` with an optional audit reason. |
|
|
364
|
-
| `dmint dashboard` | `dmint dashboard --db-path ./approvals.sqlite3` | Launches the local human approval web dashboard (FastAPI). |
|
|
463
|
+
| `dmint verify-policy` | `dmint verify-policy policy.json [--json]` | 100% offline schema, capability, and invariant validation. Zero network, zero LLM. |
|
|
464
|
+
| `dmint policy-digest` | `dmint policy-digest policy.json [--json]` | Computes the SHA-256 digest of the exact policy file bytes (for `DMINT_EXPECTED_POLICY_DIGEST`). |
|
|
465
|
+
| `dmint compile-policy` | `dmint compile-policy -f access.md -o policy.json` | [Compatibility] Legacy LLM batch compiler delegating to `create-policy` non-interactive mode. |
|
|
466
|
+
| `dmint pending` | `dmint pending [--json]` | Lists all approval requests currently in `PENDING` state across SQLite or PostgreSQL. |
|
|
467
|
+
| `dmint approve` | `dmint approve <id> --by alice@company.com` | Signs and approves a pending request via Core Ed25519 primitives after policy re-verification. |
|
|
468
|
+
| `dmint reject` / `deny` | `dmint reject <id> [--reason "..."]` | Marks a pending request as `REJECTED` with an optional audit reason (`dmint deny` is an alias). |
|
|
469
|
+
| `dmint dashboard` | `dmint dashboard --db-path ./approvals.sqlite3` | Launches the local authenticated human approval web dashboard (FastAPI). |
|
|
365
470
|
| `dmint install-skill` | `dmint install-skill -y` | Installs the `dmint-policy-manager` skill into `.agents/skills/` for AI coding assistants. |
|
|
366
|
-
| `dmint init-keys` | `dmint init-keys` | Generates and persists Ed25519 signing and HMAC integrity keys (`0600`, atomic). |
|
|
367
|
-
| `dmint export-public-key` | `dmint export-public-key --
|
|
471
|
+
| `dmint init-keys` | `dmint init-keys [--dir <path>]` | Generates and persists Ed25519 signing and HMAC integrity keys (`0600`, atomic). |
|
|
472
|
+
| `dmint export-public-key` | `dmint export-public-key [--dir <path>] [--json]` | Prints the public key (hex + PEM + JSON) and issuer ID for gateway `trusted_issuers`. |
|
|
368
473
|
|
|
369
474
|
---
|
|
370
475
|
|
|
@@ -386,6 +491,17 @@ export DMINT_TEAMS_WEBHOOK_URL="https://example.webhook.office.com/webhookb2/...
|
|
|
386
491
|
> **TODO (Approver Environment)**: Because `--database-url` credentials are strictly stripped from outgoing webhook notifications to prevent credential leakage in chat channels, approvers executing `dmint approve <id>` must ensure the `DMINT_DATABASE_URL` environment variable is configured in their execution environment if using a remote PostgreSQL store.
|
|
387
492
|
|
|
388
493
|
|
|
494
|
+
---
|
|
495
|
+
|
|
496
|
+
## When to Use Dmint (and When to Pick Something Else)
|
|
497
|
+
|
|
498
|
+
| If you... | Use | Why |
|
|
499
|
+
| :--- | :--- | :--- |
|
|
500
|
+
| **Need self-hosted, Ed25519-signed, single-use human sign-off on high-risk actions in Python, MCP, or coding-agent hooks** | **Dmint** | Approvals are cryptographically bound to exact RFC 8785 arguments, usable once (`PENDING -> APPROVED -> CONSUMED`), and voided if `policy.json` changes. |
|
|
501
|
+
| Run entirely on AWS Bedrock AgentCore | AWS AgentCore Policy | Managed Cedar policy enforcement at the AWS gateway with zero infrastructure to host. |
|
|
502
|
+
| Need broad multi-language governance across Go, .NET, Java, and Rust | Microsoft Agent Governance Toolkit / Cerbos | Multi-language SDKs and centralized policy decision points (PDPs). |
|
|
503
|
+
| Need prompt-injection classification, toxicity filtering, or PII redaction | LLM Guardrails (Llama Guard, NeMo) | Dmint is a deterministic capability and argument gate—never a text classifier. |
|
|
504
|
+
|
|
389
505
|
---
|
|
390
506
|
|
|
391
507
|
## Security Invariants
|
|
@@ -416,7 +532,7 @@ For complete vulnerability reporting guidelines and threat boundaries, see [SECU
|
|
|
416
532
|
> 4. **Dashboard Token Theft**: Reading the dashboard token from configuration files or `/proc/<pid>/environ`.
|
|
417
533
|
> 5. **Client Configuration Replacement**: Overwriting `.cursor/mcp.json` or client settings to bypass `dmint-mcp` entirely and talk to unprotected tools directly.
|
|
418
534
|
>
|
|
419
|
-
> **Protection Guarantee**: Dmint's cryptographic security boundary holds **strictly when the AI agent process runs under a different OS user or in an isolated container** with no filesystem access to Dmint keys, policies, or stores. See [docs/
|
|
535
|
+
> **Protection Guarantee**: Dmint's cryptographic security boundary holds **strictly when the AI agent process runs under a different OS user or in an isolated container** with no filesystem access to Dmint keys, policies, or stores. See [**`PRODUCTION_SECURITY_GUIDE.md`**](PRODUCTION_SECURITY_GUIDE.md) and [`docs/operations/production-proof.mdx`](docs/operations/production-proof.mdx) for complete step-by-step production key separation, `chattr +i` policy locking, and 3-zone container blueprints.
|
|
420
536
|
|
|
421
537
|
---
|
|
422
538
|
|
|
@@ -506,10 +622,10 @@ python3 -m venv /tmp/dmint-test-env
|
|
|
506
622
|
source /tmp/dmint-test-env/bin/activate
|
|
507
623
|
|
|
508
624
|
# Install the wheel with all extras
|
|
509
|
-
pip install "dist/dmint-2.0.
|
|
625
|
+
pip install "dist/dmint-2.0.4-py3-none-any.whl[all]"
|
|
510
626
|
|
|
511
627
|
# 4. Verify all installed CLI entrypoints
|
|
512
|
-
dmint --version # Expected: dmint 2.0.
|
|
628
|
+
dmint --version # Expected: dmint 2.0.4
|
|
513
629
|
dmint --help # Policy wizards and verification commands
|
|
514
630
|
dmint-mcp --help # MCP multi-server gateway
|
|
515
631
|
dmint-dashboard --help # Approval web review console
|
|
@@ -567,6 +683,7 @@ npm start
|
|
|
567
683
|
- [`PLAIN.md`](PLAIN.md) — Deep architectural specification, state machine proofs, and 15-section security review checklist.
|
|
568
684
|
- [`.agents/skills/`](.agents/skills/) — AI coding agent skills for security reviews, policy authoring, and adversarial testing.
|
|
569
685
|
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — Community contribution guidelines, Conventional Commits format, and PR process.
|
|
686
|
+
- [`PRODUCTION_SECURITY_GUIDE.md`](PRODUCTION_SECURITY_GUIDE.md) — Complete production proof, Ed25519 private/public key placement, HMAC integrity keys, and 3-zone deployment blueprints.
|
|
570
687
|
- [`SECURITY.md`](SECURITY.md) — Security policy, threat boundary definitions, and vulnerability reporting.
|
|
571
688
|
|
|
572
689
|
---
|
|
@@ -577,9 +694,9 @@ Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)** a
|
|
|
577
694
|
|
|
578
695
|
| Change severity | SemVer bump | Typical changes |
|
|
579
696
|
|---|---|---|
|
|
580
|
-
| **High / Major** | `2.0.
|
|
581
|
-
| **Medium / Minor** | `2.0.
|
|
582
|
-
| **Low / Patch** | `2.0.
|
|
697
|
+
| **High / Major** | `2.0.4` → `3.0.0` | Incompatible API changes, breaking policy schema modifications, removed public methods. |
|
|
698
|
+
| **Medium / Minor** | `2.0.4` → `2.1.0` | Backwards-compatible features, new CLI flags, new integrations. |
|
|
699
|
+
| **Low / Patch** | `2.0.4` → `2.0.5` | Bug fixes, security hardening, documentation updates, test additions, non-breaking refactors. |
|
|
583
700
|
|
|
584
701
|
Every push must include the appropriate version decision and bump. A push carrying any Major change is Major; otherwise any Minor change makes it Minor; otherwise it is Patch. When severity is ambiguous, choose the higher severity and ask before a Major bump.
|
|
585
702
|
|
|
@@ -76,7 +76,7 @@ Modern AI agents (Claude Code, Cursor, Antigravity, AutoGPT, custom LangChain/Ll
|
|
|
76
76
|
|
|
77
77
|
## Subsystems
|
|
78
78
|
|
|
79
|
-
`dmint` v2.0.
|
|
79
|
+
`dmint` v2.0.4 is organized as a unified monorepo providing modular packages under a single distribution:
|
|
80
80
|
|
|
81
81
|
| Module | Description | Primary Exports / Entrypoint |
|
|
82
82
|
| :--- | :--- | :--- |
|
|
@@ -117,8 +117,99 @@ pip install "dmint[all]"
|
|
|
117
117
|
|
|
118
118
|
---
|
|
119
119
|
|
|
120
|
+
## 10-Second Live Proof (Zero Configuration)
|
|
121
|
+
|
|
122
|
+
Want to see Dmint defeat 7 real-world AI agent attacks (compound shell smuggling, symlink escape, multi-file patch smuggling, Ed25519 single-use approval, post-approval parameter tampering, and replay/key forgery) right in your terminal?
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
pip install dmint
|
|
126
|
+
dmint demo
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
---
|
|
130
|
+
|
|
131
|
+
## 60-Second Quickstart: Coding Agents (Claude Code, Codex, OpenCode, Cursor, Windsurf, Cline)
|
|
132
|
+
|
|
133
|
+
Protect built-in shell commands (`Bash`, `exec_command`, `run_commands`), file edits (`Read`, `Write`, `Edit`, `apply_patch`), and MCP tools across all 6 major AI coding harnesses with one command:
|
|
134
|
+
|
|
135
|
+
```bash
|
|
136
|
+
# Generates .dmint/ keys (0600), dedicated per-harness policies (.dmint/policies/<harness>.policy.json), and hooks:
|
|
137
|
+
dmint init --harness all
|
|
138
|
+
|
|
139
|
+
# Verify cryptographic engine, keys, per-harness policies, hooks, and 4 built-in security vectors:
|
|
140
|
+
dmint doctor
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Supported harnesses out of the box (`--harness all` or comma-separated):
|
|
144
|
+
- **Claude Code** (`.claude/settings.json` `PreToolUse` hook)
|
|
145
|
+
- **OpenAI Codex CLI** (`.codex/hooks.json` & `.codex/dmint-hook.sh`)
|
|
146
|
+
- **OpenCode** (`.opencode/plugin/dmint-guard.ts` `tool.execute.before` plugin)
|
|
147
|
+
- **Cursor** (`.cursor/hooks.json`), **Windsurf** (`.windsurf/hooks.json`), **Cline / Roo Code** (`.clinerules/hooks.json`)
|
|
148
|
+
|
|
149
|
+
Test how your `policy.json` evaluates any command right from the terminal:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
dmint check -t shell.execute -r "git status" # -> ALLOW (exit 0)
|
|
153
|
+
dmint check -t shell.execute -r "git push origin main" # -> APPROVAL_REQUIRED (exit 1)
|
|
154
|
+
dmint check -t shell.execute -r "rm -rf /" # -> DENY (exit 2)
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
When an agent hits an `APPROVAL_REQUIRED` rule (like `git push origin main`), approve it once from your terminal and ask the agent to retry:
|
|
158
|
+
|
|
159
|
+
```bash
|
|
160
|
+
dmint pending
|
|
161
|
+
dmint approve apr_... --by alice@company.com
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
The next retry automatically verifies the Ed25519 signature against the exact RFC 8785 canonicalized arguments and consumes the approval atomically (`APPROVED -> CONSUMED`). Editing any argument or replaying the call a second time is refused.
|
|
165
|
+
|
|
166
|
+
Inspect and verify the tamper-evident SHA-256 hash-chained audit trail of every tool call your agent made:
|
|
167
|
+
|
|
168
|
+
```bash
|
|
169
|
+
dmint logs # View color-coded audit table
|
|
170
|
+
dmint logs --denied # View only blocked (DENY) tool calls
|
|
171
|
+
dmint logs --verify # Cryptographically verify the SHA-256 hash chain
|
|
172
|
+
dmint logs --follow # Live-tail agent tool calls in real time
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
> **Zero-Friction Onboarding (Shadow Mode & Auto-Learn Policy)**: Want to observe what your coding agent does before blocking anything? Run hooks with `--mode shadow` (or `export DMINT_MODE=shadow`), then synthesize a verified least-privilege `policy.json` from your real session logs with `dmint learn-policy`.
|
|
176
|
+
|
|
177
|
+
---
|
|
178
|
+
|
|
120
179
|
## Quickstart: Python SDK
|
|
121
180
|
|
|
181
|
+
### Option A: Zero-Config Local Setup (`Dmint.local`)
|
|
182
|
+
|
|
183
|
+
For local agents and quick evaluation, `Dmint.local()` automatically creates `.dmint/signing.key`, `.dmint/integrity.key`, and `.dmint/approvals.sqlite3`:
|
|
184
|
+
|
|
185
|
+
```python
|
|
186
|
+
from dmint import ApprovalRequiredError, Dmint, Policy, Rule
|
|
187
|
+
|
|
188
|
+
policy = Policy(
|
|
189
|
+
[
|
|
190
|
+
Rule.allow("database", "select"),
|
|
191
|
+
Rule.approval_required("database", "update"),
|
|
192
|
+
Rule.deny("database", "drop"),
|
|
193
|
+
]
|
|
194
|
+
)
|
|
195
|
+
dmint = Dmint.local(policy)
|
|
196
|
+
|
|
197
|
+
|
|
198
|
+
@dmint.protect("database.update")
|
|
199
|
+
def update_user_role(user_id: int, role: str) -> str:
|
|
200
|
+
return f"Updated user {user_id} to {role}"
|
|
201
|
+
|
|
202
|
+
|
|
203
|
+
try:
|
|
204
|
+
update_user_role(1, "admin")
|
|
205
|
+
except ApprovalRequiredError as exc:
|
|
206
|
+
print(f"Paused for human sign-off: dmint approve {exc.approval_id}")
|
|
207
|
+
# After running `dmint approve <id>`, retry without manually passing the credential bytes:
|
|
208
|
+
# dmint.retry(update_user_role, 1, "admin")
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
### Option B: Explicit Production Configuration
|
|
212
|
+
|
|
122
213
|
Dmint's approval store is tamper-evident: pending records are HMAC-signed with a local integrity key, and approvals are signed with an Ed25519 key. Generate both once before running the example:
|
|
123
214
|
|
|
124
215
|
```bash
|
|
@@ -158,7 +249,7 @@ store = SQLiteApprovalStore("./approvals.sqlite3", deployment_epoch="prod-v1")
|
|
|
158
249
|
provenance = PolicyProvenance("prod-v1", policy_digest(policy), datetime.now(timezone.utc))
|
|
159
250
|
|
|
160
251
|
# 3. Initialize Dmint enforcement engine
|
|
161
|
-
|
|
252
|
+
dmint = Dmint(
|
|
162
253
|
policy=policy,
|
|
163
254
|
agent_id="data-analyst-agent",
|
|
164
255
|
context=TrustedContext({"environment": "production"}),
|
|
@@ -169,17 +260,17 @@ engine = Dmint(
|
|
|
169
260
|
|
|
170
261
|
|
|
171
262
|
# 4. Protect your tool callables with decorators
|
|
172
|
-
@
|
|
263
|
+
@dmint.protect("database.select")
|
|
173
264
|
def select_users(query: str) -> list[dict]:
|
|
174
265
|
return [{"id": 1, "username": "alice"}]
|
|
175
266
|
|
|
176
267
|
|
|
177
|
-
@
|
|
268
|
+
@dmint.protect("database.update")
|
|
178
269
|
def update_user_role(user_id: int, role: str) -> str:
|
|
179
270
|
return f"Updated user {user_id} to {role}"
|
|
180
271
|
|
|
181
272
|
|
|
182
|
-
@
|
|
273
|
+
@dmint.protect("database.drop")
|
|
183
274
|
def drop_table(table_name: str) -> str:
|
|
184
275
|
return f"Dropped {table_name}"
|
|
185
276
|
|
|
@@ -205,7 +296,7 @@ except ApprovalRequiredError as exc:
|
|
|
205
296
|
```
|
|
206
297
|
|
|
207
298
|
> [!NOTE]
|
|
208
|
-
> **Supported callable types**: `@
|
|
299
|
+
> **Supported callable types**: `@dmint.protect` supports synchronous functions (`def`), asynchronous functions (`async def`), instance methods, class methods (`@classmethod`), and static methods (`@staticmethod`). Generator and async-generator functions are not supported.
|
|
209
300
|
>
|
|
210
301
|
> **Measured Performance**: In-memory policy evaluation runs in ~3 µs; persistent storage operations (SQLite/PostgreSQL approval lifecycle) take ~2-5 ms.
|
|
211
302
|
|
|
@@ -296,19 +387,27 @@ Add Dmint MCP as a stdio server in your client configuration (e.g. `.cursor/mcp.
|
|
|
296
387
|
|
|
297
388
|
| Command | Usage | Description |
|
|
298
389
|
| :--- | :--- | :--- |
|
|
299
|
-
| `dmint
|
|
300
|
-
| `dmint
|
|
390
|
+
| `dmint init` | `dmint init --harness all` | One-command setup: generates `.dmint/` keys, per-harness policies (`.dmint/policies/*.policy.json`), and pre-tool hooks. |
|
|
391
|
+
| `dmint doctor` | `dmint doctor [--json]` | Verifies Ed25519/HMAC crypto, keys (`0600`), SQLite store, per-harness policies, hooks, and runs a 4-vector security self-test. |
|
|
392
|
+
| `dmint status` | `dmint status [--json]` | Displays installed coding-agent hooks, per-harness policy paths, and key status. |
|
|
393
|
+
| `dmint demo` | `dmint demo [--json]` | Runs a live 7-scenario red-team attack & cryptographic simulation (`dmint redteam` alias). |
|
|
394
|
+
| `dmint logs` | `dmint logs [--level WARNING] [--verify]` | Inspects, filters, tails (`-f`), exports, and verifies the SHA-256 hash-chained audit trail (`dmint audit` alias). |
|
|
395
|
+
| `dmint learn-policy` | `dmint learn-policy [-o policy.json]` | Auto-learns a verified least-privilege `policy.json` from `.dmint/audit.jsonl` (Shadow or Enforce mode). |
|
|
396
|
+
| `dmint check` | `dmint check shell.execute -r "git status"` | Simulates a tool call against `policy.json` (`ALLOW` / `APPROVAL_REQUIRED` / `DENY`) via positional `<tool.action>` or `-t`/`-a`. |
|
|
397
|
+
| `dmint hook` | `dmint hook <install\|list\|status\|run\|uninstall>` | Manages and runs pre-tool hooks for Claude Code, Codex, OpenCode, Cursor, Windsurf, and Cline. |
|
|
398
|
+
| `dmint create-policy` | `dmint create-policy [-t\|-r\|-i\|-p\|-f] -o policy.json` | Creates a verified `policy.json` via 4 modes: `--template` (`-t`), `--rule` (`-r`), `--interactive` (`-i`), or AI prompt (`-p`/`-f`). |
|
|
399
|
+
| `dmint create-mcp-policy` | `dmint create-mcp-policy --command npx ... [--offline]` | Discovers live MCP server tools, pins SHA-256 `schema_hash` digests, and writes `policy.json` + `mcp_protection.json` (offline or AI). |
|
|
301
400
|
| `dmint protect-mcp` | `dmint protect-mcp --url https://api.example.com/mcp` | Compatibility alias for `dmint create-mcp-policy` (identical options). |
|
|
302
|
-
| `dmint verify-policy` | `dmint verify-policy policy.json` | 100% offline schema and
|
|
303
|
-
| `dmint policy-digest` | `dmint policy-digest policy.json` | Computes the SHA-256 digest of the exact policy file bytes (for `DMINT_EXPECTED_POLICY_DIGEST`). |
|
|
304
|
-
| `dmint compile-policy` | `dmint compile-policy -f access.md -o policy.json` | [Compatibility] Legacy LLM
|
|
305
|
-
| `dmint pending` | `dmint pending` | Lists all approval requests currently in `PENDING` state across SQLite or PostgreSQL. |
|
|
306
|
-
| `dmint approve` | `dmint approve <id>
|
|
307
|
-
| `dmint reject` | `dmint reject <id> [--reason "..."]` | Marks a pending request as `REJECTED` with an optional audit reason. |
|
|
308
|
-
| `dmint dashboard` | `dmint dashboard --db-path ./approvals.sqlite3` | Launches the local human approval web dashboard (FastAPI). |
|
|
401
|
+
| `dmint verify-policy` | `dmint verify-policy policy.json [--json]` | 100% offline schema, capability, and invariant validation. Zero network, zero LLM. |
|
|
402
|
+
| `dmint policy-digest` | `dmint policy-digest policy.json [--json]` | Computes the SHA-256 digest of the exact policy file bytes (for `DMINT_EXPECTED_POLICY_DIGEST`). |
|
|
403
|
+
| `dmint compile-policy` | `dmint compile-policy -f access.md -o policy.json` | [Compatibility] Legacy LLM batch compiler delegating to `create-policy` non-interactive mode. |
|
|
404
|
+
| `dmint pending` | `dmint pending [--json]` | Lists all approval requests currently in `PENDING` state across SQLite or PostgreSQL. |
|
|
405
|
+
| `dmint approve` | `dmint approve <id> --by alice@company.com` | Signs and approves a pending request via Core Ed25519 primitives after policy re-verification. |
|
|
406
|
+
| `dmint reject` / `deny` | `dmint reject <id> [--reason "..."]` | Marks a pending request as `REJECTED` with an optional audit reason (`dmint deny` is an alias). |
|
|
407
|
+
| `dmint dashboard` | `dmint dashboard --db-path ./approvals.sqlite3` | Launches the local authenticated human approval web dashboard (FastAPI). |
|
|
309
408
|
| `dmint install-skill` | `dmint install-skill -y` | Installs the `dmint-policy-manager` skill into `.agents/skills/` for AI coding assistants. |
|
|
310
|
-
| `dmint init-keys` | `dmint init-keys` | Generates and persists Ed25519 signing and HMAC integrity keys (`0600`, atomic). |
|
|
311
|
-
| `dmint export-public-key` | `dmint export-public-key --
|
|
409
|
+
| `dmint init-keys` | `dmint init-keys [--dir <path>]` | Generates and persists Ed25519 signing and HMAC integrity keys (`0600`, atomic). |
|
|
410
|
+
| `dmint export-public-key` | `dmint export-public-key [--dir <path>] [--json]` | Prints the public key (hex + PEM + JSON) and issuer ID for gateway `trusted_issuers`. |
|
|
312
411
|
|
|
313
412
|
---
|
|
314
413
|
|
|
@@ -330,6 +429,17 @@ export DMINT_TEAMS_WEBHOOK_URL="https://example.webhook.office.com/webhookb2/...
|
|
|
330
429
|
> **TODO (Approver Environment)**: Because `--database-url` credentials are strictly stripped from outgoing webhook notifications to prevent credential leakage in chat channels, approvers executing `dmint approve <id>` must ensure the `DMINT_DATABASE_URL` environment variable is configured in their execution environment if using a remote PostgreSQL store.
|
|
331
430
|
|
|
332
431
|
|
|
432
|
+
---
|
|
433
|
+
|
|
434
|
+
## When to Use Dmint (and When to Pick Something Else)
|
|
435
|
+
|
|
436
|
+
| If you... | Use | Why |
|
|
437
|
+
| :--- | :--- | :--- |
|
|
438
|
+
| **Need self-hosted, Ed25519-signed, single-use human sign-off on high-risk actions in Python, MCP, or coding-agent hooks** | **Dmint** | Approvals are cryptographically bound to exact RFC 8785 arguments, usable once (`PENDING -> APPROVED -> CONSUMED`), and voided if `policy.json` changes. |
|
|
439
|
+
| Run entirely on AWS Bedrock AgentCore | AWS AgentCore Policy | Managed Cedar policy enforcement at the AWS gateway with zero infrastructure to host. |
|
|
440
|
+
| Need broad multi-language governance across Go, .NET, Java, and Rust | Microsoft Agent Governance Toolkit / Cerbos | Multi-language SDKs and centralized policy decision points (PDPs). |
|
|
441
|
+
| Need prompt-injection classification, toxicity filtering, or PII redaction | LLM Guardrails (Llama Guard, NeMo) | Dmint is a deterministic capability and argument gate—never a text classifier. |
|
|
442
|
+
|
|
333
443
|
---
|
|
334
444
|
|
|
335
445
|
## Security Invariants
|
|
@@ -360,7 +470,7 @@ For complete vulnerability reporting guidelines and threat boundaries, see [SECU
|
|
|
360
470
|
> 4. **Dashboard Token Theft**: Reading the dashboard token from configuration files or `/proc/<pid>/environ`.
|
|
361
471
|
> 5. **Client Configuration Replacement**: Overwriting `.cursor/mcp.json` or client settings to bypass `dmint-mcp` entirely and talk to unprotected tools directly.
|
|
362
472
|
>
|
|
363
|
-
> **Protection Guarantee**: Dmint's cryptographic security boundary holds **strictly when the AI agent process runs under a different OS user or in an isolated container** with no filesystem access to Dmint keys, policies, or stores. See [docs/
|
|
473
|
+
> **Protection Guarantee**: Dmint's cryptographic security boundary holds **strictly when the AI agent process runs under a different OS user or in an isolated container** with no filesystem access to Dmint keys, policies, or stores. See [**`PRODUCTION_SECURITY_GUIDE.md`**](PRODUCTION_SECURITY_GUIDE.md) and [`docs/operations/production-proof.mdx`](docs/operations/production-proof.mdx) for complete step-by-step production key separation, `chattr +i` policy locking, and 3-zone container blueprints.
|
|
364
474
|
|
|
365
475
|
---
|
|
366
476
|
|
|
@@ -450,10 +560,10 @@ python3 -m venv /tmp/dmint-test-env
|
|
|
450
560
|
source /tmp/dmint-test-env/bin/activate
|
|
451
561
|
|
|
452
562
|
# Install the wheel with all extras
|
|
453
|
-
pip install "dist/dmint-2.0.
|
|
563
|
+
pip install "dist/dmint-2.0.4-py3-none-any.whl[all]"
|
|
454
564
|
|
|
455
565
|
# 4. Verify all installed CLI entrypoints
|
|
456
|
-
dmint --version # Expected: dmint 2.0.
|
|
566
|
+
dmint --version # Expected: dmint 2.0.4
|
|
457
567
|
dmint --help # Policy wizards and verification commands
|
|
458
568
|
dmint-mcp --help # MCP multi-server gateway
|
|
459
569
|
dmint-dashboard --help # Approval web review console
|
|
@@ -511,6 +621,7 @@ npm start
|
|
|
511
621
|
- [`PLAIN.md`](PLAIN.md) — Deep architectural specification, state machine proofs, and 15-section security review checklist.
|
|
512
622
|
- [`.agents/skills/`](.agents/skills/) — AI coding agent skills for security reviews, policy authoring, and adversarial testing.
|
|
513
623
|
- [`CONTRIBUTING.md`](CONTRIBUTING.md) — Community contribution guidelines, Conventional Commits format, and PR process.
|
|
624
|
+
- [`PRODUCTION_SECURITY_GUIDE.md`](PRODUCTION_SECURITY_GUIDE.md) — Complete production proof, Ed25519 private/public key placement, HMAC integrity keys, and 3-zone deployment blueprints.
|
|
514
625
|
- [`SECURITY.md`](SECURITY.md) — Security policy, threat boundary definitions, and vulnerability reporting.
|
|
515
626
|
|
|
516
627
|
---
|
|
@@ -521,9 +632,9 @@ Dmint adheres strictly to **[Semantic Versioning 2.0.0](https://semver.org/)** a
|
|
|
521
632
|
|
|
522
633
|
| Change severity | SemVer bump | Typical changes |
|
|
523
634
|
|---|---|---|
|
|
524
|
-
| **High / Major** | `2.0.
|
|
525
|
-
| **Medium / Minor** | `2.0.
|
|
526
|
-
| **Low / Patch** | `2.0.
|
|
635
|
+
| **High / Major** | `2.0.4` → `3.0.0` | Incompatible API changes, breaking policy schema modifications, removed public methods. |
|
|
636
|
+
| **Medium / Minor** | `2.0.4` → `2.1.0` | Backwards-compatible features, new CLI flags, new integrations. |
|
|
637
|
+
| **Low / Patch** | `2.0.4` → `2.0.5` | Bug fixes, security hardening, documentation updates, test additions, non-breaking refactors. |
|
|
527
638
|
|
|
528
639
|
Every push must include the appropriate version decision and bump. A push carrying any Major change is Major; otherwise any Minor change makes it Minor; otherwise it is Patch. When severity is ambiguous, choose the higher severity and ask before a Major bump.
|
|
529
640
|
|
|
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "dmint"
|
|
7
|
-
version = "2.0.
|
|
7
|
+
version = "2.0.4"
|
|
8
8
|
description = "Deterministic authorization and security enforcement for AI-agent tool execution"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache-2.0"
|
|
@@ -12,8 +12,23 @@ requires-python = ">=3.10"
|
|
|
12
12
|
authors = [
|
|
13
13
|
{ name = "Dmint Authors" }
|
|
14
14
|
]
|
|
15
|
+
keywords = [
|
|
16
|
+
"ai-agents",
|
|
17
|
+
"mcp",
|
|
18
|
+
"model-context-protocol",
|
|
19
|
+
"security",
|
|
20
|
+
"authorization",
|
|
21
|
+
"claude-code",
|
|
22
|
+
"codex",
|
|
23
|
+
"opencode",
|
|
24
|
+
"cursor",
|
|
25
|
+
"windsurf",
|
|
26
|
+
"cline",
|
|
27
|
+
"ed25519",
|
|
28
|
+
"rfc8785",
|
|
29
|
+
]
|
|
15
30
|
classifiers = [
|
|
16
|
-
"Development Status ::
|
|
31
|
+
"Development Status :: 4 - Beta",
|
|
17
32
|
"Environment :: Console",
|
|
18
33
|
"Intended Audience :: Developers",
|
|
19
34
|
"Operating System :: OS Independent",
|
|
@@ -70,6 +85,14 @@ test = [
|
|
|
70
85
|
"dmint[all]",
|
|
71
86
|
]
|
|
72
87
|
|
|
88
|
+
|
|
89
|
+
[project.urls]
|
|
90
|
+
Homepage = "https://github.com/dmint-app/dmint"
|
|
91
|
+
Documentation = "https://docs.dmint.app"
|
|
92
|
+
Repository = "https://github.com/dmint-app/dmint"
|
|
93
|
+
Issues = "https://github.com/dmint-app/dmint/issues"
|
|
94
|
+
Changelog = "https://github.com/dmint-app/dmint/blob/main/CHANGELOG.md"
|
|
95
|
+
|
|
73
96
|
[project.scripts]
|
|
74
97
|
dmint = "dmint.cli.__main__:main"
|
|
75
98
|
dmint-mcp = "dmint.mcp.__main__:main"
|
|
@@ -85,6 +108,7 @@ where = ["src"]
|
|
|
85
108
|
"dmint.mcp" = ["py.typed"]
|
|
86
109
|
"dmint.dashboard" = ["py.typed", "templates/**/*.html", "static/**/*"]
|
|
87
110
|
"dmint.skills" = ["py.typed", "skills/**/*.md", "skills/*.md"]
|
|
111
|
+
"dmint.templates" = ["py.typed", "data/*.json"]
|
|
88
112
|
|
|
89
113
|
[tool.ruff]
|
|
90
114
|
line-length = 120
|
|
@@ -71,7 +71,6 @@ from .core import (
|
|
|
71
71
|
normalize_url,
|
|
72
72
|
Rule,
|
|
73
73
|
ApprovalStore,
|
|
74
|
-
SQLAlchemyApprovalStore,
|
|
75
74
|
SQLiteApprovalStore,
|
|
76
75
|
ThreadSafeApprovalStore,
|
|
77
76
|
create_approval_store,
|
|
@@ -80,6 +79,16 @@ from .core import (
|
|
|
80
79
|
UnknownApprovalStateError,
|
|
81
80
|
UnknownApprovalVersionError,
|
|
82
81
|
VerifiedApproval,
|
|
82
|
+
public_key_from_hex,
|
|
83
|
+
public_key_from_pem,
|
|
84
|
+
public_key_hex,
|
|
85
|
+
public_key_pem,
|
|
86
|
+
AuditLogger,
|
|
87
|
+
AuditVerificationResult,
|
|
88
|
+
parse_log_level,
|
|
89
|
+
read_audit_entries,
|
|
90
|
+
summarize_audit_entries,
|
|
91
|
+
verify_audit_chain,
|
|
83
92
|
WebhookConfig,
|
|
84
93
|
WebhookNotifier,
|
|
85
94
|
build_discord_payload,
|
|
@@ -120,6 +129,10 @@ def __getattr__(name: str) -> Any:
|
|
|
120
129
|
globals()[name] = mod
|
|
121
130
|
sys.modules.setdefault(f"dmint_{name}", mod)
|
|
122
131
|
return mod
|
|
132
|
+
if name == "SQLAlchemyApprovalStore":
|
|
133
|
+
from .core.storage.sql import SQLAlchemyApprovalStore
|
|
134
|
+
|
|
135
|
+
return SQLAlchemyApprovalStore
|
|
123
136
|
if name == "LocalApprovalAuthority":
|
|
124
137
|
from .core.authority import LocalApprovalAuthority
|
|
125
138
|
|
|
@@ -204,11 +217,27 @@ __all__ = [
|
|
|
204
217
|
"UnknownApprovalStateError",
|
|
205
218
|
"UnknownApprovalVersionError",
|
|
206
219
|
"VerifiedApproval",
|
|
220
|
+
"public_key_from_hex",
|
|
221
|
+
"public_key_from_pem",
|
|
222
|
+
"public_key_hex",
|
|
223
|
+
"public_key_pem",
|
|
224
|
+
"AuditLogger",
|
|
225
|
+
"AuditVerificationResult",
|
|
226
|
+
"parse_log_level",
|
|
227
|
+
"read_audit_entries",
|
|
228
|
+
"summarize_audit_entries",
|
|
229
|
+
"verify_audit_chain",
|
|
207
230
|
"canonical_request_binding",
|
|
208
231
|
"canonicalize",
|
|
209
232
|
"canonicalize_bytes",
|
|
210
233
|
"canonicalize_request",
|
|
211
234
|
"redact_database_url",
|
|
235
|
+
"AuditLogger",
|
|
236
|
+
"AuditVerificationResult",
|
|
237
|
+
"parse_log_level",
|
|
238
|
+
"read_audit_entries",
|
|
239
|
+
"summarize_audit_entries",
|
|
240
|
+
"verify_audit_chain",
|
|
212
241
|
"new_approval_id",
|
|
213
242
|
"new_request_id",
|
|
214
243
|
"parse_approval_state",
|
|
@@ -229,6 +258,9 @@ __all__ = [
|
|
|
229
258
|
"mcp",
|
|
230
259
|
"dashboard",
|
|
231
260
|
"skills",
|
|
261
|
+
"templates",
|
|
232
262
|
"evaluate_constraints",
|
|
233
263
|
"validate_constraints_schema",
|
|
234
264
|
]
|
|
265
|
+
|
|
266
|
+
ApprovalRequired = ApprovalRequiredError
|