A previous release had provenance metadata, but this release does not. View details.
regent-receipt-verify
Verify a Regent Control receipt or allow token without Regent: only the token and a JWKS
you saved while the issuer was reachable. Nothing calls the network. One dependency
(cryptography) for RS256.
pip install regent-receipt-verify
curl -s https://control-api.regentprotocol.org/v1/control/.well-known/jwks.json > jwks-2026-09.json # save it now, keep it with the receipts
regent-verify @receipt.txt --jwks jwks-2026-09.json --request request.json --mandate mandate-v2-reveal.json --policy policy-v3-reveal.json --counterparty-jwks get4agent-jwks.json
from regent_receipt_verify import verify
res = verify(token, jwks, request={"tool": "stripe", "action": "charge.create", "resource": None, "args": {...}},
mandate_reveal=reveal_from_owner, policy_reveal=policy_reveal_from_org)
res.valid, res.kind, res.claims, res.args_hash_match, res.mandate_match, res.policy_match
What it proves:
| check | meaning |
|---|---|
| signature (RS256, kid from the JWKS) | Regent's issuer signed exactly these claims |
kind receipt / allow / budget |
a receipt (typ receipt+jwt, aud regent-receipt) can never pass as an access token |
expired |
receipts carry a 10-year evidence period; an allow token lives about a minute, so for evidence its expiry is a note, not a failure |
args_hash_match |
the token authorised this exact request (tool, action, resource, args) and nothing else |
mandate_match |
the owner's revealed mandate version (snapshot + salt; terms-v2, or terms-v3 with the scope allowed_resources) opens the receipt's mandate_hash |
policy_match |
the organisation's revealed policy version (text + profile + salt, policy-v1) opens policy_hash; starter-pack decisions need only the public text |
confirmation_match |
the settlement confirmation the counterparty (merchant, PSP, custodian) signed over the same decision, embedded in the receipt, re-verified against the counterparty's own JWKS and compared with the receipt's figures: two signatures over the same facts, checked offline. settlement_source: agent receipts have none |
Key rotation: pass --jwks several times (every JWKS you saved). Exit code 0 when the signature
verifies and every supplied check matches.
Test vectors are minted by the real issuer (packages/receipt-verify-vectors), and the same
file drives the Node package @regent-protocol/receipt-verify.
Evidence bundles (0.4.0)
A bundle is one JSON document from the console ("Evidence bundle" on a decision or an audit
event) or from GET /v1/organizations/{org}/decisions/{id}/bundle. It carries every audit
event of a decision with the exact bytes that were hashed, the Merkle proof to the batch root,
Regent's signed checkpoint over that root and its chain position, the epoch proof, the
OpenTimestamps proof, the RFC 3161 time-stamp token (0.8.0), the retained receipt and the keys.
regent-verify bundle regent-evidence-dec_7f301d041e9f.json
regent-verify bundle regent-evidence-dec_7f301d041e9f.json --jwks jwks-2026-09.json --checkpoint-jwks audit-jwks.json
regent-verify bundle regent-evidence-dec_7f301d041e9f.json --rpc https://api.mainnet-beta.solana.com
regent-verify bundle regent-evidence-dec_7f301d041e9f.json --tsa-root my-tsa-root.pem
from regent_receipt_verify.bundle import verify_bundle
res = verify_bundle(bundle, receipt_jwks=saved_receipt_jwks, checkpoint_jwks=saved_audit_jwks,
rpc="https://api.devnet.solana.com") # rpc is optional
res.valid, res.events, res.receipt_valid, res.receipt_anchored, res.links_ok, res.rpc_ok
| check | meaning |
|---|---|
| canonical bytes | sha256(payload_canonical) == payload_hash, and the bytes parse to the payload |
| batch proof | payload hash → Merkle proof → batch root |
| checkpoint | Regent's RS256 statement (typ checkpoint+jwt) names this batch: id, seq, root, head |
| epoch proof | batch root → epoch proof → epoch root |
| rfc3161 | the epoch's RFC 3161 token (tsa_token_b64) is CMS SignedData whose TSTInfo names exactly this epoch root under SHA-256, whose signature verifies with the time-stamping certificate it carries, and whose certificate chains to a trusted root and was valid at the certified time; the line shows that time and the signer |
| receipt | verifies, names the bundle's decision, and is byte-for-byte the one inside the anchored receipt event |
| links | consecutive checkpoints chain (prev_head of N == head of N-1); one seq, one checkpoint |
on-chain (--rpc) |
the append and anchor transactions succeeded and carry the root in an instruction to the audit program |
The RFC 3161 token is the clock a bank's auditor already knows how to read: a public Time
Stamping Authority (DigiCert or Sectigo today) signed the epoch root at seal time, so "this root
existed no later than genTime" rests on the TSA's key, not on Regent or on any chain. The two
TSA roots ship with the package (tsa_roots.pem, from the Mozilla root store); --tsa-root
replaces them with your own. A bundle without a token reports nothing for this check; a token that fails any
step makes the bundle INVALID.
What VALID binds, and what it cannot. Every event verifies on its own bytes, its batch proof and Regent's signed checkpoint; every event names this decision and appears once; the current receipt is the highest attempt. What offline verification cannot prove is completeness: that no event of the decision was left out of the file. For that, the organization's own trail (or the API that served the bundle) is the record; a bundle is evidence for the events it carries.
Keys default to the ones inside the bundle, which proves consistency; pass the JWKS you saved
(--jwks, --checkpoint-jwks) to prove provenance. The checkpoint JWKS is public at
https://api.regentprotocol.org/v1/audit/.well-known/jwks.json.
The owner's approval (0.9.1: compared with the receipt, not verified)
A receipt names its approval by digest (approval_digest). A bundle downloaded with the
approval revealed (a signed-in admin of the organization only) carries an approval block
with the exact evidence string that was hashed. regent-verify bundle checks one thing
about that block, with no call to Regent: the evidence bytes hash to the digest that a
verified receipt names. Evidence that was edited, replaced by other evidence, or moved to
another decision makes the bundle INVALID.
This version does not verify the owner's signature inside the evidence, and it does not check that the terms shown beside the evidence are the terms that were approved. It says so itself, in the second line of its output:
VALID — evidence bundle for dec_7f301d041e9f, 3 event(s)
NOT CHECKED — the owner's approval: this version does not verify it
Two verdicts; read both. The first covers the trail and the receipt. The second is about
the approval, and in this version it is NOT CHECKED or INVALID, never anything better.
The program that verifies the owner's signature is given by Regent, on request, to the
parties to a dispute and to their auditors and advisers: evidence@regentprotocol.org.
Two rules:
- The anchor is the receipt, and only the receipt. The digest comes from a receipt
whose signature verified. No event in the bundle can stand in for it: an event's id and
type are labels beside its payload, not part of what is hashed into the trail. With no
verified receipt nothing is compared. Pass your saved
--jwks: a bundle that ships its own receipt key proves consistency, not provenance, and a note in the output says which key was used. - Nothing the block merely says is repeated as a finding. The method and the scope are the receipt's. Dates, the approver's id and "applied" are printed as stated by the organization, not verified. No terms are returned.
A block that contradicts the receipt is an error, and the bundle is INVALID: another
method or scope than the receipt's, "no signature was taken" beside a receipt that names a
digest, "none recorded" beside a receipt that names an approval. A receipt that names an
approval the bundle does not carry is not an error: the second line then says
the bundle does not carry it. Changes to a mandate listed in the block are counted and
reported as NOT CHECKED.
Reading the result
- The exit code and
validare the bundle's. They can be 0 andTruewhile the approval isNOT CHECKED, and also when the bundle does not carry the approval evidence at all, or says it is not on file: the exit code does not show missing evidence. To know what was checked about the approval, read the second line, orapproval.verdictin the result. Exit codes: 0 valid, 1 not valid, 2 the program could not do what was asked: a file could not be read (not UTF-8, not JSON, nested deeper than 512, a root file with no PEM certificate, a reveal that is not a JSON object), an option is unknown, abbreviated, missing its value or cannot be enforced,--nowis not plain digits, the output could not be written, or the program itself failed. When nobody reads the output (| head), writing stops and the exit code still gives the verdict. - Arguments are read the same way in both languages, by the same hand-written reader:
--name valueor--name=value, options anywhere,--ends the options, one file or token.--nowtakes ASCII digits with an optional fraction and exponent (1795000000,-1e5), nothing else. One exception outside this program's reach: when standard output is a directory, Python stops before the program starts (exit 1), Node exits 2. --approver-key,--originand--rp-idare refused by this version (exit 2; in the library, an error in the result, whether or not the bundle carries an approval). They pin the owner's key and site where the owner's signature is verified. A requirement that cannot be enforced must not look as if it was.- A receipt checked with a key from the bundle anchors nothing you can rely on. The
evidence is still compared with it, and the output says so: the second line reads
the receipt key came from the bundle, and a note says which keys were taken from the bundle. Pass--jwks(and--checkpoint-jwks) with copies you saved. - Automation reads
--json(or the library result), never the text.--jsonis plain ASCII. The text is written for a person, and a bundle is untrusted input, so two rules hold in it. Every control character, bidirectional control, zero-width and other default-ignorable character is printed as an escape. Letters of right-to-left scripts, combining marks and private-use characters are printed as they are: a terminal may draw them over or beside their neighbours, but none of them can start a line. And no row is left for the terminal to wrap: a row longer than 78 columns is continued on lines that start with|, so that a label padded to the width of the screen does not start a row of its own. Only two rows start at the left edge: the bundle's verdict and the approval's. A label can still contain any words. This holds on a terminal at least 80 columns wide that draws characters at their usual widths (every character outside ASCII is counted as two columns to leave room). On a narrower terminal, or whenever the answer matters, read--json. - The format is strict on purpose. Base64url in its one spelling (no padding, no stray
bits), a receipt token that is exactly
header.payload.signature, UTF-8 JSON whose numbers a double holds exactly, RSA keys with e=65537 and 2048 to 8192 bits, and every field of a bundle of one type: a number given as text is refused, not converted. Anything else ismalformedand the bundle is invalid, in this package and in its Node twin alike. The two are tested against each other on the same hostile inputs and give one answer: the same exit code and the same text.--jsonof a bundle is the same in both;--jsonof a token names its fields in each language's style (signature_valid,signatureValid), as it did in 0.9.0. If they ever give two answers for the same file, treat the bundle as not verified and tell us. Reveals are read so that both languages hash the same bytes: text with a lone surrogate, a version beyond 253 - 1, and a policy profile holding anything but text, booleans, null and whole numbers within 253 - 1 (12.0 is read as 12), nested no deeper than 64, or a key above U+FFFF, matches nothing. Roots given as PEM text are read by one grammar in both languages (BEGIN, lines of base64, END): a one-line or CR-only certificate, or one with headers, is refused, not read one way here and another there. Two limits remain. Request arguments (--request) holding a number with a decimal point (40.0), in exponent form or beyond 2**53 hash differently in Node, which reads them as another double: give such values as integers or text. And a command-line argument that is not valid UTF-8 reaches Python as escaped bytes and Node as U+FFFD. - What 0.9.1 fixes in 0.9.0. 0.9.0 said nothing about an approval block: a bundle whose
approval evidence had been altered or replaced was
VALID, and one whose block had been removed said nothing either (0.9.1 still calls that bundleVALID, and says in its second line that the bundle does not carry the evidence). A label with a line break could print a row that looked like this program's own, and escape sequences reached the terminal. A bundle with a field of the wrong type could end in a stack trace instead of an answer. Upgrade. - What changes when you upgrade from 0.9.0. The text output is wrapped at 78 columns
(continuation lines start with
|) and has a second line at the left edge; a script that reads the text should read--json, which only gained fields. A key set is read up to its 16th key, across all--jwksfiles together. RSA keys must have e=65537 and 2048 to 8192 bits. A bundle field of the wrong type (a number given as text, a label longer than 128 characters) makes the bundlemalformedwhere 0.9.0 converted it or let it through. A counterparty confirmation is read as strictly as a receipt; its amount must be a finite number or plain decimal text (0.9.0 in Python let"nan"match any amount), and its key must be the one type its algorithm uses: ES256 an EC P-256 key, EdDSA an Ed25519 key, RS256 and PS256 an RSA key with e=65537 and 2048 to 8192 bits (0.9.0 in Node accepted any key for any algorithm, an RSA key with e=1 included, whose "signature" anyone can compute). A mandate, payee or policy reveal whose values are not of the types the format defines (a version that is not a whole number, a payee or salt that is not text, a scope that is not a list of texts) matches nothing, where 0.9.0 converted them differently in each language. An unknown keyword argument raisesTypeError, as Python does.
from regent_receipt_verify.bundle import verify_bundle
res = verify_bundle(bundle, receipt_jwks=saved_jwks) # a key you saved, not the bundle's
res.valid # the trail and the receipt
if res.approval is not None:
res.approval.verdict, res.approval.why # "NOT CHECKED" or "INVALID" in this version
Metadata
Release files for regent-receipt-verify 0.9.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Loss of provenance
These files do not have provenance metadata, despite files in a prior release including this data.
We recommend further investigation before installing these files. View details.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| regent_receipt_verify-0.9.1.tar.gz | 76.3 kB | Without provenance | Details for regent_receipt_verify-0.9.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| regent_receipt_verify-0.9.1-py3-none-any.whl | Python 3 | none | any | Details for regent_receipt_verify-0.9.1-py3-none-any.whl |
Total release size: 132.0 kB
Release files / regent_receipt_verify-0.9.1.tar.gz
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | regent_receipt_verify-0.9.1.tar.gz |
|---|---|
| Size | 76.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
8b6ce0469ffa665160fe5ba8b5d5aad49a75f2a931ee76728fa8b2b6b900c13e
|
|
BLAKE2b-256 checksum How to use checksums |
db67aeb47f941f8adfe74f82699521b56f58f8b411bee7d1deaecc4d6ea3999b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Release files / regent_receipt_verify-0.9.1-py3-none-any.whl
Loss of provenance
This file belongs to a release without provenance metadata, despite a prior release including this data.
We recommend further investigation before installing this file. View details.
| Download URL | regent_receipt_verify-0.9.1-py3-none-any.whl |
|---|---|
| Size | 55.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5fbab364886a41f80bfadbb63bbb112757efdc329fb1d1a8de75c2375a96ab10
|
|
BLAKE2b-256 checksum How to use checksums |
a181f492a3f6563161b3958bbf780796ac9a24db47d79801da5a7f60473336dd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.4
|
Security for regent-receipt-verify 0.9.1
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.
Loss of provenance
A previous release of these files had provenance metadata, but this release does not.
While this could reflect a routine change by the project maintainers, it may also indicate that the release files have been compromised.
Release comparison
- Removed 0.9.0 2 files With provenance
- Added 0.9.1 2 files Without provenance
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.