feat: Phase 2 signed audit trail — hash chaining, sig verification, verify_chain#3
Merged
Merged
Conversation
…erify_chain
- append_event: threading.Lock + prev_hash SHA-256 chaining on every write
- log_event: ed25519 signature verification against agent-keys.json registry;
AGENT_BUS_VERIFY_SIGNATURES env var controls "warn" (default) or "enforce" mode
- verify_chain tool: walks a JSONL log file, validates hash chain + signatures,
returns per-file summary (total, verified, chain_breaks, sig_failures, unsigned)
- get_status: includes signing.registered_agents + verify_mode fields
- requirements.txt: add cryptography>=41.0
Key registry location: COMMS_DIR/agent-keys.json
{"research": {"pubkey": "<b64>", "fingerprint": "abc12345", "added": "..."}}
Unsigned events from unknown sources are accepted (backwards compatible).
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1471339 to
5efe20d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
threading.Lock+prev_hashSHA-256 chaining (each event records SHA-256 of the previous JSONL line)COMMS_DIR/agent-keys.jsonregistry;AGENT_BUS_VERIFY_SIGNATURES=warn(default) orenforcemode{total, verified, chain_breaks, sig_failures, unsigned_events}per filesigning.registered_agentsandverify_modefieldscryptography>=41.0Key registry format
~/.claude/comms/agent-keys.json:{ "research": {"pubkey": "<base64 pubkey>", "fingerprint": "abc12345", "added": "2026-XX-XX"}, "dev": {"pubkey": "<base64 pubkey>", "fingerprint": "def67890", "added": "2026-XX-XX"} }Rollout notes
warn— signature failures are logged but events are acceptedenforceviaAGENT_BUS_VERIFY_SIGNATURES=enforceafter all agents migratedagent-keys.jsonTest plan
🤖 Generated with Claude Code