Skip to main content

aitp-verifier-py

An independent Python implementation of the AITP verification core — a second implementation, written from the spec alone, that cross-checks the reference one. The first implementation is aitp-rs; its Python/Node bindings wrap the same Rust core and therefore do not count as independent. How implementations feed RFC promotion is defined by the spec, not here: see governance/RFC-PROCESS.md and VERSIONING.md. Status of each RFC: rfcs/README.md.

Wire freeze: the aitp/0.3 wire is frozen until 1.0, except for security fixes (what is frozen). This verifier tracks that one wire. The conformance claim it passes is AITP v0.3 (with AITP v0.3 self-attestation) at the spec commit in SPEC_VERSION; see Conformance coverage.

Install

pip install aitp-verifier

The distribution is aitp-verifier, the import package is aitp_verifier, and the console script is aitp-verifier-adapter. Its version numbers are its own. They do not follow aitp-rs's lockstep releases, and the spec commit a release passes is the one in SPEC_VERSION. Releases go out from a v* tag through PyPI trusted publishing (release.yml). The tag must equal the pyproject.toml version, or nothing is published.

Independence claim

This codebase was implemented from the RFC-AITP texts and JSON schemas only (RFC-AITP-0001…0013, schemas/json/*, and the conformance pack's pinned expectations under schemas/conformance/). No algorithmic code was read from, ported from, or shared with aitp-rs, and nothing shells out to any Rust binary. The two implementations meet only at the conformance pack's byte-pinned golden vectors (known-answer/) — which is the point: cross-verifying the same vectors from two independently written codebases is what makes the check meaningful.

Scope

A verification library plus a conformance-fixture runner — not an agent, not an HTTP client, not a registry. No network I/O exists anywhere in this codebase.

Implemented: RFC-AITP-0001–0006, 0008, 0010, 0011. RFC-AITP-0007 (key resolution) is covered only as far as verifying with caller-supplied keys (jwk, identity) — nothing is fetched. RFC-AITP-0009 is a security RFC and has no module of its own. RFC-AITP-0012 (extensions) is honored only as the opaque extensions slot (fields); RFC-AITP-0013 (TCT renewal) is not implemented.

Module Covers
aitp_verifier.jcs RFC 8785 JSON canonicalization (own implementation)
aitp_verifier.crypto Ed25519 + ECDSA-P256, the JCS-profile vs JOSE signing split (RFC-AITP-0001 §5.4)
aitp_verifier.aid AID parsing + self-certifying key derivation (§5.3), incl. the p256 tag
aitp_verifier.jwk RFC 7638 JWK thumbprints for the cnf.jkt binding (§5.4.4)
aitp_verifier.jws Strict compact-JWS profile: typ/alg pinning, no alg:none, exact-bytes verify (§5.4.5)
aitp_verifier.envelope Envelope check order (version → member set → signature), aitp-envelope-v2 signing input, replay controls (§5.4/§5.5)
aitp_verifier.manifest Agent Manifest: version, expiry, PoP, signature (RFC-AITP-0003)
aitp_verifier.tct Trust Context Token verification incl. §10.4 Manifest-expiry bound + revocation ordering (RFC-AITP-0005)
aitp_verifier.voucher Grant-voucher verification (RFC-AITP-0005 §8)
aitp_verifier.delegation Single-hop delegation + the multi-hop chain (hop limit, chain-hash commitment, transitive scope, per-hop revocation) (RFC-AITP-0006 / RFC-AITP-0011)
aitp_verifier.revocation Revocation-snapshot freshness / signature / fail-mode (RFC-AITP-0008)
aitp_verifier.identity OIDC + pinned-key identity bindings, incl. the five-field pinned-key proof (RFC-AITP-0002)
aitp_verifier.handshake Mutual-handshake payload verification: Manifest, identity, nonce echo, round-2 PoP, embedded TCT (RFC-AITP-0004)
aitp_verifier.fields Closed-field-set enforcement: unknown fields → UNKNOWN_FIELD; extensions contents are never inspected (RFC-AITP-0012 §1)
aitp_verifier.sigfield Algorithm-tagged (ed25519./p256.) JCS-profile signature fields (RFC-AITP-0001 §5.4.3)
aitp_verifier.keys Loads the pinned known-answer keypairs for the minter / runner
aitp_verifier.errors AitpError and the typed error-code vocabulary
aitp_verifier.verify Operation registry: maps a fixture input.operation to its verifier
aitp_verifier.minter Conformance-fixture minter: fills __PLACEHOLDER__ values with the pinned KAT keys (signs; the verification core never does)
aitp_verifier.b64, aitp_verifier.timeutil base64url helpers; the reference-clock constant
aitp_verifier.version PROTOCOL_VERSION (aitp/0.3), the one revision accepted under the strict cutover
aitp_verifier.sessionbundle Session Trust Bundle: envelope shape, expiry-before-signature, expiry-window invariant, coordinator signature, per-participant TCT, self-membership (RFC-AITP-0010)

Conformance coverage

run_conformance.py re-derives every in-scope fixture from the pinned KAT keypairs and runs it against this implementation:

python run_conformance.py --spec-dir ../agentidentitytrustprotocol [--claim "AITP v0.3"]

The run exits nonzero on any FAIL. --claim names one of the RFC-AITP-0001 §10 claim strings, gated as the spec's conformance badge rules define them, and a SKIP of any fixture behind the claim fails the run too:

--claim Gated on Here
AITP v0.3 (default) every status: core fixture with required_for_core (a missing flag counts as required) passes
AITP v0.3 self-attestation every fixture with feature: aitp-self-attestation passes
AITP v0.3 pinned-admission every fixture with feature: aitp-pinned-admission fails: not implemented

There are no other claims and no named profiles. Core fixtures run with no draft feature opted in, so del-007, which expects DELEGATION_MULTIHOP_NOT_SUPPORTED, is executed even though this verifier implements multi-hop delegation.

Current status at the pinned spec commit (SPEC_VERSION, 3a78a8f, aitp/0.3; the runner prints the live number): 118 fixtures pass, 0 fail, 15 skipped. All 94 core fixtures pass. So do the three Draft opt-ins (experimental-multihop-delegation, experimental-session-bundle, experimental-spiffe-identity), the aitp-self-attestation extension, and all multi-step sequences (PoP challenge/response tct-006/tct-007, issuer-side PoP enforcement tct-026, handshake replay mh-001). The surface — envelope, TCT (incl. alg:none, alg-confusion, typ-confusion, expiry-after-Manifest, revocation-ordering, no revocation source, and the issuer-side check of RFC-AITP-0005 §10.5), grant voucher, single- and multi-hop delegation, Manifest, revocation snapshots, session bundles, and the full mutual-handshake / identity family (OIDC and pinned-key bindings, the receiver's identity-type policy, nonce echo, round-2 PoP, embedded peer-issued TCT) — is validated byte-for-byte against known-answer/keypairs.json, jwk-thumbprints.json, jcs-sha256.json, the signed-examples/ artifacts (including both envelope KATs, kat-envelope-001-p256 and kat-envelope-002-ed25519), and the id-007 pinned-key proof vector.

The skips are reported explicitly, never as a silent pass (PLACEHOLDERS.md §"Operation key"):

  • del-004 — frozen in the retired v0.1 object wire shape (required_for_v0_1 only); a current implementation legitimately does not run it.
  • id-013…id-016, id-019…id-022 — the optional pinned-admission profile (RFC-AITP-0002 §3.4, feature: aitp-pinned-admission), which this verifier does not claim.
  • a2a-001…a2a-006 — the Draft A2A Agent Card binding (RFC-AITP-0014, feature: aitp-a2a-agent-card), not implemented.

Running under aitp-conformance

The same verifier also runs behind aitp-rs's aitp-conformance runner. aitp-verifier-adapter is its NDJSON subprocess adapter: one request per line on stdin, one response per line on stdout, logs on stderr only, exit 0 on EOF. aitp-rs publishes no runner binary, so build it from an aitp-rs checkout:

cargo build -p aitp-conformance --bin aitp-conformance      # in aitp-rs
AITP_SPEC=../agentidentitytrustprotocol \
  target/debug/aitp-conformance run \
    --target "$(command -v aitp-verifier-adapter)" \
    --fixtures-dir ../agentidentitytrustprotocol/schemas/conformance \
    --feature aitp-self-attestation --report adapter.json

AITP_SPEC names the spec checkout. The adapter reads two key files from it. It needs the KAT keys to sign the per-issuer "not revoked" snapshots of a delegation fixture (conformance README, "Revocation inputs"). Its OIDC issuer resolver needs known-answer/oidc-test-issuers.json: it resolves https://auth.openai.com and no other issuer.

run_conformance.py --report native.json writes the same report from this repo's own runner. The adapter-parity CI job (aitp-rs pinned by AITP_RS_SHA in ci.yml) produces both reports. It validates them against the spec's report schema and checker, then runs scripts/parity-diff.py, which requires the two to agree fixture for fixture. The diff lists its allowed exceptions by name:

  • del-007 runner policy: aitp-conformance skips it once the multi-hop draft feature is on.
  • runner defects reported upstream and not yet fixed at the aitp-rs pin. A listed entry that starts agreeing fails the diff, so the list cannot go stale.

A run with a draft feature enabled cannot pass the AITP v0.3 gate, because the feature-negation skip of del-007 blocks it. For a core claim, enable extension features only.

CI and the spec pin

The required checks in ci.yml run against the spec commit pinned in SPEC_VERSION, never the spec's moving main. A spec merge therefore cannot turn this repo red without a PR here. On a conformance-relevant spec push, the spec's notify-spec-consumers.yml dispatches spec-released, and bump-spec.yml calls aitp-ci's bump-spec-ref to open a PR that moves the pin. The PR is held for review and its own CI runs the new fixtures.

spec-canary.yml is the wire canary. It runs daily, and on demand, against the spec's floating main. It is not a required check. When it fails it comments on one tracking issue ("Spec canary: conformance fails against spec main"), opening it if none is open, and a green run closes that issue.

Usage and error contract

Every verifier entry point returns normally on success and raises AitpError (aitp_verifier.errors) on rejection; malformed remote input never escapes as a raw KeyError/TypeError/RecursionError. Caller bugs are the exception: a missing revocation policy (on verify_tct, also no issuer_revocation_list.fail_mode fallback) or a missing required argument raises a plain KeyError (see CHANGELOG.md). jcs raises JcsError and minter raises MinterError — they are not verifier entry points. Error codes and their meaning are defined by the spec's error-code registry, not restated here. Security-relevant behavior changes are tracked in CHANGELOG.md.

Cross-implementation checks

aitp-rs mints artifacts that this repo verifies, and verifies a session bundle this repo minted (committed in aitp-rs's tests/xcheck-fixtures/) — see aitp-rs testing § cross-implementation acceptance and conformance. That job pins this repo at a specific commit (tests/AITP_VERIFIER_PY_VERSION in aitp-rs), so it does not track main here.

Development

pip install -e ".[dev]"
pytest          # KAT re-derivation, signed-example verify, full pack has no FAIL
mypy            # --strict, clean

Requires Python ≥ 3.11 and cryptography. The runner takes --spec-dir; pytest resolves the spec checkout from $AITP_SPEC, then a sibling agentidentitytrustprotocol/ directory, and fails loudly if neither exists (set AITP_SPEC=none to deliberately run only the spec-independent subset instead).

License

Apache-2.0.

Metadata

Release files for aitp-verifier 0.1.1

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

Source distribution (sdist)

Source distribution for aitp-verifier 0.1.1
File Size Uploaded Provenance Actions
aitp_verifier-0.1.1.tar.gz 209.9 kB With provenance Details for aitp_verifier-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for aitp-verifier 0.1.1
File Interpreter ABI Platform Actions
aitp_verifier-0.1.1-py3-none-any.whl Python 3 none any Details for aitp_verifier-0.1.1-py3-none-any.whl

Total release size: 327.3 kB

Release files / aitp_verifier-0.1.1.tar.gz

Download URL aitp_verifier-0.1.1.tar.gz
Size 209.9 kB
Tags Source
SHA-256 checksum
How to use checksums
89ac84d223066e1e62e4cef08d32e3e9917c7c2e727156efd1b14838551b5b58
BLAKE2b-256 checksum
How to use checksums
e5c2aefc542b893848e1159d9277d1ac19893c2126be59e218b904083314910c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Release files / aitp_verifier-0.1.1-py3-none-any.whl

Download URL aitp_verifier-0.1.1-py3-none-any.whl
Size 117.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cb8333074c5c8637c1d2f0cd2bbe5b2c328f0a3172733b318c5defa2d29eaa21
BLAKE2b-256 checksum
How to use checksums
adb9f28f866935ef06147e302c1793e4aa9003d74de69289927def4816f7c0a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Oct 25, 2026.

Transparency log

Security for aitp-verifier 0.1.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.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for aitp_verifier-0.1.1.tar.gz

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 Oct 25, 2026.

Transparency log

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