cendor-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.
Detect and prove: 20 categories of secrets, PII & special-category data — block / warn / redact in one line, offline — every decision in a hash chain you can verify without a server.
·
pip install cendor-acttrace
Using an AI coding assistant? npx @cendor/init (TS) / uvx cendor-init (Python) wires it up — or point it at cendor.ai/docs/for-ai-assistants.
from cendor.core import instrument
from cendor.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)
acttrace verify evidence_q3.jsonl --key "…" # re-walks the chain + checks signatures; non-zero if broken
Highlights
- Offline detection engine + policy — a validator-gated
Detectorregistry spanning secrets, PII, financial, government-ID, free-text credentials, and GDPR special-category data (20 categories), plus aPolicythat maps each toallow·flag·redact·block. Regex + local checksums (Luhn / IBAN mod-97 / Verhoeff / ABA) — no model, no network, no account. Presets:Policy.default()/gdpr()/pci()/strict().
from cendor.acttrace import scan, redact, Policy
scan("card 4111 1111 1111 1111 for alice@example.com") # -> [Finding(credit_card…), Finding(email…)]
cleaned, findings = redact({"note": "ping alice@example.com"}, Policy.default())
# cleaned == {"note": "ping <redacted>"} — findings report counts, never the raw value
audit = AuditLog(system="triage", policy=Policy.gdpr()) # special-category → block, PII → redact
- Enforce + record in one line —
guard(policy, audit=…)returns a callable forcore's interceptor seam: it enforces the policy (block a disallowed call before it runs, or warn) andacttracerecords the decision as a tamper-evidentpolicy_flag. Recorder and enforcer stay separate —coreis what stops the call.
from cendor.core.instrument import add_interceptor
from cendor.acttrace import AuditLog, Policy, guard, PolicyViolation
audit = AuditLog(system="support_bot", risk_tier="high", signing_key="ops-key")
add_interceptor(guard(Policy.gdpr(), audit=audit)) # a special-category call is blocked + recorded
- Auto-populating — construct an
AuditLogand it subscribes to the bus: every LLM/tool call, plus cost (tokenguard) and context decisions (contextkit) on the same stream, becomes an entry — no per-call wiring. - Bounded memory for long-running logs —
AuditLog(path="audit.jsonl", max_entries=N)caps the in-memory entry ring so a multi-day agent doesn't grow memory per event. The file stays the complete, verifiable chain (verify()/export()read it),evicted_from_memorycounts what left memory, and the default (None) is unbounded. Bound together withpath=. - Tamper-evident hash chain —
verify()catches edits, reordering, and tail-truncation. The pack's_metahead+count catch truncation, but that header is only authenticated when the log is HMAC-signed and youverify(key=…)— the header itself is signed, so a rewritten_metafails. Without a key it's an unauthenticated in-file check, so pass an out-of-bandexpected_head=(captured fromlog.headat write time) for an authoritative completeness guarantee. Each entry is optionally HMAC-signed too. - Decisions & oversight —
decision()groups a unit of work;d.record(...)andd.human_oversight(reviewer, action)capture Art. 14-style sign-off. - Compliance evidence packs —
export(framework=…)annotates control IDs for EU AI Act, ISO/IEC 42001, GDPR, and NIST AI RMF (starting templates, not certified mappings), and a_meta.summary(counts of decisions, oversight, flags by action/severity) gives a reviewer the at-a-glance read first. PII redaction on by default (swap inredactor=). - Opt-in extras, defaults unchanged —
enable_locale_pack("uk", "in")(UK NINO, India Aadhaar — Verhoeff-checked),enable_entropy_detector()(high-entropy generic secrets — noisy), and NER-backed name/address redaction viapip install "cendor-acttrace[ner]"(Microsoft Presidio, still offline). All strictly opt-in — the zero-extra install stays pure-regex. - Auto-flag by policy — every auto-captured entry is scanned against the full registry, and each detection appends a
policy_flagwith its resolved action (redacted/flagged/blocked), severity, and category — so "we removed / flagged / blocked this" is in the hash chain, not silent (flag_on_redact=Trueby default; a customredactor=owns its own flagging). Detection scrubs the record; block oncore's interceptor seam is the pre-send control. - Policy flags (validation) —
audit.flag(reason, action="blocked", …)records a tamper-evidentpolicy_flag(and returns the chained entry) when your pre-flight guard refuses input that shouldn't be processed — so the refusal is auditable, not just the calls that ran:
from cendor.core.instrument import add_interceptor, MISS
def guard(call): # your pre-flight policy guard
if my_policy_disallows(call): # YOUR rule
audit.flag("special-category data", action="blocked") # acttrace records the refusal
raise PolicyViolation("blocked") # your guard enforces it
return MISS
add_interceptor(guard) # the blocked call never reaches the bus — flag() is its only record
Produces evidence to support compliance — not legal advice, not a guarantee. Control mappings are starting templates for your compliance team.
See docs/acttrace.md · CHANGELOG. Part of the Cendor stack — github.com/cendorhq/cendor-libs. Powered by PowerAI Labs. Apache-2.0; provided "as is", without warranty — use at your own risk (LICENSE §7–8).
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 cendor_acttrace-1.5.0.tar.gz.
File metadata
- Download URL: cendor_acttrace-1.5.0.tar.gz
- Upload date:
- Size: 62.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
87bea01e283359255158abbc58f66312397dcf479d370d121769a32f2713ee67
|
|
| MD5 |
74bd19e37e5c84c8e13551dc1bd94fa3
|
|
| BLAKE2b-256 |
cfdf1758facde19520ffde8a0882952d912c3cd16d1b3af8ceb7c7cd25af26af
|
Provenance
The following attestation bundles were made for cendor_acttrace-1.5.0.tar.gz:
Publisher:
release.yml on cendorhq/cendor-libs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cendor_acttrace-1.5.0.tar.gz -
Subject digest:
87bea01e283359255158abbc58f66312397dcf479d370d121769a32f2713ee67 - Sigstore transparency entry: 2165243245
- Sigstore integration time:
-
Permalink:
cendorhq/cendor-libs@94a809ff7d205f5018157e1b3455eaa1c0e8f742 -
Branch / Tag:
refs/tags/acttrace-v1.5.0 - Owner: https://github.com/cendorhq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@94a809ff7d205f5018157e1b3455eaa1c0e8f742 -
Trigger Event:
push
-
Statement type:
File details
Details for the file cendor_acttrace-1.5.0-py3-none-any.whl.
File metadata
- Download URL: cendor_acttrace-1.5.0-py3-none-any.whl
- Upload date:
- Size: 42.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3239ba72bf8cefd263fb37fb591c4e16ad93d649722889d0659f849e308f8c8e
|
|
| MD5 |
18e81013d6901eda1164fc1a14eca975
|
|
| BLAKE2b-256 |
e4472b78d7ec7e4ef0c977415d665e5d0f9d520d4746b963aeeb4ac5b87c279b
|
Provenance
The following attestation bundles were made for cendor_acttrace-1.5.0-py3-none-any.whl:
Publisher:
release.yml on cendorhq/cendor-libs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
cendor_acttrace-1.5.0-py3-none-any.whl -
Subject digest:
3239ba72bf8cefd263fb37fb591c4e16ad93d649722889d0659f849e308f8c8e - Sigstore transparency entry: 2165243249
- Sigstore integration time:
-
Permalink:
cendorhq/cendor-libs@94a809ff7d205f5018157e1b3455eaa1c0e8f742 -
Branch / Tag:
refs/tags/acttrace-v1.5.0 - Owner: https://github.com/cendorhq
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@94a809ff7d205f5018157e1b3455eaa1c0e8f742 -
Trigger Event:
push
-
Statement type: