Core Concepts
Policy
Policy bundle model, rule matching, and supervisor workflow.
Policy Engine
Policy decides which events are eligible for ledger persistence.
PolicyBundle
versiondefault_actionrules[]
PolicyRule fields
nameaction(allowordeny)sectorevent_typesourcemax_payload_bytes
Evaluation order
- Rules are evaluated in order.
- First matching rule wins.
- If none match,
default_actionis applied.
Supervisor workflow
policy-signsigns bundle metadata.supervisor-stagevalidates and stages candidate.supervisor-promotemakes staged bundle active.supervisor-rollbackrestores last known good bundle.
Signature model
Policy bundles are signed with HMAC-SHA256 to prevent unauthorized policy changes.
Example bundle
{
"version": "2026-03-01",
"default_action": "deny",
"rules": [
{
"name": "allow-meter-readings",
"action": "allow",
"sector": "power",
"event_type": "meter_reading",
"source": "gateway-a"
},
{
"name": "deny-oversize",
"action": "deny",
"max_payload_bytes": 65536
}
]
}Production guidance
- Prefer
default_action: denyand explicit allow rules. - Keep source targeting narrow for critical settlement events.
- Version bundles with immutable, auditable labels.
- Always stage before promote and keep rollback tested.