AI Audit Trail logo

AI Audit Trail

Tamper-evident audit trails for AI agents β€” Ed25519-signed, hash-chained, EU AI Act ready.

Install AI Audit Trail

Pick your client, then add it in one click or paste the config.

STDIOPython
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "ai-audit-trail": {
      "command": "uvx",
      "args": [
        "ai-audit-trail"
      ]
    }
  }
}

Settings β†’ Developer β†’ Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

We couldn’t confirm it starts correctly

We ran the install command but it didn't respond within our test window β€” this can mean a slow first-time install rather than a real problem.

uvx ai-audit-trail

Process exited before answering initialize.

This is an experimental automated check and can have false negatives β€” missing environment variables, a slow cold install, etc. It doesn’t necessarily mean something’s wrong. Last checked 14d ago.

Overview

Security & health

What it can reach and how reliably it runs β€” from our own checks, not the maintainer’s claims.

ActiveLast checked 2d ago

Recent health check succeeded.

10/10 checks healthy over the last 51d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 5d ago via OSV.dev Β· ai-audit-trail (PyPI)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks β€” not a rating.

GitHub stars4Stargazers on the source repository.
Last commit9d agoMost recent push to the default branch.
Install checkInconclusiveDidn't respond in our test window β€” often a slow first install.
Directory activity3 viewsConfig copies, upvotes, and views on AllMCPs.

From the project README

ai-audit-trail

PyPI version Python License: MIT CI Downloads Tests mypy Ruff OpenSSF Scorecard

Prove what your AI did, why, and that nobody changed the record.

Tamper-evident Decision Receipts with Ed25519 signatures, SHA-256 hash-chains, and formal compliance mappings. No blockchain, no SaaS, no lock-in. Self-hosted, offline-verifiable, Python-native.


Why this exists

The EU AI Act becomes mandatory for high-risk AI systems in August 2026. It requires tamper-evident logs proving every decision was made correctly (Art. 12). Most teams are solving this with normal logging β€” which is neither tamper-evident nor legally defensible in an audit.

ai-audit-trail closes this gap with cryptographic receipts that any auditor can verify offline, without accessing your systems. Same principle as a blockchain β€” without the blockchain overhead, the SaaS dependency, or the vendor lock-in.

Who is this for

  • Regulated AI teams (FinTech, HealthTech, LegalTech, InsurTech) who must prove compliance
  • Enterprise platform teams deploying LLM agents with tool access
  • Security and compliance officers who need audit-ready evidence packages
  • Developers who want pip install and 3 lines of code, not a platform migration

What this library provides

ai-audit-trail provides the technical building blocks that support EU AI Act, ISO 42001, and NIST AI RMF compliance. It does not, by itself, guarantee regulatory compliance β€” compliance is an organizational obligation that extends beyond any single software component. See our Shared Responsibility Model below.


Installation

Terminal
pip install ai-audit-trail                    # Core (Ed25519 + SHA-256 + PII)
pip install "ai-audit-trail[redis]"           # + Redis persistence
pip install "ai-audit-trail[otel]"            # + OpenTelemetry metrics
pip install "ai-audit-trail[all]"             # Everything

Requirements: Python 3.11+ | No external services required | Works air-gapped


Quickstart

server.ts
from ai_audit import (
    AuditConfig, init_audit_config,
    ReceiptCollector, ReceiptStore, ReceiptAction,
    verify_chain, get_verify_key_hex,
)

# 1. Configure once at startup
init_audit_config(AuditConfig(is_production=False))
store = ReceiptStore()

# 2. Wrap every AI request
collector = ReceiptCollector(trace_id="req-1", tenant_id="acme")
collector.set_input("What is our GDPR policy?")
collector.add_check("safety", score=0.02, threshold=0.8, fired=False)
collector.set_output("Our GDPR policy states that...")
collector.set_action(ReceiptAction.ALLOW)
collector.emit(store)
collector.cleanup()

