Skip to main content

lgd-passport — come and break it

An offline verifier and a negative-control vector set for agent passports, delegation chains and RFC 9421 signed requests. Two independent implementations (Python and Node, no shared code) that must agree, byte for byte.

The whole point is not that it passes. The point is that every rejection happens for the stated reason, and each rejection carries a stable error code — so a negative that fails because the signature is junk is counted as a failure, not as coverage.

Run it in 30 seconds

pip install lgd-passport        # on PyPI since 2026-11-27
lgd-passport selftest           # 30 checks; exit 1 if anything that must fail does not fail
lgd-passport demo               # one positive chain: issue → delegate → verify per request
lgd-passport selftest --json    # machine-readable
lgd-zc                          # 106 conformance cases, Python side + Node side, then VERDICT
# no PyPI? same wheel without the index:
# pip install https://github.com/zhaoxinghua09-cell/lgd-passport/releases/download/v2.0.1/lgd_passport-2.0.1-py3-none-any.whl
# or from this repo: pip install -e .

lgd-zc (also python -m lgd_zc) ships the conformance suite inside the wheel — the 106 cases, the specs and the eight .mjs cross-check scripts — so the two-implementation agreement can be reproduced without cloning the repo. It needs node ≥ 18 on PATH, or pass --node <path>.

MATCH is not a count comparison. It requires all three: same number of cases (106), the same case-id sequence on both sides, and the same ok flag case by case. Anything less prints MISMATCH. Add --json receipt.json to get a machine-readable receipt — per-case results, the divergence list, a sha256 for every case file plus a manifest root hash, and the Python/Node versions — so a third party can check that you ran the same cases and reached the same verdicts, one line at a time.

Node side (no dependencies, Node ≥ 18):

node js/lgd_passport_ts.mjs negctl   # 8 negative controls on the Node side
node js/lgd_passport_ts.mjs codes         # error-code table, both directions
node js/lgd_passport_ts.mjs checkdata vectors/vector-set-v1.json
python vectors/check_vectors.py         # 43 checks out of the vector set

What it verifies

Area What is checked Failure code (sample)
Passport issuer-signature against a pinned public key; typ/alg; iat/exp; TTL ceiling 86400 s; key thumbprint binding (RFC 7638) SIGNATURE_INVALID, TYP_MISMATCH, PASSPORT_TTL_EXCEEDED, KEY_THUMBPRINT_MISMATCH
Delegation chain monotone narrowing only (scope subset, exp never extended); chain root must match the passport subject SCOPE_ESCALATION, DELEGATION_EXP_BEYOND_PARENT, CHAIN_ROOT_MISMATCH
Signed request RFC 9421 signature base; required covered components; freshness window ≤ 300 s SIGNATURE_HEADERS_MISSING, FRESHNESS_WINDOW_EXCEEDED, COVERAGE_MISSING
Identifier namespace:local syntax and resolution; malformed vs unresolvable kept apart IDENTIFIER_MALFORMED, IDENTIFIER_UNRESOLVABLE, REGISTRY_ENTRY_INVALID
Revocation / status list issuer-signed revocation list, freshness by issued_at + max_age, local ceiling 3600 s, TSL-shaped bit lists (1/2/4/8 bits, zlib) REVOCATION_STALE, REVOCATION_MAX_AGE_TOO_LOOSE, REVOKED, STATUS_LIST_OUT_OF_RANGE

No network, no vendor SDK, no issuer callback. Everything the verifier needs is in the bundle plus a pinned key.

Numbers — and what they are not

  • selftest 30/30, cross-implementation parity 11/11, vector set 43/43, error-code agreement 21/21.
  • These are first-party dry runs on one machine. They are not third-party testing and this repo does not present them as such. If you run it, your receipt counts; mine does not.

Open invitation: come and break it

Three things you can do without asking me anything:

  1. Send a case. A passport, a delegation chain, a revoked chain, a signed request — any shape. If I cannot reproduce it, I will say so and paste the exact command I ran.
  2. Ask a question that exposes a gap, including "your C3 score is empty, why do you still score it".
  3. Run the suite and report what fails. Wrong-reason failures are the most valuable thing you can send: they are where a test suite silently loses coverage.

Nothing here asks for a review, an endorsement or a number. The only currency is "this does not work because X".

Boundary

  • Not a conformance claim against @draft-le-agent-passport-00, APS, WIMSE or any other document. The object model follows the le draft; artifacts are not drop-in for any of them.
  • Allowed signature set is EdDSA only; post-quantum candidates are unimplemented and no PQ claim is made.
  • Freshness is verified against a supplied instant; this repo does not demonstrate that a cached revocation answer is rechecked at the moment authority is consumed.
  • Test keys are seeded from sha256("lgd-passport-vector/<role>/v1") and published on purpose. They carry no authority anywhere.

Layout

src/lgd-passport/        Python implementation (CLI entry: lgd-passport)
js/lgd_passport_ts.mjs   Node implementation (no dependencies)
vectors/               43-check vector set + runner + notes
tools_parity_check.py  cross-implementation parity (11 checks)
docs/                  re-run instructions for a third party

Author: Xinghua Zhao (赵兴华), independent researcher — ORCID 0009-0001-0512-1237. No affiliation, no vendor relationship, no funding tied to this work.

License: Apache-2.0.

Metadata

Release files for lgd-passport 2.0.2

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 lgd-passport 2.0.2
File Interpreter ABI Platform Actions
lgd_passport-2.0.2-py3-none-any.whl Python 3 none any Details for lgd_passport-2.0.2-py3-none-any.whl

Release files / lgd_passport-2.0.2-py3-none-any.whl

Download URL lgd_passport-2.0.2-py3-none-any.whl
Size 268.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
21a04be77b2e12f054d23cee934b0ef0d069a6a02e519ef3401f9a0d9dae0665
BLAKE2b-256 checksum
How to use checksums
33b184d0888bab4832f6ebb5173bdc45cbd5156f68a0a2d2b9b207685dc29747
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.18

Security for lgd-passport 2.0.2

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.

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