Skip to content

audit export-bundle

Terminal window
sbo3l audit export-bundle [OPTIONS] --out <FILE>

Exports a contiguous slice of the audit chain into a single signed bundle (sbo3l.audit_bundle.v2). One bundle = many events; the verifier checks every link plus a per-bundle root signature.

Flags

FlagDefaultEffect
--out <FILE>requiredpath to write the bundle
--from <RFC3339>epoch startexport events at-or-after this timestamp
--to <RFC3339>nowexport events at-or-before this timestamp
--agent-pubkey <ED25519>allfilter to one agent
--max-events <N>unlimitedhard cap on bundle size
--gzipoffgzip the output

Time filtering is inclusive at both ends. The bundle index records the actual [from, to] covered.

Exit codes

CodeMeaning
0OK — bundle written
1IO error — output path unwritable, daemon unreachable
2semantic — chain has gaps in the requested range; bundle would be incomplete
3nothing-to-do — no events in the requested range

Bundle shape

{
"version": "sbo3l.audit_bundle.v2",
"bundle_id": "01HZRG...",
"covers_from": "2026-04-29T00:00:00Z",
"covers_to": "2026-04-30T23:59:59Z",
"event_count": 4219,
"first_event_hash": "0x...",
"last_event_hash": "0x...",
"events": [/* ... event_count entries ... */],
"bundle_signature": "ed25519:..."
}

The bundle signature covers bundle_id || first_event_hash || last_event_hash || event_count, so a tampered slice fails the bundle-level check before per-event verification even runs.

Examples

Daily compliance export

Terminal window
sbo3l audit export-bundle \
--from 2026-05-01T00:00:00Z \
--to 2026-05-01T23:59:59Z \
--gzip --out bundles/2026-05-01.json.gz

Per-agent slice

Terminal window
sbo3l audit export-bundle \
--agent-pubkey ed25519:9aF3... \
--max-events 1000 \
--out research-01-recent.json

Round-trip verification

Terminal window
sbo3l audit export-bundle --out bundle.json
sbo3l audit verify --mode strict --bundle bundle.json
# Expected: bundle OK · 4219 events · root 0x... · rc=0

See also