Provide a tamper-evident, complete record of every agent action for forensic investigation, compliance auditing, and accountability.
Always-on hook on ALL agent actions:
jsonl
{"id":"ACT-20260331-000001","ts":"2026-03-31T14:30:00.123Z","agent":"openclaw-main","session":"sess_abc123","type":"tool_use","tool":"exec","args":{"cmd":"npm test"},"skill":"contract-tester","channel":"telegram","user_hash":"sha256:a1b2c3...","outcome":"success","duration_ms":4200,"prev_hash":"sha256:000000","hash":"sha256:d4e5f6..."}
FieldTypeDescriptionidstringUnique sequential IDtsISO 8601Microsecond timestampagentstringAgent identifiersessionstringSession IDtypeenumtool_use, skill_invoke, channel_in, channel_out, memory_write, config_change, error``toolstringTool name (if applicable)argsobjectSanitized arguments (secrets redacted)skillstringInvoking skillchannelstringSource channeluser_hashstringSHA-256 of user identifier (never raw)outcomeenumsuccess, failure, timeout, blocked``duration_msnumberExecution timeprev_hashstringSHA-256 of previous log entry (chain)hashstringSHA-256 of this entry (including prev_hash)
text
.security/audit-trail/
├── 2026-03-31.jsonl (today, active)
├── 2026-03-30.jsonl (yesterday)
├── 2026-03-29.jsonl.gz (compressed, >7 days)
└── integrity-check.log (chain verification results)
hash = SHA-256( id + ts + type + tool + outcome + prev_hash)entry[n].prev_hash == entry[n-1].hashjq -r '.hash' | sha256sum --checkAgeStorageAccess0-7 daysRaw JSONLDirect read7-90 daysCompressed JSONL.gzDecompress on query90-365 daysArchive (if configured)Restore on request>365 daysPurge (manual only, human approval)—
bash
# All actions by a specific skill
jq 'select(.skill=="contract-tester")' .security/audit-trail/2026-03-31.jsonl
# All failures
jq 'select(.outcome=="failure")' .security/audit-trail/*.jsonl
# Actions in a time window
jq 'select(.ts >= "2026-03-31T14:00" and .ts < "2026-03-31T15:00")' .security/audit-trail/2026-03-31.jsonl
# Channel activity summary
jq -s 'group_by(.channel) | map({channel: .[0].channel, count: length})' .security/audit-trail/2026-03-31.jsonl