Immutable audit logging for AI agents — hash-chained event log, integrity verification, EU AI Act compliance
Project description
Agent Audit Trail MCP Server
Immutable audit logging for AI agents with hash-chained event logs, integrity verification, and EU AI Act compliance reporting.
Why This Matters
The EU AI Act (effective August 2026) requires high-risk AI systems to maintain detailed logs of their operations. Article 12 mandates automatic recording of events for the entire lifecycle of high-risk AI systems.
This MCP server provides:
- Tamper-proof logging — Each event includes the SHA-256 hash of the previous entry, forming an unbreakable chain
- Integrity verification — Detect if any log entries have been modified, deleted, or reordered
- Compliance reports — Export audit trails in JSON or human-readable format for regulators
- Cross-agent search — Search events across all agents by keyword, type, or agent ID
- Statistics — Event rates, error rates, and action frequency analysis
How Hash Chain Integrity Works
Entry 1: { data, prev_hash: "000...000", hash: "abc123..." }
Entry 2: { data, prev_hash: "abc123...", hash: "def456..." }
Entry 3: { data, prev_hash: "def456...", hash: "ghi789..." }
If any entry is modified, its hash changes, breaking the chain for all subsequent entries. The verify_integrity tool detects this immediately.
Installation
pip install agent-audit-trail-mcp
Configuration
Add to your MCP client config (e.g. Claude Desktop):
{
"mcpServers": {
"audit-trail": {
"command": "audit-trail-server"
}
}
}
Or with uvx (no install needed):
{
"mcpServers": {
"audit-trail": {
"command": "uvx",
"args": ["agent-audit-trail-mcp"]
}
}
}
Tools
| Tool | Description |
|---|---|
log_event |
Log an immutable audit event with timestamp and hash chain |
get_trail |
Retrieve audit trail for an agent (newest first) |
verify_integrity |
Verify the hash chain is intact (no tampering) |
export_report |
Export audit trail as compliance report (JSON or text) |
search_events |
Search across all audit events by keyword |
get_statistics |
Get audit statistics (events/day, error rate, top actions) |
Data Storage
Audit logs are stored in ~/.agent-audit-trail/ as append-only JSONL files (one per agent). Each line is a JSON object with:
timestamp— ISO 8601 UTC timestampagent_id— Which agent performed the actionevent_type— Category (decision, action, error, access, data_processing)action— What was donedetails— Full descriptionoutcome— Result of the actionprev_hash— SHA-256 hash of the previous entryhash— SHA-256 hash of this entry
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_audit_trail_mcp-0.1.0.tar.gz.
File metadata
- Download URL: agent_audit_trail_mcp-0.1.0.tar.gz
- Upload date:
- Size: 7.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fea9808ab1b57659fd3979fc6422a454416663792a54cf6e1ace0b7bf02ca59f
|
|
| MD5 |
c87b5429296d5e243e87c014ed03b61e
|
|
| BLAKE2b-256 |
9d030e44bbb3e10e02a10bbb1a24767eb69aaaacfda58017d046093d3c566742
|
File details
Details for the file agent_audit_trail_mcp-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agent_audit_trail_mcp-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3288b7fea46bf6b920fcda78d934ae3ca788fafe73d78f2fd335f706efca3795
|
|
| MD5 |
1fb2fa7c0e07e908e98a05be01235fdd
|
|
| BLAKE2b-256 |
1c4dd4d51b299841515193e6cbe94487a725e5f91cb4dc1272ccecc5de963dda
|