Metadata-Version: 2.4
Name: powerailabs-acttrace
Version: 0.4.1
Summary: Audit: a tamper-evident, hash-chained, auto-populated record of every AI decision — verifiable offline. Evidence, not a compliance guarantee.
Author: Raghav Mishra
License-Expression: MIT
Requires-Python: >=3.11
Requires-Dist: powerailabs-core<0.2,>=0.1
Description-Content-Type: text/markdown

# powerailabs-acttrace

A tamper-evident, append-only record of every AI decision — what model, what context, what it
cost, which tools, and who signed off — mapped to control templates and exportable as an evidence
pack. No database, no infra: integrity comes from a hash chain, not a server.

**Audit-ready evidence in 5 lines — and verifiable offline.**

![PyPI](https://img.shields.io/pypi/v/powerailabs-acttrace) ![license](https://img.shields.io/badge/license-MIT-blue) · `pip install powerailabs-acttrace`

```python
from powerailabs.core import instrument
from powerailabs.acttrace import AuditLog

client = instrument(OpenAI())
audit = AuditLog(system="loan_triage", risk_tier="high", signing_key="…")  # auto-subscribes

with audit.decision(input=application, actor="agent") as d:
    resp = client.chat.completions.create(model="gpt-4o", messages=msgs)  # auto-logged
    d.record(model="gpt-4o", prompt_id="triage@v3")          # cost/context captured for free
    d.human_oversight(reviewer="ops@bank", action="approved")

audit.export("evidence_q3.jsonl", framework="eu_ai_act")     # evidence pack (also nist_rmf)
```

```bash
acttrace verify evidence_q3.jsonl --key "…"   # re-walks the chain + checks signatures; non-zero if broken
```

**Wrap-around, auto-subscribing.** Cost (`tokenguard`) and context decisions (`contextkit`) ride
the same bus, so the log fills itself. Each entry is hash-chained and optionally **HMAC-signed**;
PII/secrets in payloads are **redacted by default**; `export(framework=...)` annotates EU AI Act /
NIST RMF control IDs.

> Produces **evidence to support** compliance — not legal advice, not a guarantee. Control
> mappings are starting templates for your compliance team.

See [`docs/acttrace.md`](../../docs/acttrace.md) · [CHANGELOG](CHANGELOG.md). *Part of the PowerAI Labs stack — github.com/PowerAI-Labs/powerailabs.*
