Skip to main content
Yanked

This release has been yanked by its maintainers, and will be ignored by installers, except when explicitly specified.
Reason given by maintainers: Accepts receipts signed with Tanilo's published test fixture key as valid by default. Superseded: upgrade to tanilo-receipt-verify 0.2.4; see https://tanilo.io/trust

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

status valid Meaning
"valid" True Every check ran and passed
"invalid" False A check ran and failed; see .errors
"indeterminate" None A 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

Invariant Description
canonical_recomputes JCS(payload) → SHA-256 recomputes byte-identical to claimed
decision_ref_recomputes sha256(JCS(preimage)) matches published decision_ref (per invinoveritas/babyblueviper1 spec)
decision_signer_ne_runtime Decision signer issuer ≠ runtime issuer (fail-closed: self-approval is void)
all_signatures_verified Every 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

Metadata

Release files for agentoracle-receipt-verify 0.1.0

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

Built distribution (wheel)

Table of built distributions (wheels) for agentoracle-receipt-verify 0.1.0
File Interpreter ABI Platform
agentoracle_receipt_verify-0.1.0-py3-none-any.whl Python 3 none any Details

Release files / agentoracle_receipt_verify-0.1.0-py3-none-any.whl

Download URL agentoracle_receipt_verify-0.1.0-py3-none-any.whl
Size 9.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bf80692819f1e47b3f5d951101ace2654f255084d77e56b4ab6df88b230b164
BLAKE2b-256 checksum
How to use checksums
cb88d89a22f684bfcb38271f0d9f2b1012ffef69a07f44543b108003709e334f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.9.6

Security for agentoracle-receipt-verify 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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

1 release file No provenance

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