Audit Trail
Every tool call is logged to a hash-chained JSONL file. Each entry includes a SHA-256 hash of the previous entry — tamper with any record and the chain breaks.Why Hash-Chained?
In regulated environments, you need to prove what your agent did. A hash chain means no one can edit history without detection:- Tamper-evident: Modifying a single log entry breaks the chain
- Verifiable:
rampart audit verifychecks the entire chain in seconds - Append-only: New events reference the hash of the previous event
- No external dependencies: Works offline, no blockchain or external services
Audit Log Location
By default, audit logs are stored at:--audit-dir:
Event Format
Each audit event is a single-line JSON object:Key Fields
| Field | Description |
|---|---|
timestamp | ISO 8601 timestamp (UTC) |
id | Unique event identifier |
tool | Tool name (exec, read, write, fetch, mcp) |
agent | Agent identifier (e.g., claude-code, aider) |
session | Session label (auto-detected from git: repo/branch) |
request | Tool-specific parameters (command, path, URL, etc.) |
decision.action | Policy decision (allow, deny, ask, watch) |
decision.matched_policies | List of policy names that matched |
decision.message | Human-readable explanation |
decision.eval_duration_us | Policy evaluation time in microseconds |
prev_hash | SHA-256 hash of the previous event |
this_hash | SHA-256 hash of this event (excluding this_hash field) |
Viewing Audit Logs
Tail Recent Events
Follow Live Events
tail -f).
Pretty-Print Logs
Filter by Decision
Limit Output
Searching Audit Logs
Verifying Chain Integrity
Check that the audit log hasn’t been tampered with:Audit Statistics
Get a breakdown of decisions:Example Audit Events
Allowed Command
Denied Command
Approval Request
resolved, resolved_by, and resolved_at fields — only present when audit: true is set.
Credential Access Blocked
Log Rotation
Rampart rotates audit logs automatically:- Daily rotation: New file created at midnight UTC
- Naming:
audit-2026-03-03.jsonl - Retention: Keeps last 90 days by default
- Chain continuity: First entry in new file references last entry in previous file
Exporting Audit Logs
JSON Export
CSV Export
Protecting Audit Logs
Runrampart serve as a separate user to prevent agent tampering:
- Audit log tampering: Agent can’t modify or delete events
- Credential harvesting: Agent can’t read previously-logged secrets
- Chain verification bypass: Agent can’t inject forged events
Performance
Audit logging adds negligible overhead:- Write latency: < 1ms per event
- Disk usage: ~500 bytes per event
- Hash computation: SHA-256 in ~10µs
- Chain verification: ~1,000 events/sec
See Also
- SIEM Integration — Export to Splunk, Wazuh, QRadar
- Approval Flow — Human-in-the-loop approvals
- Live Dashboard — Real-time event monitoring