Bash / exec_command, Read, Write, Edit, MultiEdit) that run directly inside the agent harness.mcp__postgres__query, etc.) that run over stdio or Streamable HTTP.dmint hook intercepts built-in shell, filesystem, and MCP tool calls via the harness's native PreToolUse / tool.execute.before hook before a command ever runs.dmint-mcp wraps downstream MCP servers in a fail-closed proxy.dmint init).dmint/), a starter policy.json (covering shell and filesystem tools), and pre-tool hooks for your coding agent:# Install for Claude Code, Codex, OpenCode, Cursor, Windsurf, and Cline at once: dmint init --harness all # Or target a specific harness: dmint init --harness claude-code dmint init --harness codex dmint init --harness opencode
.dmint/policies/<harness>.policy.json & policy.json — Dedicated per-harness policies covering all built-in tools for Claude Code (claude-code.policy.json), Codex (codex.policy.json), and OpenCode (opencode.policy.json)..dmint/signing.key & .dmint/integrity.key (0600 permissions) — Ed25519 approval signing key and HMAC store integrity key..claude/settings.json — Claude Code PreToolUse hook matching Bash|Read|Write|Edit|MultiEdit|NotebookEdit|WebFetch|mcp__.*..codex/hooks.json & .codex/dmint-hook.sh — OpenAI Codex CLI pre-execution hook..opencode/plugin/dmint-guard.ts — OpenCode tool.execute.before guard plugin.dmint check)policy.json evaluates any tool call:# Safe inspection command -> ALLOW (exit code 0) dmint check --tool shell.execute --resource "git status" # Sensitive command -> APPROVAL_REQUIRED (exit code 1) dmint check --tool shell.execute --resource "git push origin main" # Destructive command -> DENY (exit code 2) dmint check --tool shell.execute --resource "rm -rf /"
approval_required (such as git push origin main or docker run ...):dmint hook run halts the tool call, saves a tamper-evident PENDING record (apr_...) in .dmint/approvals.sqlite3, and returns the exact approval command to the agent/user:Dmint APPROVAL_REQUIRED [apr_9k2L...]: shell.execute on 'git push origin main' requires human sign-off. To approve, run: `dmint approve apr_9k2L...` (or use `dmint dashboard`), then retry.
dmint dashboard), approve the exact request:dmint pending dmint approve apr_9k2L... --by alice@company.com
dmint hook run verifies the Ed25519 signature against the exact RFC 8785 canonicalized arguments, atomically transitions the record from APPROVED to CONSUMED, and lets the command execute once.git push origin main --force), the request fingerprint does not match and the call is blocked.dmint hook)# Check which harnesses have Dmint hooks installed in the current workspace: dmint hook status # Install hooks into your global home directory (~/.claude/settings.json, ~/.config/opencode/plugin/, etc.): dmint hook install --harness claude-code --global # Remove hooks cleanly: dmint hook uninstall --harness all
dmint-mcpdmint-mcp:claude mcp add dmint-gateway -- dmint-mcp run --config /absolute/path/to/mcp_protection.json