Dmint (Core)
AI agents can request actions. Dmint deterministically decides whether those actions may execute.
dmint is the core deterministic authorization and security enforcement primitive for AI-agent tool execution. It acts as an in-process security boundary between AI model tool requests and privileged system execution.
┌─────────────────┐
│ AI Agent │
└────────┬────────┘
│ tool request
▼
┌─────────────────┐
│ Dmint │
│ │
│ ├─ ALLOW ───────────────────┐
│ ├─ DENY ──► Fail Closed │
│ └─ APPROVAL_REQUIRED ──┐ │
└──────────────────────────┼────┼─┘
│ │
Persist │ │ Execute
Request │ │ Tool
▼ ▼
┌─────────────────────────────────┐
│ Protected Tool │
└─────────────────────────────────┘
Core Principles
- Deterministic Enforcement: Runtime authorization is governed strictly by code and deterministic policy. An LLM never makes runtime authorization decisions.
- Fail-Closed: If Dmint cannot prove an action is allowed, execution is stopped immediately.
- Pre-Execution Control: Policy evaluation occurs before any tool code runs, never retroactively.
- Exact Request Binding: Human approvals bind to the exact SHA-256 canonical request fingerprint (agent, tool, action, resource, argument values, policy provenance).
- Single-Use & Replay Protection: Approved credentials are consumed atomically in SQLite storage; replay attempts fail closed.
Installation
pip install dmint
Quickstart
from dmint import Dmint, Policy, TrustedContext, Decision, ApprovalRequiredError
# 1. Define authoritative policy
policy = Policy.from_mapping({
"rules": [
{"effect": "allow", "tool": "database", "action": "read", "resource": "*"},
{"effect": "approval_required", "tool": "database", "action": "update", "resource": "*"},
{"effect": "deny", "tool": "database", "action": "delete", "resource": "*"},
]
})
dmint = Dmint(policy=policy, agent_id="agent-prod")
# 2. Protect functions using the @dmint.protected decorator
@dmint.protected("database.delete")
def delete_user(user_id: int):
# This code only runs if Dmint evaluates ALLOW
return f"Deleted user {user_id}"
# 3. Execution attempts
try:
delete_user(123)
except Exception as exc:
print(exc) # AuthorizationError: DMT_POLICY_DENIED (Fail closed)
Exact Request Binding & Approval Lifecycle
Human approval is not a generic permission grant—it authorizes one exact request payload:
Tool Request
↓
RFC 8785 JCS Canonicalization
↓
SHA-256 Request Fingerprint
↓
APPROVAL_REQUIRED (persisted in SQLite)
↓
Trusted Human Approval (Ed25519 assertion)
↓
Retry & Re-verify (Current Policy + Replay + Single-use Check)
↓
Execute Tool
What Dmint Is NOT
- Not an LLM or Model Guardrail: Dmint does not perform prompt scanning or semantic intent analysis.
- Not General IAM/RBAC: Dmint answers “May this AI-generated tool call run right now?”, not general human authentication.
- Not a Direct Bypass Barrier: If an agent has direct shell access, DB credentials, or Docker daemon access outside Dmint, an in-process Python decorator cannot prevent out-of-band execution.
Testing
Run the core security and unit test suite:
pytest -v
License
Licensed under the Apache License, Version 2.0.
See the LICENSE file for the complete license text.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file dmint-0.1.0.tar.gz.
File metadata
- Download URL: dmint-0.1.0.tar.gz
- Upload date:
- Size: 49.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e75016240a80bfdc56b84f9ce600d3a99fdc255cfdd94d28e632922eca02adcf
|
|
| MD5 |
ac7d8b4228f7c1d80cef24a015d9da36
|
|
| BLAKE2b-256 |
385b537be3eace8acd0ee26c1a014c3e739dab72fd16e4ce14e73501da77367c
|
Provenance
The following attestation bundles were made for dmint-0.1.0.tar.gz:
Publisher:
publish.yml on dmint-app/dmint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dmint-0.1.0.tar.gz -
Subject digest:
e75016240a80bfdc56b84f9ce600d3a99fdc255cfdd94d28e632922eca02adcf - Sigstore transparency entry: 2798894234
- Sigstore integration time:
-
Permalink:
dmint-app/dmint@667444761eeb34dc0037f0545f843bbe77ce75a9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dmint-app
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@667444761eeb34dc0037f0545f843bbe77ce75a9 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file dmint-0.1.0-py3-none-any.whl.
File metadata
- Download URL: dmint-0.1.0-py3-none-any.whl
- Upload date:
- Size: 38.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/7.0.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3c22438fd7ecbde98752b73f8e3ca7f94a2a419ec4dde9c613d243e959c1f87
|
|
| MD5 |
08787ba64249fdb7016c08dafdde5837
|
|
| BLAKE2b-256 |
afaf671afe5e5458a87b5f96edba168876b7c3235c4c5dbb6c3ead787f9ed51e
|
Provenance
The following attestation bundles were made for dmint-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on dmint-app/dmint
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
dmint-0.1.0-py3-none-any.whl -
Subject digest:
f3c22438fd7ecbde98752b73f8e3ca7f94a2a419ec4dde9c613d243e959c1f87 - Sigstore transparency entry: 2798894308
- Sigstore integration time:
-
Permalink:
dmint-app/dmint@667444761eeb34dc0037f0545f843bbe77ce75a9 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/dmint-app
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@667444761eeb34dc0037f0545f843bbe77ce75a9 -
Trigger Event:
workflow_dispatch
-
Statement type: