Skip to main content

Module audit

Module audit 

Source
Expand description

Audit-log event stream — OSS data format.

Every user-visible mutation (ledger append/approve/reject/withdraw/ supersede, effect_declare) and every policy decision is emitted as an AuditEvent to a configurable AuditSink. The OSS binary ships only NullSink (no-op) — the hash-chained file sink with tamper-evident verification lives in the commercial agentstatedeveloper-audit-pro crate (Enterprise tier).

The schema here is shared between OSS and Pro: an OSS asd binary can read a log written by asd-pro (forward-compatible degrade), it just can’t write chain-signed events or verify the chain.

Modules§

event_types
Canonical event type strings. Stable — downstream SIEM rules key on these.

Structs§

AuditEvent
One audit entry. Flat, JSON-serializable. Shared data format — event_hash / prev_event_hash are empty strings / None when the OSS binary emits (via NullSink) and filled in by the Pro sink.
NullSink
Swallows every event. The OSS default — tamper-evident file-backed audit is a commercial feature (see agentstatedeveloper-audit-pro).

Constants§

HASH_PREFIX
Prefix for blake3-based event hashes. Versioned so we can change the algorithm later without ambiguity. Shared between OSS readers and Pro writers.

Traits§

AuditSink

Functions§

emit_audit
Fire-and-forget audit emit. Logs sink failures to stderr but never propagates — audit issues must never block the user’s operation.
read_jsonl
Read back events from a JSONL file. Shared by OSS read-only consumers (asd audit tail) and the Pro verify_chain code path.