Skip to main content

Atelya Attest

tests License: Apache-2.0 Python 3.10+ Dependencies: zero PyPI

Can you prove your AI agent's memory wasn't tampered with?

Atelya Attest gives agent memory a cryptographic paper trail: every memory operation is hash-chained, the chain head is checkpointed into an external witness ledger, and GDPR erasure leaves a verifiable marker instead of a silent hole. Pure Python stdlib — your auditor can rewrite the verifier in an afternoon.

atelyaos.com — live tamper demo, dated benchmarks, and the engine side of the project.

pip install atelya-attest

No install is required either: the tools are stdlib-only and run straight from a clone (python3 amem_attest.py --help).

0.2.0 (2026-11-04) adds HMAC erasure markers, hard-purge reach, the attest-chain guard, strict op-log parsing with repair, and post-purge hooks, and fixes option order on older Pythons; see CHANGELOG.md.

60-second proof

printf '{"op":"add","id":"m1","text":"patient allergic to penicillin","created_at":1718000000}\n' > log.jsonl
atelya-govern attest log.jsonl --out chain.jsonl
atelya-govern verify-chain chain.jsonl
# ✅ VERIFIED — intact: 1 entries, root=…

python3 -c "import pathlib as p; f=p.Path('chain.jsonl'); f.write_text(f.read_text().replace('penicillin','aspirin'))"
atelya-govern verify-chain chain.jsonl
# ❌ TAMPER DETECTED at seq=0: curr_hash mismatch  (exit 1 — CI-ready)

What you get

Capability Command The guarantee
Seal a memory log atelya-govern attest every event hash-chained; one ROOT commits the whole history
Verify integrity atelya-govern verify-chain a single flipped byte fails at the exact record, exit 1
Keyed chains --key / --keyfile / $ENV (HMAC-SHA-256) wrong key fails; empty/whitespace keys are refused — no silent HMAC→SHA-256 downgrade
External anchoring atelya-anchor anchor / check / latest rewrite-and-rechain attacks surface as ANCHOR CONFLICT; a forgotten --label fails loudly and lists what exists instead of silently passing
GDPR erasure atelya-govern erase [--hard] soft = auditable forget (text retained); hard = the record and every event naming it removed from the op-log and its side files, marker records only an HMAC-SHA-256 of the pattern (key in <data_dir>/.erasure_key) — the erasure is recorded, and without the key the pattern cannot be confirmed by hashing guesses; refuses while the default attest chain exists (see Guarantees)
Audit views audit / lineage / conflicts / summary full timeline, one record's life, flagged contradictions
Retention retention --max-age / --max-active age/cap-based retirement, logged like everything else
Post-purge hooks entry-point group atelya.purge_hooks after every hard erase/retention, each installed hook gets the purged ids, SHA-256 digests of their texts and (erase only) the matcher — never the text — so a product can remove its own copies; the CLI prints every hook's outcome (or that none is installed) and exits 1 if one failed
Auditor export audit --out report.json (or .csv) machine-readable evidence for compliance packs
Self-tests --selftest on all three tools known-answer vectors, runnable anywhere, offline

How it works

 memory op-log (JSONL)        attest              external witness
 add / supersede / forget ──► hash chain ──ROOT──► ledger (append-only,
 erase(soft|hard)             (± HMAC)             monotonic, C2SP-style
        │                        │                 consistency checks)
        └── every event ─────────┘
  • Each entry stores prev_hash + curr_hash = H(prev ‖ payload); the final hash is the ROOT commitment.
  • Anchoring follows the transparency-log discipline (RFC 6962 / C2SP tlog-checkpoint spirit): checkpoints must be monotonic and consistent with everything previously anchored — so rewriting history and re-chaining passes self-verification but is caught against the ledger.
  • Everything is line-oriented JSON on disk. No database, no daemon, no network, no dependencies.

Auditors: ATTESTATION.md gives the exact hash construction (precise enough to write your own verifier), a threat model per adversary capability, the regulatory control mapping, and a copy-paste runbook.

Use it from Python

from amem_attest import build_chain, verify_chain, root_of

events = [{"op": "add", "id": "m1", "text": "patient allergic to penicillin"}]
chain = build_chain(events, key=None)        # key=b"..." switches to HMAC-SHA256
print(root_of(chain))                        # the commitment you anchor / publish
ok, bad_seq, reason = verify_chain(chain, key=None)

