Policies & Rules

In Dmint, a policy is a static, declarative JSON document specifying the exact authorization boundaries for AI tool calls. Policies are authored at development time, validated offline against strict schemas, and loaded into Core at runtime.

The Policy Schema (policy.json)

Here is an example production policy:
policy.json

Rule Effects

Every rule must declare one of three effects:

Evaluation Invariants

When evaluating an incoming request:

1. Fail-Closed Default

If an agent requests an action that does not match any rule in policy.json, Dmint fails closed:
There is no ambient or implicit permission. Everything must be explicitly declared.

2. First-Match Determinism

Rules are evaluated sequentially in the order they appear in policy.json. The first rule whose (tool, action, resource) matches the requested capability determines the decision.
Place specific rules (e.g. action="drop", resource="users") before broader wildcard rules (e.g. resource="*").

Offline Validation (LLM-Free)

Before deploying a policy to production, always verify its syntactic and semantic integrity using dmint-cli:
The verification command checks:
  • JSON syntax and schema compliance
  • Presence of required fields (policy_version, rules, effect, tool, action)
  • Absence of unknown keys or invalid effect values
  • Maximum safe size limits to prevent resource exhaustion
If valid, it outputs a human-readable summary and exits with code 0:

Next Steps

Authoring Policies Guide

Use the interactive CLI wizard to convert natural language into policy.json.

Policy Schema Reference

Inspect the formal JSON schema and validation constraints.