Configuration
Policy Rules
Write, sign, and deploy policy bundles that control which events reach the ledger.
Policy Rules
The policy engine is the last gate before an event is persisted to the ledger. It evaluates each event against a signed rule bundle and decides allow or deny.
Policy bundle structure
{
"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
}
]
}Rule fields
| Field | Required | Description |
|---|---|---|
name | Yes | Human-readable rule identifier |
action | Yes | allow or deny |
sector | No | Match events with this sector (e.g., power, ev, grid) |
event_type | No | Match events with this type (e.g., meter_reading, session_end) |
source | No | Match events from this source identity |
max_payload_bytes | No | Reject events with payloads larger than this |
Evaluation order
- Rules are evaluated in array order.
- First matching rule wins.
- If no rule matches,
default_actionis applied.
Signing policy bundles
Policy bundles must be HMAC-SHA256 signed before they can be staged:
bridge-node ctl policy-sign \
--bundle-file policy/active/policy.bundle.json \
--config bridge.yamlOutput: Signature: 5e26f3...
Supervisor lifecycle
1. Stage
bridge-node ctl supervisor-stage \
--bundle-file policy/active/policy.bundle.json \
--signature-hex 5e26f3... \
--config bridge.yamlValidates the signature and places the bundle in the staging directory.
2. Promote
bridge-node ctl supervisor-promote \
--staged-path policy/staged/policy-1772149000123.bundle.json \
--config bridge.yamlMoves the staged bundle to active. The previous active bundle is archived to history.
3. Rollback
bridge-node ctl supervisor-rollback --config bridge.yamlRestores the last known good bundle from history.
Best practices
- Always use
default_action: denyin production — explicit allow is safer. - Keep source targeting narrow for critical settlement events.
- Version bundles with immutable, auditable labels (date or hash-based).
- Always stage before promote. Always test rollback.
- Monitor policy denial spikes after promotion — diff the new bundle against the previous one if denials increase.