Skip to main content
Standalone, offline verification of an Execution Trust Record. Python counterpart to packages/crypto/src/OfflineVerifier.ts (PQC audit RED-1, docs/internal/VERIFICATION-GAPS.md) — proves the canonical serialization algorithm and Ed25519 verification are independently reproducible in a second language, not just documented as “should be portable.” Zero network calls, zero disk reads (beyond files the caller explicitly passes in), zero environment variables. Large records (over 4096 bytes of canonical content) may have been signed by AWS KMS as a fixed size commitment, because KMS caps a raw Ed25519 message at 4096 bytes. This module accepts a raw signature for any record, and additionally accepts the commitment form for a record over that limit (see docs/internal/adr/ADR-0010). A commitment signature over a record at or below the limit is rejected. A hybrid-signed record’s signatures array (one Ed25519 entry and one ML-DSA-65 entry, dilithium3) is verified over the message for its schema version. Version 3 (whole-record) covers every top-level field except the signatures, the schema version, verifications and receipts. Verifying ML-DSA-65 needs cryptography 47.0.0 or later.

verify_execution_trust_record_offline

trust_record is a plain dict, exactly as json.load() would produce from a Trust Record JSON file or API response body, or the ExecutionTrustRecord that client.trust_record() returns. public_keys maps keyId -> PEM-encoded public key text. Schema version 3 only (decision D24): the signatures array covers the whole record. A record with one valid entry is accepted, unless it was created at or after hybrid_required_from (ADR-0016), where both hybrid entries are required.

verify_execution_intent_offline

Python counterpart to verifyExecutionIntentOffline() in packages/crypto/src/OfflineVerifier.ts (ADR-0012). No network call, no database, no environment variable: only the intent and the public key(s). intent is a plain dict, exactly as json.load() would produce from the intent field of GET /execution-intents/:id, or the ExecutionIntent at client.execution_intent(id).intent. public_keys maps keyId to PEM-encoded public key text. A valid result proves the intent was signed by the holder of that key and has not been altered. It does NOT prove the action was released, or what its result was: an intent is written BEFORE release.