Decision Envelope v1
Purpose
DecisionEnvelopeV1 is the governance contract for autonomous action gating.
It is designed to be:
- protobuf-first for deterministic embedded encoding
- signed and replay-checkable
- auditable with deterministic MMR leaf hashing
- policy-authoritative (math does not invent policy)
Canonical Files
proto/decision_envelope/v1/decision_envelope.protosrc/governance/decision_envelope_v1.pyschemas/decision_envelope_v1.schema.jsonschemas/examples/decision_envelope_v1.example.json
v1 Field Set
Identity
identity.envelope_ididentity.version(decision-envelope.v1)identity.mission_ididentity.swarm_id
Authority
authority.issuer(ground control authority)authority.key_idauthority.valid_from_msauthority.valid_until_msauthority.issued_at_msauthority.signatureauthority.signed_payload_hash
Scope
scope.agent_allowlistscope.capability_allowlistscope.target_allowlist
Constraints
constraints.mission_phase_allowlistconstraints.resources.power_minconstraints.resources.bandwidth_minconstraints.resources.thermal_maxconstraints.max_risk_tier
Boundary Behavior
AUTO_ALLOWQUARANTINEDENY
For QUARANTINE and DENY, recovery metadata is required:
recovery.path_idrecovery.playbook_refrecovery.quorum_minrecovery.human_ack_required
Audit Hooks
audit.mmr_fieldsaudit.mmr_leaf_hash
Deterministic Signing Rules
- Start from protobuf message.
- Canonical signing bytes are deterministic protobuf serialization with:
authority.signature = ""authority.signed_payload_hash = ""audit.mmr_leaf_hash = ""
signed_payload_hash = sha256(canonical_signing_bytes).- Sign
signed_payload_hash(current runtime: HMAC-SHA256 placeholder; production can swap to ML-DSA).
Deterministic MMR Rules
MMR leaf payload is canonical JSON with:
- sorted keys
- compact separators
- sorted/unique allowlists
- stable sort order for rules
- signature bytes excluded
mmr_leaf_hash = sha256(canonical_mmr_payload).
Required MMR field list is MMR_REQUIRED_FIELDS_V1 in src/governance/decision_envelope_v1.py.
JSON / JSON-LD Projection
Use envelope_to_json_projection(...) for cockpit/policy tooling.
Projection includes _canonical:
proto_sha256(required)proto_b64(optional, exact protobuf round-trip)
json_projection_to_envelope(...) reconstructs protobuf either:
- from
proto_b64, or - from JSON fields with canonical hash reference checks.
Envelope-Only Evaluation Contract
evaluate_action_inside_envelope(...) only answers: given state, is action inside the signed envelope?
It enforces:
- signed scope
- signed constraints
- signed boundary rules
- signed recovery metadata
It does not invent policy.