Mutate any field of any entry and verify_chain returns (False, <seq>, <why>) — sequence gaps, broken links, and payload edits are all distinguished.

The attack a chain alone cannot catch

An attacker with write access can tamper and rebuild the whole chain — the file then verifies internally. The transparency-log answer: checkpoint the head into a ledger the writer cannot touch, then check consistency later.

atelya-attest attest log.jsonl --out chain.jsonl
mkdir -p ~/anchors        # in production: a different account/host/WORM store
atelya-anchor anchor chain.jsonl --ledger ~/anchors/anchors.jsonl --label prod

# attacker rewrites the op-log AND re-attests the whole chain:
python3 -c "import pathlib as p; f=p.Path('log.jsonl'); f.write_text(f.read_text().replace('penicillin','aspirin'))"
atelya-attest attest log.jsonl --out chain.jsonl

atelya-attest verify chain.jsonl                 # ✅ VERIFIED — the chain alone is blind
atelya-anchor check chain.jsonl --ledger ~/anchors/anchors.jsonl --label prod
# ❌ ANCHOR CONFLICT … history rewritten (same-position different-root) — exit 1

Run the ledger under separate control (different account/host/WORM store); separation of duties is what turns "detects accidents" into "detects insiders".

Guarantees — and non-guarantees

  • Tamper-EVIDENT, not tamper-proof. Anyone claiming tamper-proof is overselling. Detection is the guarantee; prevention needs your storage controls, and rewrite-resistance needs the external anchor (shipped).
  • A forgotten --label on check is treated as an operator error, not a pass: the tool fails and lists the labels the ledger actually holds.
  • Hard-erase removes the record from the op-log and its side files but never the fact of erasure: a purge marker (an HMAC of the pattern, never the text) stays in the op-log. The chain stores every event verbatim, so a hard purge refuses while the default chain file (<oplog>.attest.jsonl) exists; --drop-attest deletes it, with the history it recorded. A chain built after the purge starts again from GENESIS, so checking it against a root anchored before the purge reports ANCHOR CONFLICT, as for any rewrite. Chains written elsewhere with --out are neither checked nor cleaned. A chain that stores only hashes and can be verified across purged positions (attest v2) is not implemented.
  • Trust boundary: the verifier is ~200 lines of stdlib Python. Don't trust this repo — read it, or rewrite it.

Verify it yourself

From a clone (the 211-test suite lives here, not in the wheel):

python -m pytest tests/ -q      # 211 tests: known-answer vectors, tz-matrix,
                                # tamper/reorder/truncation, erasure semantics
atelya-attest --selftest && atelya-anchor --selftest && atelya-govern --selftest
# ^ these three work from a pip install too — offline, no network

We pre-register benchmark pass lines and publish the misses: the most recent full-system billing run (2026-07-08) missed our own bar by 1.5 points, after two runs on 2026-06-11 that met it (figures under About Atelya OS below). Those runs are recorded in the engine's changelog, which is not published here; this repo's CHANGELOG covers the attest layer only.

Where this fits

Atelya Attest is a bolt-on evidence layer, not a memory store — there is nothing to migrate. If your memory system can emit one JSON event per line (add / supersede / forget / erase), you get:

  • a hash chain over that lifecycle, committed by a single ROOT
  • pinpoint verification — TAMPER DETECTED at seq=N, exit 1, CI-ready
  • external anchoring that catches whole-history rewrites
  • GDPR soft-forget / hard-purge with HMAC-SHA-256 markers
  • auditor exports (JSON / CSV) and three offline --selftests

Deliberately no performance comparisons: run your own eval, on your own data.

Why now

The EU AI Act's logging/record-keeping duty (Art. 12) for high-risk AI systems is coming with runway: the Digital Omnibus moved standalone high-risk (Annex III) duties to 2 December 2027, while GDPR erasure is enforceable today (dates verified 2026-07). This layer produces the evidence trail those audits ask for; sources and control mapping (EU AI Act / SOC 2 / NIST SP 800-92) live in ATTESTATION.md.

FAQ

Is this "tamper-proof"? No — tamper-evident, plus external anchoring against rewrite-and-rechain. See Guarantees above.

