Catalog PyPI
PACKAGE EXPLORERView in registry

agentoracle-receipt-verify

PyPI

Verifier for AgentOracle composed envelopes (RFC 8785 JCS + Ed25519). Canonicalization is byte-identical to the production Node canonicalizer.

Versions collected1
Direct dependencies1From release 0.1.0
Last observed20 Oct, 22:49 UTC

README

Version 0.1.0 documentation

agentoracle-receipt-verify

Verifier for AgentOracle composed envelopes: RFC 8785 JCS canonicalization plus Ed25519 JWS signature verification. Canonicalization output is byte-identical to the production Node canonicalizer.

Design goal

Three implementations, one canonicalization. A receipt canonicalized in Node, Python, or the browser must produce the byte-identical string and byte-identical SHA-256. No language-specific behavior. No trusted issuer round-trip.

Install

pip install agentoracle-receipt-verify

Usage

Key material is required to reach a verdict. Pass jwks_by_issuer:

from agentoracle_receipt_verify import verify

result = verify(envelope, jwks_by_issuer={
    "https://agentoracle.co/.well-known/jwks.json": ao_jwks,
    "https://agenttrust.uk/.well-known/jwks.json": at_jwks,
})

if result.status == "valid":
    print("verified — canonical:", result.canonical_sha256)

Three outcomes, not two

statusvalidMeaning
"valid"TrueEvery check ran and passed
"invalid"FalseA check ran and failed; see .errors
"indeterminate"NoneA check could not run; see .indeterminate_reason

Calling verify(envelope) without jwks_by_issuer on a signed envelope returns indeterminate, not valid. Canonicalization recompute proves the payload matches its claimed hash; it binds the payload to no issuer. Only the signature does that. A verifier that reported valid there would assert a property it never tested.

None is falsy, so if result.valid: fails closed. Branch on .status when you need to distinguish "failed" from "could not check".

What it checks

InvariantDescription
canonical_recomputesJCS(payload) → SHA-256 recomputes byte-identical to claimed
decision_ref_recomputessha256(JCS(preimage)) matches published decision_ref (per invinoveritas/babyblueviper1 spec)
decision_signer_ne_runtimeDecision signer issuer ≠ runtime issuer (fail-closed: self-approval is void)
all_signatures_verifiedEvery JWS signature verifies against a resolvable JWK by kid. None when no key material was supplied — unevaluated, not failed

Cross-language guarantees

The tests/ suite includes byte-identical fixtures shared with the Node reference implementation:

  • test_jcs_byte_identical_to_node — Python JCS output byte-matches Node output for a payload with nested objects, arrays, unicode, booleans, and integers.
  • test_decision_ref_recompute_babyblueviper1 — Python recomputes the shipped invinoveritas fixture, byte-identical to her Python and our Node.
  • test_conformance_sample_canonical_hash — reproduces the canonical hash from AgentOracle's /v1/conformance/sample production endpoint.

License

MIT

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
0.1.014 Aug 20261

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Repository

PENDING
tkcollective/agentoracle-receipt-verify-py

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 22:49 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:7ca810b10e888d2e78d66d190d246e89b4e0e522a9586612753f6621ae5d5f8a