# 3. Verify tamper-evidence
result = verify_chain(store.get_by_tenant("acme"), get_verify_key_hex())
assert result.valid  # Ed25519 + SHA-256 + hash-chain verified

Architecture Overview

Code
Receipt Creation        Verification & Compliance       Agentic AI Audit
─────────────────       ──────────────────────────      ──────────────────
ReceiptCollector   ──>  verify_chain()                  ToolCallReceipt
  set_input()           build_compliance_summary()      TraceGraph (DAG)
  add_check()           build_crosswalk()               BehavioralContract
  set_output()          export_evidence_package()       ProvenanceChain
  set_action()          SPRTMonitor
  emit()                DriftMonitor
       β”‚                EpochManager
       v
  ReceiptStore     ──>  StorageBackend ABC
  (in-memory LRU)       InMemoryBackend
  + Redis (optional)    (your custom backends)
  + AuditBuffer

Core Features

Decision Receipts (Ed25519 + SHA-256 + Hash-Chain)

Every AI pipeline decision produces a Decision Receipt β€” a cryptographically sealed, hash-chained record:

What's provenHow
Input integritySHA-256 of NFKC-normalized, PII-stripped input
Output integritySHA-256 of generated output
Check resultsOrdered check records with scores and thresholds
DecisionAction taken (ALLOW / REJECT / ESCALATE / ...)
Model provenanceModel ID + config digest
Non-repudiationEd25519 signature (libsodium)
OrderingHash-chain linkage (prev_receipt_hash)

Three-stage verification (< 0.1 ms per receipt):

Code
Ed25519 signature  β†’  detects forgery
SHA-256 self-hash  β†’  detects corruption
Hash-chain link    β†’  detects insertions / deletions / reordering

PII Redaction (GDPR Art. 17)

Personal data is stripped before hashing β€” the audit log never contains raw PII.

server.ts
from ai_audit import PiiConfig, PiiMode, PiiType

config = PiiConfig(
    enabled_types=frozenset({PiiType.EMAIL, PiiType.PHONE, PiiType.IP}),
    mode=PiiMode.REDACT,  # or HASH (SHA-256) or MASK (a***m)
)
collector = ReceiptCollector(tenant_id="acme", pii_config=config)
Modealice@corp.com becomes
REDACT[EMAIL]
HASH3d4e5f8a... (deterministic SHA-256)
MASKa***@c***.com

Crypto-Shredding (GDPR Right to Erasure)

Encrypt PII fields with per-tenant AES-256-GCM keys. Destroy the key = data permanently unreadable, hash-chain intact.

server.ts
from ai_audit.shredding import AESGCMDEKStore, encrypt_field, shred_tenant

dek_store = AESGCMDEKStore()
dek_store.create_dek("tenant-acme")

field = encrypt_field("sensitive PII", dek_store, "tenant-acme")
shred_tenant("tenant-acme", dek_store)  # Key destroyed β€” data unrecoverable
# Hash-chain remains mathematically intact (hashes ciphertext, not plaintext)

Compliance & Governance

ISO 42001 / NIST AI RMF Crosswalk

Maps receipt data directly to recognized management controls with evidence pointers.

server.ts
from ai_audit.crosswalk import build_crosswalk, nist_function_map

crosswalk = build_crosswalk(receipts, chain_intact=True)
for entry in crosswalk:
    print(f"[{entry.status}] {entry.framework} {entry.control_id} β€” {entry.control_name}")

nist = nist_function_map(receipts)
print(nist["GOVERN"].coverage)   # 0.0–1.0
print(nist["MEASURE"].status)    # PASS / PARTIAL / FAIL

ISO 42001 Controls: A.6.2.8 (Logging), A.7.5 (Provenance), A.6.2.6 (Performance), A.8.4 (Output), A.5.3 (Risk) NIST AI RMF: GOVERN, MAP, MEASURE, MANAGE β€” with quantitative coverage scores

EU AI Act Compliance Reports

server.ts
from ai_audit.report import ComplianceReportGenerator

