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

Exact Request Binding

A critical vulnerability in traditional approval systems is parameter tampering or scope drift:
  • A human operator reviews and approves: update_account(account_id="acc_99", role="viewer")
  • An adversarial agent modifies the payload before retry: update_account(account_id="acc_01", role="admin")
Dmint eliminates this attack vector through Exact Request Binding.
An approval in Dmint is never a blanket permission. It is a cryptographic assertion bound strictly to the byte-for-byte canonical hash of one exact request.

The Request Binding Envelope

Before any approval record is created or evaluated, Dmint constructs an immutable request binding envelope:
{ "action": "transfer_funds", "arguments": { "account_id": "acc_100", "amount": 500.0 }, "binding_version": "dmint/request-binding/v2", "canonicalization_profile": "dmint/jcs-v2", "capability_id": "ledger.transfer_funds", "integration_id": "local-runtime", "principal_id": "finance-agent-01", "resource": { "kind": "identifier", "value": "accounts" }, "tool": "ledger", "trusted_context": { "tenant": "prod-us" } }

Why RFC 8785 Canonicalization (JCS)?

In standard JSON implementations, semantically identical payloads produce distinct raw string representations:
// Representation A: {"account_id": "acc_100", "amount": 500.0} // Representation B (different key order, added spaces, different float formatting): { "amount": 500, "account_id": "acc_100" }
If hashed naively as raw text, Representation A and Representation B produce completely different SHA-256 hashes, causing false-positive approval mismatches or allowing hash-malleability exploits.
Dmint implements RFC 8785 JSON Canonicalization Scheme (JCS):
  1. UTF-16 Code Unit Key Sorting: Dictionary keys are sorted lexicographically by their UTF-16 code units (RFC 8785 Section 3.2.3).
  2. Whitespace Stripping: All whitespace between tokens is removed.
  3. Deterministic Floating-Point Numbers: Floating-point numbers are formatted using ECMAScript/V8 IEEE 754 string conversion rules without trailing decimal zeros or uppercase exponents.
  4. Surrogate Validation: Strings containing lone Unicode surrogates are rejected with CanonicalizationError.
  5. Depth & Size Limits: Maximum nesting depth is capped at 100 levels; maximum canonical size is capped at 10 MB.
Under RFC 8785, both Representation A and Representation B serialize to the exact same bytes: {"account_id":"acc_100","amount":500}

SHA-256 Domain Separation

Once the request envelope is serialized to canonical bytes, Dmint computes the SHA-256 request fingerprint:
import hashlib from dmint.core.canonicalize import canonicalize_bytes _FINGERPRINT_DOMAIN = b"dmint/request-fingerprint/v2\x00" canonical_bytes = canonicalize_bytes(request_envelope) request_fingerprint = hashlib.sha256(_FINGERPRINT_DOMAIN + canonical_bytes).hexdigest()

Why Domain Separation Matters

The prefix b"dmint/request-fingerprint/v2\x00" prevents cross-protocol signature forgery. A hash computed for a policy digest (b"dmint/policy-digest/v1\x00") or row integrity check (b"dmint/approval-record-integrity/v2\x00") can never collide with or be substituted for a request fingerprint.

Tampering Scenarios and Fail-Closed Responses

Attempted TamperingAttacker ActionDmint DetectionDecision
Argument ModificationChanges amount from 500 to 5000Canonical JCS bytes change; SHA-256 hash mismatch.Fails closed: DMT_APPROVAL_REQUEST_MISMATCH
Agent SpoofingAnother agent attempts to reuse approved tokenprincipal_id mismatch in request envelope.Fails closed: DMT_APPROVAL_PRINCIPAL_MISMATCH
Context SwitchingReplaying approval in production that was approved in stagingtrusted_context.environment differs in hash.Fails closed: DMT_APPROVAL_REQUEST_MISMATCH
Policy ModificationOperator changes policy rules after approval grantedPolicy SHA-256 digest changed; epoch invalidated.Fails closed: DMT_APPROVAL_POLICY_INVALID

Next Steps