Agent-readable docs index: /llms.txt. Full docs in one file: /llms-full.txt. Download /docs.zip to grep all markdown files locally.

dmint Command-Line Reference

The dmint CLI provides developer tooling for policy authoring, validation, skill installation, and dashboard execution.
dmint [command] [options]

Global Options

FlagDescription
-h, --helpDisplay help text and available commands.
-V, --versionDisplay the installed dmint version.

Environment Variables

VariableDefaultDescription
DMINT_DATABASE_URLNoneActive database connection string (postgresql://... or sqlite:///...). Governs Core, MCP proxy, Dashboard, and CLI.
DMINT_DB_PATH./approvals.sqlite3 / dmint.dbFallback path to the SQLite approval store database.
DMINT_DEPLOYMENT_EPOCHdefaultDeployment epoch identifier used for cross-environment and rollback isolation.
DMINT_KEY_FILENonePath to private Ed25519 signing key file (0600 permissions enforced).
DMINT_PRIVATE_KEYNoneRaw hex signing key (requires DMINT_ALLOW_INLINE_KEY=1 for explicit security opt-in).
DMINT_ALLOW_INLINE_KEY0Set to 1 to permit inline DMINT_PRIVATE_KEY instead of a 0600 file.
DMINT_ALLOW_INSECURE_KEY_PERMISSIONS0Set to 1/true/yes to allow key files on non-POSIX platforms where 0600 permission enforcement is unavailable (fails closed otherwise).
DMINT_ISSUER_IDdmint-authorityIssuer identifier label associated with signing keys.
DMINT_AUTHORITY_AUDIENCEdmint-enforcement-gatewayExpected audience parameter in approval assertions.
DMINT_EXPECTED_POLICY_DIGESTNonePinned SHA-256 digest of active policy.json. Halts on mismatch.
DMINT_AUTH_TOKENNoneBearer token for agent transport authentication in dmint-mcp.
DMINT_DASHBOARD_HOST127.0.0.1Bind host for dmint dashboard.
DMINT_DASHBOARD_PORT8080Bind port for dmint dashboard.
DMINT_DASHBOARD_TOKENNoneStatic bearer token / password for dashboard access.
DMINT_DASHBOARD_PASSWORDNoneAlias for DMINT_DASHBOARD_TOKEN.
DMINT_DASHBOARD_TOKEN_FILENonePath to 0600 file containing dashboard bearer token.
DMINT_DASHBOARD_ALLOW_PUBLIC_BIND0Set to 1 or true to allow binding dashboard to 0.0.0.0.
DMINT_DASHBOARD_TRUSTED_PROXY0Set to 1 or true to trust X-Forwarded-Proto and enable trusted-proxy identity mode behind a reverse proxy.
DMINT_DASHBOARD_IDENTITY_HEADERNoneTrusted reverse-proxy header carrying the human identity. Requires DMINT_DASHBOARD_TRUSTED_PROXY=1 or --trusted-proxy; startup fails otherwise.
DMINT_VERSIONPackage versionOptional environment override for the reported version string.
DMINT_USER_AGENTDynamicOptional environment override for outgoing HTTP User-Agent string.

dmint init

One-command zero-config setup: generates .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 status

Run end-to-end local security diagnostics (verifying Ed25519 signing, HMAC store integrity, 0600 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)

Run a live 7-scenario red-team attack and cryptographic enforcement simulation (Safe Read, Compound Shell Smuggling, Symlink Escape, Multi-File Patch Smuggling, Ed25519 Single-Use Approval Lifecycle, Post-Approval RFC 8785 Parameter Tampering, and Replay + Rogue Key Forgery) against the real Dmint engine in an isolated workspace:
dmint demo [--json] [--keep-dir ./demo_workspace]

dmint logs (alias: dmint audit)

Inspect, filter, live-tail, export, and cryptographically verify the tamper-evident SHA-256 hash-chained audit trail (.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-policy

Synthesize a verified, least-privilege policy.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)

Simulate and test how a 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 /"

Exit Codes

  • 0: ALLOW
  • 1: APPROVAL_REQUIRED
  • 2: DENY

dmint hook (alias: dmint hooks)

Install, inspect, execute, or uninstall runtime 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-policy

Interactive wizard to convert natural language requirements into a verified policy.json.
dmint create-policy [options]

Options

FlagDefaultDescription
-t, --templateNoneOffline built-in domain templates (shell,filesystem,postgres,github,stripe,aws,kubernetes).
-r, --ruleNoneRepeatable offline inline rule (<effect>:<tool>.<action>[:<resource>[:<kind>]]).
-i, --interactiveFalseLaunch the 100% offline step-by-step interactive rule builder.
-p, --promptNoneInline natural-language policy description (avoids needing -f).
-f, --fileNonePath to input requirements file (e.g. access.md).
-o, --outputpolicy.jsonPath to destination policy JSON file (default: policy.json).
-provider, --provideropenaiLLM provider: openai, gemini, groq, openrouter, ollama.
-model, --modelProvider defaultSpecific model name (e.g. gpt-4o-mini, gemini-1.5-flash).
-api_key, --api-keyEnv varAPI key (or set OPENAI_API_KEY, GEMINI_API_KEY).
--non-interactiveFalseRun in non-interactive batch mode.
-y, --yesFalseAutomatically accept generated policy without confirmation.
--timeout60.0API request timeout in seconds.
--toolsNonePath to tool source file (for schema discovery / compatibility).

dmint compile-policy (Compatibility)

Legacy batch compiler for natural-language policy requirements. It is a thin compatibility wrapper delegating to the create-policy non-interactive flow; prefer dmint create-policy for modern authoring.
dmint compile-policy -f access.md -o policy.json

Options

FlagDescription
-f, --fileRequired. Input policy markdown/text file (e.g. access.md).
-o, --outputRequired. Output policy JSON file (e.g. policy.json).
-provider, --providerLLM provider: openai, gemini, groq, openrouter, ollama.
-base_url, --base-urlOpenAI-compatible base URL (default: https://api.openai.com/v1).
-api_key, --api-keyAPI key (or set OPENAI_API_KEY / GEMINI_API_KEY).
-model, --modelModel name (e.g. gpt-4o-mini, gemini-1.5-flash).
--timeoutAPI request timeout in seconds (default: 60.0).

dmint create-mcp-policy

Specialized wizard for Model Context Protocol servers: connects to the server, queries tools/list, and generates both policy.json and mcp_protection.json.
dmint create-mcp-policy [options]

Options

FlagDescription
--integration-idRequired / Recommended. Unique namespace identifier for this tool integration (e.g. postgres, ledger). Always pass this explicitly when --command contains paths, binaries, or complex arguments.
--commandExecutable command for stdio servers (e.g. npx, uvx, python, /path/to/venv/bin/python).
--argsArguments array or string for the stdio command (e.g. server.py).
--transportTransport protocol: stdio (default) or streamable-http.
--urlRemote URL for streamable-http MCP endpoints.
-f, --filePath to requirements file (default: access.md).
-o, --outputDestination policy file (default: policy.json).
--config-outputDestination protection config (default: mcp_protection.json).
--offline, --auto-classify100% offline deterministic tool classification and SHA-256 schema_hash pinning (no LLM API key required).
--non-interactiveSkip interactive prompt dialogues.
-y, --yesAutomatically accept generated configuration.

dmint protect-mcp (Compatibility alias)

Alias for 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
See dmint create-mcp-policy for the full option table.

dmint verify-policy

100% offline, deterministic validation of a policy.json file against Dmint schema and security invariants. Zero network calls; no LLM.
dmint verify-policy <policy.json>

Exit Codes

CodeMeaning
0Policy is valid and compliant.
1Schema violation, unknown keys, or invalid effect values.
2Missing argument or unreadable input file.

dmint install-skill

Installs the official dmint-policy-manager AI coding agent skill for Antigravity, Claude Code, Cursor, and Gemini CLI.
dmint install-skill [options]

Options

FlagDescription
-y, --yesNon-interactive install to default .agents/skills/.
--dest, --targetInstall to a specific custom directory.
--globalInstall globally to ~/.gemini/config/skills/.
--claudeInstall globally to ~/.claude/skills/.
--skillSkill name to install (default: dmint-policy-manager).
--listList available installable skills and exit.
-f, --forceOverwrite existing skill files without prompting.

dmint dashboard

Launches the local human approval web dashboard connected to Core-owned SQLite or PostgreSQL.
dmint dashboard [options]

Examples

# 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
Matching Deployment Epoch: If your application initialized 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.

Options

FlagDefaultDescription
--db-pathDMINT_DB_PATH / built-in defaultPath to the Core SQLite database file. Used when --database-url is not set.
--database-urlDMINT_DATABASE_URLDatabase connection URL (postgresql://... or sqlite:///...). Takes precedence over --db-path.
--host127.0.0.1Local bind host.
--port8080Local bind port.
--allow-public-bindFalseExplicitly permit binding to 0.0.0.0 / all interfaces.
--auth-tokenDMINT_DASHBOARD_TOKENBearer token / password for dashboard access.
--token-fileDMINT_DASHBOARD_TOKEN_FILEPath to 0600 file containing dashboard auth token.
--key-fileDMINT_KEY_FILE / ~/.config/dmint/signing.keyPath to Ed25519 signing key file.
--trusted-proxyFalseTrust X-Forwarded-Proto and enable trusted-proxy identity mode. Configure the header separately with DMINT_DASHBOARD_IDENTITY_HEADER.
--deployment-epochdefaultDeployment epoch matching running Core instance. Must match the agent's deployment_epoch.
--authority-issuerdmint-dashboardIssuer identifier for signed approvals.
--approver-idRequired via flag or DMINT_APPROVER_IDHuman approver identifier stamped on records.

dmint pending

Lists all approval requests currently in PENDING state. Works against either SQLite or PostgreSQL (via DMINT_DATABASE_URL or --database-url).
dmint pending [options]

Examples

# 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

Options

FlagDefaultDescription
--db-pathDMINT_DB_PATH or local defaultPath to SQLite database file.
--database-urlDMINT_DATABASE_URLFull database URL (sqlite:///... or postgresql://...).
--deployment-epochDMINT_DEPLOYMENT_EPOCH / defaultDeployment epoch matching running Core instance.
--limit100Maximum number of pending records to display.

dmint approve

Approves and cryptographically signs a pending tool execution request via Core's Ed25519 signing primitives.
Before signing, dmint 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.

Policy Resolution Order and PostgreSQL Authoritative Caching

When re-evaluating the request before signing, dmint approve resolves the current active policy using a deterministic precedence hierarchy:
  1. Explicit --policy <path> Flag: If provided, Dmint loads and parses the specified policy JSON directly.
  2. Database Authoritative Policy (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.
  3. Local ./policy.json Fallback: If the database store contains no authoritative policy record, Dmint checks the current working directory for ./policy.json.
PostgreSQL Policy Caching Gotcha: If your PostgreSQL store has a policy cached in its store_policy table, running dmint approve without --policy will re-verify against the database's cached policy, not local ./policy.json edits.
  • To re-verify against local file edits, explicitly pass: --policy ./policy.json.
  • Or update the database's authoritative policy in your orchestration pipeline via store.set_authoritative_policy(new_policy, provenance).
dmint approve <id> [options]

Examples

# 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

Options

FlagDefaultDescription
approval_idPositional, RequiredUnique approval ID (apr_...) to approve.
--reasonNoneAudit note explaining why the approval was granted (max 1000 chars).
--db-pathDMINT_DB_PATH or local defaultPath to SQLite database file.
--database-urlDMINT_DATABASE_URLFull database URL (sqlite:///... or postgresql://...).
--deployment-epochDMINT_DEPLOYMENT_EPOCH / defaultDeployment epoch matching running Core instance.
--policyAuto-detectedPath to policy file for re-verification before signing.
--approver-idDMINT_APPROVER_ID or usernameApprover principal identity stamped on the approval record.
--authority-issuerDMINT_AUTHORITY_ISSUER / dmint-cliAuthority issuer identifier.
--key-fileDMINT_KEY_FILEPath to Ed25519 signing key file.
--audienceDMINT_AUTHORITY_AUDIENCE / dmint/dashboard/v1Target audience for the approval assertion.
--output-assertionNoneFile path to write the signed approval assertion bytes for retry. The assertion is a single-use credential; replay fails closed.

dmint reject

Marks a pending tool execution request as REJECTED in the approval store. No cryptographic assertion is issued.
dmint reject <id> [options]

Examples

# 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"

Options

FlagDefaultDescription
approval_idPositional, RequiredUnique approval ID (apr_...) to reject.
--reasonNoneAudit note explaining why the request was rejected (max 1000 chars).
--db-pathDMINT_DB_PATH or local defaultPath to SQLite database file.
--database-urlDMINT_DATABASE_URLFull database URL (sqlite:///... or postgresql://...).
--deployment-epochDMINT_DEPLOYMENT_EPOCH / defaultDeployment epoch matching running Core instance.
--approver-idDMINT_APPROVER_ID or usernameRejecter principal identity stamped on the record.
--authority-issuerDMINT_AUTHORITY_ISSUER / dmint-cliAuthority issuer identifier.

dmint policy-digest

Computes and prints the SHA-256 digest of exact policy file bytes. Use this to obtain the value for DMINT_EXPECTED_POLICY_DIGEST or the expected_policy_digest parameter in Dmint().
dmint policy-digest <policy.json>

Arguments

ArgumentDescription
policy_filePositional, Required. Path to the policy.json file to digest.

Example

# 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-keys

Generates and persists a new Ed25519 signing key and HMAC storage integrity key (enforcing 0600 file permissions).
dmint init-keys [options]

Options

FlagDefaultDescription
--dir, -d~/.config/dmintDirectory in which to generate signing.key and integrity.key.
--key-file~/.config/dmint/signing.keyDestination path for the private signing key file.
--integrity-key-fileintegrity.key next to key-fileDestination path for the HMAC storage integrity key file.
--issuer-iddmint-authority (or DMINT_ISSUER_ID)Issuer identifier to associate with this key.
--forceFalseOverwrite existing key files (invalidates pending approvals signed with the old key).

dmint export-public-key

Exports the public key (hex, PEM, or JSON) and issuer ID for configuring gateway trusted_issuers.
dmint export-public-key [options]

Options

FlagDefaultDescription
--dir, -d~/.config/dmintDirectory containing signing.key.
--key-file~/.config/dmint/signing.keyPath to the private key file.
--jsonFalseShorthand for --format json.
--issuer-iddmint-authority (or DMINT_ISSUER_ID)Issuer ID label to display.
--formatbothOutput format: hex, pem, both, json.

dmint-mcp (MCP Gateway)

The standalone CLI entry point for running the Model Context Protocol enforcement gateway.
dmint-mcp [action] [options]

Options

FlagDefaultDescription
-c, --configmcp_protection.jsonPath to gateway configuration file.
--transportstdioAgent-facing transport: stdio or http.
--host127.0.0.1Bind host address for HTTP transport.
--port8000Bind port for HTTP transport.
--auth-tokenDMINT_AUTH_TOKENBearer token for incoming agent HTTP requests.
--log-levelinfoLogging verbosity: critical, error, warning, info, debug, trace.
--expected-policy-digestNonePinned SHA-256 digest of policy.json. Fails closed if mismatched.