gen = ComplianceReportGenerator(summary, verify_key_hex=get_verify_key_hex())
gen.to_markdown()   # Documentation portals
gen.to_json()       # Automated pipelines
gen.to_html()       # Air-gapped servers

Covers Art. 9 (Risk), Art. 12 (Record-Keeping), Art. 13 (Transparency), Art. 17 (Quality), Art. 18 (Logging).

Evidence Package Export (Offline Verification)

Self-contained signed ZIP for external auditors β€” no system access required.

server.ts
from ai_audit.export import export_evidence_package, verify_evidence_package

export_evidence_package(receipts, verify_key_hex, signing_key, "audit_2026.zip")
# Bundle: receipts.jsonl + chain_metadata.json + public_key.hex + manifest.json (signed) + verify.py

# Auditor verifies offline:
# python -m ai_audit verify audit_2026.zip

Continuous Certification (SPRT)

Sequential Probability Ratio Test β€” live compliance status per tenant.

server.ts
from ai_audit.sprt import SPRTMonitor

monitor = SPRTMonitor(tenant_id="acme")
for receipt in receipts:
    state = monitor.update(is_reject=(receipt.action == "reject"))
print(state.status)      # CERTIFIED | MONITORING | FLAGGED
print(state.confidence)  # 0.0–1.0

Drift Detection (Jensen-Shannon Divergence)

Detects behavioral shifts in real-time β€” pure Python, no scipy required.

server.ts
from ai_audit.drift import DriftMonitor

monitor = DriftMonitor(window_size=100)
for receipt in receipts:
    state = monitor.update(receipt.action.value)
print(state.status)       # STABLE | DRIFTING | CRITICAL_DRIFT
print(state.drift_score)  # JSD 0.0–1.0

Agentic AI Audit (World-First)

Agent Behavioral Contracts

Formal (p, delta, k)-Satisfaction with Reliability Index Theta β€” transforms EU AI Act requirements into testable specifications.

server.ts
from ai_audit.contracts import BehavioralContract, Constraint, ContractMonitor

contract = BehavioralContract(
    contract_id="safety-v1",
    constraints=[
        Constraint(name="no_pii_leak", kind="hard", field="action", operator="!=", value="reject"),
        Constraint(name="quality", kind="soft", field="checks.safety.score", operator="<=", value=0.1, delta=0.5),
    ],
)
monitor = ContractMonitor(contract)
for receipt in receipts:
    state = monitor.evaluate(receipt)

Reviews

No reviews yet β€” be the first to share how it worked for you.

Frequently Asked Questions about AI Audit Trail

ai-audit-trail is an MCP server that provides tamper-evident audit trails for AI agents using Ed25519-signed, SHA-256 hash-chained decision receipts. It is self-hosted, Python-native, and supports offline verification without blockchain or SaaS. The project provides technical building blocks for EU AI Act, ISO 42001, and NIST AI RMF compliance, not guaranteed compliance.

Install ai-audit-trail with pip using `pip install ai-audit-trail`. Python 3.11 or later is required, and the core package needs no external services. Optional extras provide Redis persistence, OpenTelemetry metrics, or all available features.

Verify an audit chain with `verify_chain` and the verification key, such as `verify_chain(store.get_by_tenant("acme"), get_verify_key_hex())`. A valid result confirms the Ed25519 signatures, SHA-256 hash chain, and receipt sequence were verified.

ai-audit-trail does not guarantee regulatory compliance. It provides technical building blocks that support EU AI Act, ISO 42001, and NIST AI RMF compliance, while compliance remains an organizational responsibility extending beyond a single software component.

Related MCP servers

Add a badge to your READMEShow it’s listed β€” live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewAI Audit Trail AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/ai-audit-trail?style=directory)](https://allmcps.com/mcp/ai-audit-trail)
HTML Embed
<a href="https://allmcps.com/mcp/ai-audit-trail"><img src="https://allmcps.com/api/badge/ai-audit-trail?style=directory" alt="AI Audit Trail on AllMCPs" /></a>