Skip to main content

auth51-checksum

The agent-identity checksum algorithm, extracted as the single, shared source of truth. The same bytes hash the same way on both sides of the trust boundary:

  • the authority computes it at registration → the registered checksum;
  • the clients (embed/wrap) recompute it at runtime from the live agent and compare.

Because both sides run the identical algorithm, a client can verify "this is the registered, unmodified agent" without the agent self-declaring its identity — and the authority re-verifies at mint. This package is the engine behind that.

⚠️ This is a wire/registration contract. Changing the algorithm is a breaking change to every already-registered agent. Don't refactor in ways that change a single output byte — bump a version suffix instead. The conformance test (tests/) pins this to golden vectors generated from the authority's own crypto/agent_checksum.py; a failure there is a release blocker.

Two algorithms (the authority accepts EITHER at mint)

v1 — patchet-compat. SHA-256, bare 64-char hex.

canon = {
  "id":     agent_id,
  "prompt": normalize_prompt_v1(prompt_template),   # whitespace-collapse, NO Unicode NFC
  "tools":  sorted([{name, signature, description, source_code?}], by name),  # is_agent dropped
  "config": configuration,
}
sha256(json.dumps(canon, sort_keys=True)).hexdigest()

v2 — auth51 native. SHA3-512, self-describing sha3-512:v1:<128 hex>.

canonicalize(model_dump(components))  →  json.dumps(sort_keys=True)  →  sha3-512

where canonicalize recursively sorts dict keys and runs normalize_text on every string (strip, \r\n\n, collapse blank lines, strip each line, drop empty lines, Unicode NFC). The component dict carries every tool field — name, signature, description, source_code, is_agent — defaults included; that exact shape is part of the hash.

v3 — auth51 native, IDENTITY-ONLY. SHA3-512, self-describing sha3-512:id1:<128 hex>.

canonicalize({agent_id, prompt_template, configuration})  →  json.dumps(sort_keys=True)  →  sha3-512

Same canonicalization as v2, but over prompt + config only — no tools. Tools are the grant (authorization), not identity (DESIGN §13.1): adding/swapping a tool re-derives the grant, it doesn't change who the agent is. This is what the modern clients recompute at runtime — purely from the live prompt + config, both observable on the wire to the model, so no tool material is needed. The authority stores all three; mint accepts any.

The behavioural differences: v2 NFC-folds Unicode; v1 does not (composed vs decomposed é collide under v2, differ under v1). And two agents with the same {id, prompt, config} but different tools share a v3 but differ in v2 — that's the whole point of v3.

Use

from auth51_checksum import AgentComponents, Tool, compute_both, matches

comp = AgentComponents(agent_id="ReviewBot", prompt_template="You are…", tools=[], configuration={})
v2, v1 = compute_both(comp)              # both checksums
matches(registered_checksum, comp)       # True if either matches (the client-side gate)

matches() mirrors the authority's mint-time acceptance: recompute from the live agent, and the registered checksum is valid if it equals either algorithm.

Regenerating golden vectors

From the authority repo (its venv has pydantic):

from auth51_authority.schemas.intent import AgentComponents
from auth51_authority.crypto.agent_checksum import compute_both
# run compute_both over the fixtures, dump {name, components, v2, v1} → tests/golden.json

Ports

  • Python — this package (reference implementation).
  • TypeScript — for @auth51/client (node), to be ported from the spec above and pinned against the same golden.json. The golden vectors are the cross-language contract: any port must reproduce them exactly.

Release files for auth51-checksum 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 auth51-checksum 0.2.0
File Size Uploaded
auth51_checksum-0.2.0.tar.gz 12.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for auth51-checksum 0.2.0
File Interpreter ABI Platform
auth51_checksum-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 22.5 kB

Release files / auth51_checksum-0.2.0.tar.gz

Download URL auth51_checksum-0.2.0.tar.gz
Size 12.5 kB
Tags Source
SHA-256 checksum
How to use checksums
2b92c78b20f782f6ea1917a2eb8379d80e568af22f25a2ca466add021ee1281c
BLAKE2b-256 checksum
How to use checksums
620a47d819801071ddc918aa93f02440835a9ac450886bbf8a49602dbfb435c0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.

Transparency log

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

Download URL auth51_checksum-0.2.0-py3-none-any.whl
Size 10.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
55d35e00ae841fa92a3c3fc5260283444164b3ec7aad2d51a31b34d47d83454e
BLAKE2b-256 checksum
How to use checksums
f800cb924366341d1698f9210688bfbe98bc36f20ea5c041772838500bc69550
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Jul 11, 2026.

Transparency log

Release history Release notifications | RSS feed

0.4.0

2 release files

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

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