szl — the receipts layer for governed AI
import sys; sys.path.insert(0, ".") # until published: pip install szl
from szl import khipu, kamachikuna, provenance, router
# 1. Every claim carries a receipt (Law 7)
r = khipu.mint({"claim": "training completed", "steps": 2000}, secret="…")
assert khipu.check(r, secret="…") # integrity + origin
r2 = khipu.mint({"claim": "eval done"}, secret="…", prev_body_sha256=r["body_sha256"])
assert khipu.check_chain([r, r2], "…", expected_head=r2["body_sha256"])
# 2. Fail closed (Law 6)
assert kamachikuna.gate("deploy", verified=False)[1] == "BLOCKED"
# 3. Provenance badge — the Korea/Naver bar, machine-checked
c = provenance.ProvenanceClaim(model_id="m", source_sha="…", training_receipt=r,
datasets={"train": "sha256…"})
badge = c.badge(secret="…") # state: MEASURED | CARD_ONLY | UNTRAINED | UNAVAILABLE
# 4. Two-axis Truth Router — honest cheapest, joules reported separately
pick = router.route("honesty-critical", models) # None if no honest model: fail closed
Modules
- khipu — signed, hash-chained receipts. Full-length HMAC-SHA256 signatures (never truncated — that was the v1 auditor bug). Tamper, reorder, and truncation detection (truncation via
expected_head). - kamachikuna — the constitution: 10 laws, 5 Prime Principles, 5 Lean-proven invariants, 3 amendments, and Law 6 as a callable gate.
- provenance — honest states only: UNTRAINED · CARD_ONLY · MEASURED · UNAVAILABLE · NOT_CLAIMED. Verification proves integrity and origin, never accuracy or performance.
- router — two-axis honesty routing: price axis decides, joules reported separately (never summed with dollars — different units), UNMEASURED energy never counts as zero, honesty-critical tasks fail closed.
The freshness rule
"A line older than seven days is a claim, not a fact." — Vidal-Gadea Lab roadmap, Nov 2026
khipu.check_chain(..., max_age_days=7) fails a chain whose newest receipt is
older than the window. A stale record that still verifies is worse than no
record, because it is believed — their lab's cached tracker sat 57 days untouched
and was read by a program with no error and no warning.
Design debts deliberately not hidden
- Chain prefixes are internally valid; completeness requires
expected_head(tamper-evidence ≠ completeness). - An unmeasured quantity is None/UNKNOWN everywhere — never zero.
- Freshness is a separate axis from integrity: a chain can be both valid and stale.
Tests: python3 sdk/tests/test_szl_sdk.py — 11/11 offline, no network, no GPU.
Apache-2.0. Copyright 2026 SZL Holdings · Stephen P. Lutar Jr.
Metadata
Release files for szl 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| szl-0.1.0.tar.gz | 12.6 kB | Without provenance | Details for szl-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| szl-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for szl-0.1.0-py3-none-any.whl |
Total release size: 23.5 kB
Release files / szl-0.1.0.tar.gz
| Download URL | szl-0.1.0.tar.gz |
|---|---|
| Size | 12.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bdbc6437c50ee32391cfa6275cb1282ac0beb1dd6abdc72746ff5a5b7344b625
|
|
BLAKE2b-256 checksum How to use checksums |
15ed262d0a6768455847d0d6c20afa39da3e7774635258d98717c37aeaba3551
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Release files / szl-0.1.0-py3-none-any.whl
| Download URL | szl-0.1.0-py3-none-any.whl |
|---|---|
| Size | 10.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
eacab56d0d03163617301fbbbcd82a24ea6cf8477815f01e06715c64fb0c766f
|
|
BLAKE2b-256 checksum How to use checksums |
ec2e7e8d4a9ed2625633befc32e6b5b7131c80a607f6b506f9a4fcae4e8fe960
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.15
|
Security for szl 0.1.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.