verify_audit_log
Verify a WorkloadTruth audit log's hash chain integrity to detect edited, reordered, or deleted entries. Run before trusting records for security- or billing-sensitive decisions.
Instructions
Verify that a local WorkloadTruth audit log's hash chain is intact, i.e. no entry was edited, reordered, or deleted after it was written.
Call this before trusting historical classify_workload /
workloadtruth watch records for anything security- or
billing-sensitive -- each log entry's hash covers its own content
plus the previous entry's hash, so any tampering anywhere in the
file breaks the chain from that point forward and this tool will
report exactly where.
Prerequisites: the file at log_file must exist and be a
WorkloadTruth JSONL audit log (produced by write_to_audit_log=True
on classify_workload, or by workloadtruth watch).
Side effects: read-only. Opens and reads log_file from local disk;
never writes, never makes a network call. Safe to call repeatedly
and idempotent -- verifying an unmodified log always returns the
same result.
Parameters: log_file -- path to the JSONL audit log, defaults to
workloadtruth.log.jsonl in the current working directory. Example
call: {"log_file": "workloadtruth.log.jsonl"}.
Returns a dict with valid (bool), message (str -- "chain OK" or
a description of the first broken link found), and entries (int
count of entries verified before any break).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| log_file | No | workloadtruth.log.jsonl |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
No arguments | |||