Tamper-evident audit
hierarchical-approval/plugins/audit Make the immutable audit trail provably immutable — and safe to ship to external sinks.
-
HashChainAuditAdapterSHA-256 chain; verify() catches edits, deletions, reorders & truncation -
RedactingAuditAdapterstrips PII before external sinks — originals never mutated -
CompositeAuditAdapterfan out to Kafka, S3, CloudTrail with per-sink fault isolation
import { HashChainAuditAdapter } from
'hierarchical-approval/plugins/audit';
const audit = new HashChainAuditAdapter();
const engine = new ApprovalEngine({ adapter, auditAdapter: audit });
// Prove the log was never altered:
await audit.verify(tenantId, instanceId);
// → { ok: true } | { ok: false, brokenAt: 3 }