/protect-mcp:audit-chain [--last N] [--dir path]from protect-mcp
Verifies the integrity of a receipt chain by checking every signature and hash link. Detects insertions, deletions, and tampering across the entire audit trail.
Ships in protect-mcp. Installing the plugin adds it to Claude Code.
Verify the integrity of an entire receipt chain, not just a single receipt.
Walks every receipt in ./receipts/ (or the specified directory), verifies
each signature individually, and confirms that each parent_receipt_id
correctly links to the previous receipt.
/audit-chain # Walk all receipts in ./receipts/
/audit-chain --last 50 # Verify only the last 50 receipts
/audit-chain --dir /var/log/receipts # Use a different directory
*.json files in the target directoryevent_time to establish chronological orderparent_receipt_id matches the previous receipt's receipt_id# Default: all receipts
RECEIPT_DIR="${2:-./receipts}"
# Run verification
if [ -n "$1" ] && [ "$1" = "--last" ]; then
N="$2"
ls -1 "$RECEIPT_DIR"/*.json | sort | tail -n "$N" | xargs npx @veritasacta/verify
else
npx @veritasacta/verify "$RECEIPT_DIR"/*.json
fi
For chain-link verification (which @veritasacta/verify handles with
--chain flag):
npx @veritasacta/verify --chain "$RECEIPT_DIR"/*.json
Audit chain verification: PASSED
Scanned: 247 receipts
Time range: 2026-04-12T08:00:00Z to 2026-04-15T10:30:00Z
Chain head: rec_8f92a3b1
Chain root: rec_0a1b2c3d
Signatures: 247/247 valid ✓
Chain links: 246/246 correct ✓
Parent breaks: 0
Signer keys: 1 unique (4437ca56815c0516...)
All 247 receipts in the chain verify correctly. No tampering detected.
Audit chain verification: FAILED
Scanned: 247 receipts
Signatures: 247/247 valid ✓
Chain links: 245/246 correct (1 break detected)
BREAK DETECTED at receipt #142:
Receipt: rec_7a3b9c1e
Claimed parent: rec_8d4f2e91
Expected parent: rec_6b5c1a8d
This means either:
- A receipt was inserted between #141 and #142 (insertion attack)
- A receipt was deleted from the chain at position #142 (deletion attack)
- The signer used the wrong parent reference (bug)
To diagnose:
1. Check if rec_8d4f2e91 exists anywhere in the receipt directory
2. Check if rec_6b5c1a8d's successor is missing
3. Compare against any external witness or backup
All individual signatures are valid, so the receipts themselves are
authentic. The chain structure is compromised.
Audit chain verification: FAILED
Scanned: 247 receipts
Signatures: 246/247 valid (1 tampered)
TAMPERED RECEIPT at position #89:
Receipt: rec_3e8a9c7d
Event time: 2026-04-13T14:22:01Z
Tool: Bash
Signer: 4437ca56815c0516...
The signature for this receipt does not verify. The receipt has been
modified after signing.
The chain links ARE intact (parent/child references are consistent),
so this is a payload tampering event rather than a structural attack.
Compare the payload against any known-good copy. The altered field is
hidden in the canonicalized data.
/verify-receipt for single-receipt verificationFiles this command reads when invoked
What the command file sets; muted values are Claude Code's defaults
7-day visitors to each command page
2 commands in this plugin
Claude Code installs this plugin but refuses to load it
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
hooks/hooks.json: hooks.PreToolUse.0: Hook matcher "hooks" must be an array of hook entries; received undefined — a PreToolUse/PermissionRequest hook that cannot be loaded may be what guards the permissions declared beside it, so nothing it sits in is applied until the entry is fixed or removed
Checked against Claude Code 2.1.332. The listing below is what the repository ships; Claude Code doesn't load it as published.
9 plugins ship this exact command · first indexed Apr 21, 2026
Other plugins' commands for the same job