Implements audit logging for agent interactions to support auditing and dataset generation (fixes #649). New features: - .beads/interactions.jsonl (append-only audit log) - bd audit record: log LLM calls, tool calls, or pipe JSON via stdin - bd audit label <id>: append labels (good/bad) for dataset curation - bd compact --audit: optionally log LLM prompt/response during compaction - bd init: creates empty interactions.jsonl - bd sync: includes interactions.jsonl in staging Audit entries are append-only - labeling creates new entries that reference parent entries by ID. Closes #649 Co-authored-by: Dmitry Chichkov <dchichkov@nvidia.com> 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
972 B
972 B
description, argument-hint
| description | argument-hint |
|---|---|
| Log and label agent interactions (append-only JSONL) | record|label |
Append-only audit logging for agent interactions (prompts, responses, tool calls) in .beads/interactions.jsonl.
Each line is one event. Labeling is done by appending a new "label" event referencing a previous entry.
Usage
-
Record an interaction:
bd audit record --kind llm_call --model "claude-3-5-haiku" --prompt "..." --response "..."bd audit record --kind tool_call --tool-name "go test" --exit-code 1 --error "..." --issue-id bd-42
-
Pipe JSON via stdin:
cat event.json | bd audit record
-
Label an entry:
bd audit label int-a1b2 --label good --reason "Worked perfectly"bd audit label int-a1b2 --label bad --reason "Hallucinated a file path"
Notes
- Audit entries are append-only (no in-place edits).
bd syncincludes.beads/interactions.jsonlin the commit allowlist (likeissues.jsonl).