We already have a memory stack. Keep it. If it can emit JSONL events, the attest layer bolts on today — three commands, zero dependencies, nothing replaced.

You don't have SOC 2 — why would our auditor care? Because they never have to trust us: the verifier is stdlib, offline, and rewritable in an afternoon, and our benchmark misses are published. Certifications are roadmap; verifiability ships now.

About Atelya OS

Atelya Attest is the open, self-verifiable layer of a larger system. The engine — semantic memory with same-key supersede, drop-in closed-API orchestration and KV-native serving — is not published here. Measured on our own bills, not extrapolated, in the engine's full-system billing harness (one 24-turn session per run): memory tokens −76.8% at turn 12 (2026-07-08); final turn −88.0% and −87.1% (two runs, 2026-06-11) and −84.5% (2026-07-08 rerun); full-system saving including the extraction tax +39.1% and +37.7% (2026-06-11, inside our own pre-registered line) and +33.5% (2026-07-08, which missed that line by 1.5 points — published as measured). Self-hosted KV reuse (CacheBlend, LongMemEval-S, n=200 per run, Qwen2.5-7B-AWQ on one RTX 4070, in-process reference): 6.12× cheaper prefill in both runs, at 97.5% per-query agreement with a cold full prefill (2026-06: 195/200 same verdict from an independent LLM judge, claude-haiku-4-5 at temperature 0) and 96.5% (2026-07-11 rerun: 193/200 under lexical-match scoring, no LLM judge). Both measured with the engine's bench_real.py (not published here). The speedup cannot be demonstrated on WSL2.

We're onboarding 3 design partners: regulated teams who want the memory layer and the evidence layer, with our hostile acceptance suites run on their machines. → ronald@atelyaos.com

Roadmap

  • PyPI package (pip install atelya-attest) — release 0.2.0 (2026-11-04)
  • External anchor ledger with monotonic/consistency checks
  • Erasure markers that never hold the literal pattern (HMAC-SHA-256 with a per-data-directory key since 0.2.0; plain SHA-256 in 0.1.x)
  • Optional Ed25519 / ML-DSA signing (stdlib HMAC stays the default)
  • Live-store invalidation after hard-erase: post-purge hooks (atelya.purge_hooks, since 0.2.0); engine 0.3.0 uses them to clean its session and memory-tool files, and its running servers reload the store when the purge epoch file changes. GPU KV caches built from erased text are not covered.

How this was built

AI-assisted, human-verified. Much of this code was written with AI assistance. Every claim in this README was executed and checked against real output before publication — that is what the 211-test suite, the four adversarial acceptance suites, and the published benchmark misses in CHANGELOG.md are for. Where a run failed, the failure is in the history rather than edited out.

Security & license

Vulnerabilities: see SECURITY.md (private reporting). Apache-2.0 — see LICENSE.

Metadata

Release files for atelya-attest 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for atelya-attest 0.2.0
File Size Uploaded Provenance Actions
atelya_attest-0.2.0.tar.gz 58.7 kB Without provenance Details for atelya_attest-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for atelya-attest 0.2.0
File Interpreter ABI Platform Actions
atelya_attest-0.2.0-py3-none-any.whl Python 3 none any Details for atelya_attest-0.2.0-py3-none-any.whl

Total release size: 96.6 kB

Release files / atelya_attest-0.2.0.tar.gz

Download URL atelya_attest-0.2.0.tar.gz
Size 58.7 kB
Tags Source
SHA-256 checksum
How to use checksums
6ba460610e340a94360a370e618114bc848d2970dad0ad5c1a9297fca94e61ae
BLAKE2b-256 checksum
How to use checksums
e66b5236bdf55e15a7eef30dfe17f46a76305d236c19036edc08dbe3f5150987
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Release files / atelya_attest-0.2.0-py3-none-any.whl

Download URL atelya_attest-0.2.0-py3-none-any.whl
Size 37.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
053ffaa03e31d2672874890133b2e9f04c0281b3e6312ce74854c9319b64b620
BLAKE2b-256 checksum
How to use checksums
b328c98afd307513590dd4f6175c5fddb3f0eb29a6d19f148bc3e337b04ce331
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.4

Security for atelya-attest 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page