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

Authoring Security Policies

Dmint provides command-line wizards to translate natural-language access requirements into verified, schema-compliant policy.json and mcp_protection.json files.

1. Four Ways to Create a Policy (dmint create-policy)

dmint create-policy supports 3 completely offline modes (zero API keys required) plus AI-assisted compilation:
# Mode A: Built-in Domain Templates (100% Offline — shell, filesystem, postgres, github, stripe, aws, kubernetes) dmint create-policy --template shell,filesystem,postgres -o policy.json # Mode B: Inline Rule Flags (100% Offline — repeatable -r <effect>:<tool>.<action>[:<resource>[:<kind>]]) dmint create-policy -r "allow:postgres.select:users" -r "approval_required:stripe.refund:*" -o policy.json # Mode C: Interactive Terminal Rule Builder (100% Offline step-by-step prompts) dmint create-policy --interactive -o policy.json # Mode D: Inline Natural-Language Prompt or Markdown Requirements File (AI-Assisted) dmint create-policy --prompt "Allow read-only SQL queries, require approval for schema updates" -o policy.json
When protecting internal functions or APIs via a markdown file, draft your security requirements in access.md:
access.md
# Database Access Security Requirements - The agent is permitted to run SELECT queries on any table. - Inserting or updating records in the 'users' table requires explicit human approval. - Dropping tables or executing administrative schema changes is strictly denied.
Compile access.md into policy.json:
dmint create-policy -f access.md -o policy.json -y

Supported Providers and Models

You can specify the LLM provider via --provider:
ProviderOptionEnvironment VariableDefault Model
OpenAI--provider openaiOPENAI_API_KEYgpt-4o-mini
Gemini--provider geminiGEMINI_API_KEYgemini-1.5-flash
Groq--provider groqGROQ_API_KEYllama-3.1-70b-versatile
Custom / Ollama--base-url http://localhost:11434/v1--api-key <KEY>Provider-specific

2. Authoring for MCP Servers (dmint create-mcp-policy)

For Model Context Protocol servers (stdio or streamable HTTP), dmint create-mcp-policy connects to the server, queries tools/list, and generates both the runtime policy and the gateway configuration:
dmint create-mcp-policy \ --command npx \ --args "-y @modelcontextprotocol/server-postgres postgresql://localhost/mydb" \ --integration-id postgres \ -f access.md \ -o policy.json \ --config-output mcp_protection.json \ --non-interactive -y # Or 100% Offline Auto-Classification (no LLM API key required): dmint create-mcp-policy \ --command npx \ --args "-y @modelcontextprotocol/server-postgres postgresql://localhost/mydb" \ --integration-id postgres \ --offline -y

3. Offline Policy Verification (dmint verify-policy)

Before deploying any generated policy to production, validate it offline. This step is completely deterministic and makes zero LLM calls:
dmint verify-policy policy.json
Output:
✓ Verified policy.json: 3 rule(s) [ALLOW] tool='database', action='select', resource='*' [APPROVAL_REQUIRED] tool='database', action='update', resource='users' [DENY] tool='database', action='drop', resource='*'

Checks Performed by verify-policy

  • Schema compliance against the official Dmint specification.
  • Validation that rule effects are lowercase allow, approval_required, or deny.
  • Verification that no constraints are attached to DENY rules.
  • ReDoS budget limits on regex patterns (max 256 chars, repetition bound).
  • Resource string syntax validation.

4. Policy Digest Pinning (dmint policy-digest)

Calculate the SHA-256 digest of your policy file for runtime pinning:
dmint policy-digest policy.json
Output:
6a8b75f28c19a4e3...
Export this value as DMINT_EXPECTED_POLICY_DIGEST in your deployment environment. If the file is altered on disk, Dmint will refuse to initialize.

Next Steps