dmint Command-Line Referencedmint CLI provides developer tooling for policy authoring, validation, skill installation, and dashboard execution.dmint [command] [options]
| Flag | Description |
-h, --help | Display help text and available commands. |
-V, --version | Display the installed dmint version. |
| Variable | Default | Description |
DMINT_DATABASE_URL | None | Active database connection string (postgresql://... or sqlite:///...). Governs Core, MCP proxy, Dashboard, and CLI. |
DMINT_DB_PATH | ./approvals.sqlite3 / dmint.db | Fallback path to the SQLite approval store database. |
DMINT_DEPLOYMENT_EPOCH | default | Deployment epoch identifier used for cross-environment and rollback isolation. |
DMINT_KEY_FILE | None | Path to private Ed25519 signing key file (0600 permissions enforced). |
DMINT_PRIVATE_KEY | None | Raw hex signing key (requires DMINT_ALLOW_INLINE_KEY=1 for explicit security opt-in). |
DMINT_ALLOW_INLINE_KEY | 0 | Set to 1 to permit inline DMINT_PRIVATE_KEY instead of a 0600 file. |
DMINT_ALLOW_INSECURE_KEY_PERMISSIONS | 0 | Set to 1/true/yes to allow key files on non-POSIX platforms where 0600 permission enforcement is unavailable (fails closed otherwise). |
DMINT_ISSUER_ID | dmint-authority | Issuer identifier label associated with signing keys. |
DMINT_AUTHORITY_AUDIENCE | dmint-enforcement-gateway | Expected audience parameter in approval assertions. |
DMINT_EXPECTED_POLICY_DIGEST | None | Pinned SHA-256 digest of active policy.json. Halts on mismatch. |
DMINT_AUTH_TOKEN | None | Bearer token for agent transport authentication in dmint-mcp. |
DMINT_DASHBOARD_HOST | 127.0.0.1 | Bind host for dmint dashboard. |
DMINT_DASHBOARD_PORT | 8080 | Bind port for dmint dashboard. |
DMINT_DASHBOARD_TOKEN | None | Static bearer token / password for dashboard access. |
DMINT_DASHBOARD_PASSWORD | None | Alias for DMINT_DASHBOARD_TOKEN. |
DMINT_DASHBOARD_TOKEN_FILE | None | Path to 0600 file containing dashboard bearer token. |
DMINT_DASHBOARD_ALLOW_PUBLIC_BIND | 0 | Set to 1 or true to allow binding dashboard to 0.0.0.0. |
DMINT_DASHBOARD_TRUSTED_PROXY | 0 | Set to 1 or true to trust X-Forwarded-Proto and enable trusted-proxy identity mode behind a reverse proxy. |
DMINT_DASHBOARD_IDENTITY_HEADER | None | Trusted reverse-proxy header carrying the human identity. Requires DMINT_DASHBOARD_TRUSTED_PROXY=1 or --trusted-proxy; startup fails otherwise. |
DMINT_VERSION | Package version | Optional environment override for the reported version string. |
DMINT_USER_AGENT | Dynamic | Optional environment override for outgoing HTTP User-Agent string. |
dmint init.dmint/signing.key (0600), .dmint/integrity.key (0600), .dmint/approvals.sqlite3, a starter policy.json from built-in templates (shell,filesystem), and pre-tool execution hooks for AI coding harnesses.dmint init [--harness all|claude-code|codex|opencode|cursor|windsurf|cline|none] [--templates shell,filesystem] [--policy policy.json] [--dir .] [--force]
dmint doctor & dmint status0600 key permissions, per-harness policies in .dmint/policies/*.policy.json, installed hooks, and 4 live attack simulation vectors) or inspect current hook and policy status:dmint doctor [--dir .] [--policy policy.json] [--json] dmint status [--dir .] [--json]
dmint demo (aliases: dmint redteam, dmint attack-sim)dmint demo [--json] [--keep-dir ./demo_workspace]
dmint logs (alias: dmint audit).dmint/audit.jsonl).dmint logs # Show the last 50 audit entries dmint logs --level WARNING # Filter by minimum level (DEBUG, INFO, WARNING, ERROR, CRITICAL) dmint logs --denied # Show only blocked (DENY) tool calls dmint logs --harness claude-code --tool bash # Filter by coding harness and tool dmint logs --verify # Cryptographically verify the SHA-256 hash chain from genesis (#1) dmint logs --stats # Show decision, level, and top-blocked breakdown dmint logs --follow # Live-tail new agent tool calls in real time dmint logs --export audit_report.csv # Export filtered audit trail to CSV or JSON
dmint learn-policypolicy.json from observed agent activity in .dmint/audit.jsonl (recorded in --mode shadow or --mode enforce). Destructive and secret targets (.env*, *.key, rm -rf, sudo) are strictly emitted as deny rules.dmint learn-policy [--from-logs .dmint/audit.jsonl] [-o policy.json] [--json]
dmint check (alias: dmint test-policy)policy.json evaluates a tool call directly from your terminal. Outputs structured JSON with "verdict" (ALLOW, APPROVAL_REQUIRED, or DENY), "code", and "matched_rules".dmint check --policy policy.json --tool shell.execute --resource "git status" dmint check --policy policy.json --tool shell.execute --resource "git push origin main" dmint check --policy policy.json --tool shell.execute --resource "rm -rf /"
0: ALLOW1: APPROVAL_REQUIRED2: DENYdmint hook (alias: dmint hooks)PreToolUse / pre-execution hooks across AI coding harnesses (Claude Code, OpenAI Codex CLI, OpenCode, Cursor, Windsurf, Cline / Roo Code).# Install pre-tool hooks for one or all harnesses dmint hook install --harness all [--global] [--policy policy.json] [--db-path .dmint/approvals.sqlite3] # Check installed hook status in workspace dmint hook status [--dir .] # Evaluate a hook payload (invoked automatically by the coding agent harness) dmint hook run --harness claude-code --policy policy.json --db-path .dmint/approvals.sqlite3 # Remove installed Dmint hooks dmint hook uninstall --harness all
dmint create-policypolicy.json.dmint create-policy [options]
| Flag | Default | Description |
-t, --template | None | Offline built-in domain templates (shell,filesystem,postgres,github,stripe,aws,kubernetes). |
-r, --rule | None | Repeatable offline inline rule (<effect>:<tool>.<action>[:<resource>[:<kind>]]). |
-i, --interactive | False | Launch the 100% offline step-by-step interactive rule builder. |
-p, --prompt | None | Inline natural-language policy description (avoids needing -f). |
-f, --file | None | Path to input requirements file (e.g. access.md). |
-o, --output | policy.json | Path to destination policy JSON file (default: policy.json). |
-provider, --provider | openai | LLM provider: openai, gemini, groq, openrouter, ollama. |
-model, --model | Provider default | Specific model name (e.g. gpt-4o-mini, gemini-1.5-flash). |
-api_key, --api-key | Env var | API key (or set OPENAI_API_KEY, GEMINI_API_KEY). |
--non-interactive | False | Run in non-interactive batch mode. |
-y, --yes | False | Automatically accept generated policy without confirmation. |
--timeout | 60.0 | API request timeout in seconds. |
--tools | None | Path to tool source file (for schema discovery / compatibility). |
dmint compile-policy (Compatibility)create-policy non-interactive flow; prefer dmint create-policy for modern authoring.dmint compile-policy -f access.md -o policy.json
| Flag | Description |
-f, --file | Required. Input policy markdown/text file (e.g. access.md). |
-o, --output | Required. Output policy JSON file (e.g. policy.json). |
-provider, --provider | LLM provider: openai, gemini, groq, openrouter, ollama. |
-base_url, --base-url | OpenAI-compatible base URL (default: https://api.openai.com/v1). |
-api_key, --api-key | API key (or set OPENAI_API_KEY / GEMINI_API_KEY). |
-model, --model | Model name (e.g. gpt-4o-mini, gemini-1.5-flash). |
--timeout | API request timeout in seconds (default: 60.0). |
dmint create-mcp-policytools/list, and generates both policy.json and mcp_protection.json.dmint create-mcp-policy [options]
| Flag | Description |
--integration-id | Required / Recommended. Unique namespace identifier for this tool integration (e.g. postgres, ledger). Always pass this explicitly when --command contains paths, binaries, or complex arguments. |
--command | Executable command for stdio servers (e.g. npx, uvx, python, /path/to/venv/bin/python). |
--args | Arguments array or string for the stdio command (e.g. server.py). |
--transport | Transport protocol: stdio (default) or streamable-http. |
--url | Remote URL for streamable-http MCP endpoints. |
-f, --file | Path to requirements file (default: access.md). |
-o, --output | Destination policy file (default: policy.json). |
--config-output | Destination protection config (default: mcp_protection.json). |
--offline, --auto-classify | 100% offline deterministic tool classification and SHA-256 schema_hash pinning (no LLM API key required). |
--non-interactive | Skip interactive prompt dialogues. |
-y, --yes | Automatically accept generated configuration. |
dmint protect-mcp (Compatibility alias)dmint create-mcp-policy with identical options; provided for backward compatibility with older tutorials and scripts.dmint protect-mcp --url https://api.example.com/mcp
dmint create-mcp-policy for the full option table.dmint verify-policypolicy.json file against Dmint schema and security invariants. Zero network calls; no LLM.dmint verify-policy <policy.json>
| Code | Meaning |
0 | Policy is valid and compliant. |
1 | Schema violation, unknown keys, or invalid effect values. |
2 | Missing argument or unreadable input file. |
dmint install-skilldmint-policy-manager AI coding agent skill for Antigravity, Claude Code, Cursor, and Gemini CLI.dmint install-skill [options]
| Flag | Description |
-y, --yes | Non-interactive install to default .agents/skills/. |
--dest, --target | Install to a specific custom directory. |
--global | Install globally to ~/.gemini/config/skills/. |
--claude | Install globally to ~/.claude/skills/. |
--skill | Skill name to install (default: dmint-policy-manager). |
--list | List available installable skills and exit. |
-f, --force | Overwrite existing skill files without prompting. |
dmint dashboarddmint dashboard [options]
# Basic local launch with SQLite: dmint dashboard --db-path ./approvals.sqlite3 --port 8080 # Launch with PostgreSQL: dmint dashboard --database-url postgresql://user:pass@localhost:5432/dmint --port 8080 # Launch with matching deployment epoch: dmint dashboard --db-path ./approvals.sqlite3 --deployment-epoch prod-v1 --port 8080
SQLiteApprovalStore with a custom deployment_epoch (e.g. deployment_epoch="prod-v1"), you must pass the identical --deployment-epoch prod-v1 to dmint dashboard. Mismatched epochs fail closed to prevent cross-deployment replay attacks.| Flag | Default | Description |
--db-path | DMINT_DB_PATH / built-in default | Path to the Core SQLite database file. Used when --database-url is not set. |
--database-url | DMINT_DATABASE_URL | Database connection URL (postgresql://... or sqlite:///...). Takes precedence over --db-path. |
--host | 127.0.0.1 | Local bind host. |
--port | 8080 | Local bind port. |
--allow-public-bind | False | Explicitly permit binding to 0.0.0.0 / all interfaces. |
--auth-token | DMINT_DASHBOARD_TOKEN | Bearer token / password for dashboard access. |
--token-file | DMINT_DASHBOARD_TOKEN_FILE | Path to 0600 file containing dashboard auth token. |
--key-file | DMINT_KEY_FILE / ~/.config/dmint/signing.key | Path to Ed25519 signing key file. |
--trusted-proxy | False | Trust X-Forwarded-Proto and enable trusted-proxy identity mode. Configure the header separately with DMINT_DASHBOARD_IDENTITY_HEADER. |
--deployment-epoch | default | Deployment epoch matching running Core instance. Must match the agent's deployment_epoch. |
--authority-issuer | dmint-dashboard | Issuer identifier for signed approvals. |
--approver-id | Required via flag or DMINT_APPROVER_ID | Human approver identifier stamped on records. |
dmint pendingPENDING state. Works against either SQLite or PostgreSQL (via DMINT_DATABASE_URL or --database-url).dmint pending [options]
# List pending requests using active store: dmint pending # Query a specific database file: dmint pending --db-path ./approvals.sqlite3 # Query a PostgreSQL instance: dmint pending --database-url postgresql://user:pass@localhost:5432/dmint
| Flag | Default | Description |
--db-path | DMINT_DB_PATH or local default | Path to SQLite database file. |
--database-url | DMINT_DATABASE_URL | Full database URL (sqlite:///... or postgresql://...). |
--deployment-epoch | DMINT_DEPLOYMENT_EPOCH / default | Deployment epoch matching running Core instance. |
--limit | 100 | Maximum number of pending records to display. |
dmint approvedmint approve re-verifies the request against the current policy. If the policy has changed such that this request is now denied, approval is refused and the record stays PENDING; no assertion is written. The CLI prints an explanatory error and exits non-zero.dmint approve resolves the current active policy using a deterministic precedence hierarchy:--policy <path> Flag: If provided, Dmint loads and parses the specified policy JSON directly.store_policy table): If --policy is not specified, Dmint queries the approval store for an authoritative policy registered via store.set_authoritative_policy(). In PostgreSQL deployments, this table stores the authoritative policy shared across gateway instances../policy.json Fallback: If the database store contains no authoritative policy record, Dmint checks the current working directory for ./policy.json.store_policy table, running dmint approve without --policy will re-verify against the database's cached policy, not local ./policy.json edits.--policy ./policy.json.store.set_authoritative_policy(new_policy, provenance).dmint approve <id> [options]
# Approve a pending request: dmint approve apr_abc123... # Approve with an audit note/reason: dmint approve apr_abc123... --reason "Reviewed and authorized for production migration" # Specify approver identity and custom policy file: dmint approve apr_abc123... --approver-id "alice@company.com" --policy ./policy.json
| Flag | Default | Description |
approval_id | Positional, Required | Unique approval ID (apr_...) to approve. |
--reason | None | Audit note explaining why the approval was granted (max 1000 chars). |
--db-path | DMINT_DB_PATH or local default | Path to SQLite database file. |
--database-url | DMINT_DATABASE_URL | Full database URL (sqlite:///... or postgresql://...). |
--deployment-epoch | DMINT_DEPLOYMENT_EPOCH / default | Deployment epoch matching running Core instance. |
--policy | Auto-detected | Path to policy file for re-verification before signing. |
--approver-id | DMINT_APPROVER_ID or username | Approver principal identity stamped on the approval record. |
--authority-issuer | DMINT_AUTHORITY_ISSUER / dmint-cli | Authority issuer identifier. |
--key-file | DMINT_KEY_FILE | Path to Ed25519 signing key file. |
--audience | DMINT_AUTHORITY_AUDIENCE / dmint/dashboard/v1 | Target audience for the approval assertion. |
--output-assertion | None | File path to write the signed approval assertion bytes for retry. The assertion is a single-use credential; replay fails closed. |
dmint rejectREJECTED in the approval store. No cryptographic assertion is issued.dmint reject <id> [options]
# Reject a pending request: dmint reject apr_abc123... # Reject with an audit note/reason: dmint reject apr_abc123... --reason "Destructive operation not permitted during freeze"
| Flag | Default | Description |
approval_id | Positional, Required | Unique approval ID (apr_...) to reject. |
--reason | None | Audit note explaining why the request was rejected (max 1000 chars). |
--db-path | DMINT_DB_PATH or local default | Path to SQLite database file. |
--database-url | DMINT_DATABASE_URL | Full database URL (sqlite:///... or postgresql://...). |
--deployment-epoch | DMINT_DEPLOYMENT_EPOCH / default | Deployment epoch matching running Core instance. |
--approver-id | DMINT_APPROVER_ID or username | Rejecter principal identity stamped on the record. |
--authority-issuer | DMINT_AUTHORITY_ISSUER / dmint-cli | Authority issuer identifier. |
dmint policy-digestDMINT_EXPECTED_POLICY_DIGEST or the expected_policy_digest parameter in Dmint().dmint policy-digest <policy.json>
| Argument | Description |
policy_file | Positional, Required. Path to the policy.json file to digest. |
# Print the digest of a policy file: dmint policy-digest ./policy.json # Pin the digest at runtime: export DMINT_EXPECTED_POLICY_DIGEST=$(dmint policy-digest ./policy.json)
dmint init-keys0600 file permissions).dmint init-keys [options]
| Flag | Default | Description |
--dir, -d | ~/.config/dmint | Directory in which to generate signing.key and integrity.key. |
--key-file | ~/.config/dmint/signing.key | Destination path for the private signing key file. |
--integrity-key-file | integrity.key next to key-file | Destination path for the HMAC storage integrity key file. |
--issuer-id | dmint-authority (or DMINT_ISSUER_ID) | Issuer identifier to associate with this key. |
--force | False | Overwrite existing key files (invalidates pending approvals signed with the old key). |
dmint export-public-keytrusted_issuers.dmint export-public-key [options]
| Flag | Default | Description |
--dir, -d | ~/.config/dmint | Directory containing signing.key. |
--key-file | ~/.config/dmint/signing.key | Path to the private key file. |
--json | False | Shorthand for --format json. |
--issuer-id | dmint-authority (or DMINT_ISSUER_ID) | Issuer ID label to display. |
--format | both | Output format: hex, pem, both, json. |
dmint-mcp (MCP Gateway)dmint-mcp [action] [options]
| Flag | Default | Description |
-c, --config | mcp_protection.json | Path to gateway configuration file. |
--transport | stdio | Agent-facing transport: stdio or http. |
--host | 127.0.0.1 | Bind host address for HTTP transport. |
--port | 8000 | Bind port for HTTP transport. |
--auth-token | DMINT_AUTH_TOKEN | Bearer token for incoming agent HTTP requests. |
--log-level | info | Logging verbosity: critical, error, warning, info, debug, trace. |
--expected-policy-digest | None | Pinned SHA-256 digest of policy.json. Fails closed if mismatched. |