Metadata-Version: 2.4
Name: powerailabs-acttrace
Version: 0.2.0
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.**

![status](https://img.shields.io/badge/status-building-yellow) ![license](https://img.shields.io/badge/license-MIT-blue)

🚧 building (v0) · `pip install powerailabs-acttrace` · `from powerailabs.acttrace import AuditLog`

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

client = instrument(OpenAI())
audit = AuditLog(system="loan_triage", risk_tier="high")     # auto-subscribes to core events

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
```

```bash
acttrace verify evidence_q3.jsonl     # re-walks the hash chain; exits non-zero if broken
```

**Wrap-around, auto-subscribing.** Because cost (`tokenguard`) and context decisions (`contextkit`)
ride core's shared event stream, the log fills itself — install the stack, call `instrument()`
once, and the record already knows the model, the context, the cost, and the tools. Each entry is
chained (`hash = sha256(prev + canonical(entry))`), so any later edit breaks the chain.

> `acttrace` produces **evidence to support** compliance — it is **not** legal advice and not a
> compliance guarantee. Control mappings are a starting template for your compliance team.

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