Skip to main content

Module types

Module types 

Source
Expand description

Ratify Protocol v1 types.

Every public key and every signature is a hybrid pair: one Ed25519 component and one ML-DSA-65 (FIPS 204) component. Both must verify.

Structs§

AgentIdentity
An AI agent’s identity.
Anchor
Optional external binding for higher-assurance identity.
Constraint
DelegationCert
Signed authorization from a principal to an agent.
HumanRoot
Master identity for a human (or tenant admin).
HybridPrivateKey
Both component private keys. Never serialized to the wire.
HybridPublicKey
Ed25519 + ML-DSA-65 public key pair.
HybridSignature
Ed25519 + ML-DSA-65 signature pair over the same canonical bytes.
KeyRotationStatement
Signed continuity statement from an old root key to a new root key.
PolicyVerdict
HMAC-bound cached policy decision (SPEC §17.6). The policy equivalent of SessionToken: issued once by a commercial policy backend, accepted locally by the verifier for the rest of valid_until without re-calling the backend.
ProofBundle
Proof an agent presents to a verifier.
ReceiptParty
One party to a TransactionReceipt.
ReceiptPartySignature
Hybrid signature by a party over the canonical receipt signable.
RevocationList
Signed list of revoked cert IDs, served by the issuer.
RevocationPush
v1.1 signed push notification of newly revoked cert IDs.
SessionToken
v1.1 verifier-issued credential that caches a verified chain. MAC = HMAC-SHA256(session_secret, session_token_sign_bytes(token)). The session secret is private to the verifier and never leaves its trust boundary.
StreamContext
Verifier state tracked per stream_id for v1.1 stream-bound bundles.
TransactionReceipt
v1.1 canonical envelope for a multi-party, atomic transaction.
TransactionReceiptResult
Outcome of verify_transaction_receipt.
VerificationReceipt
Verifier-signed attestation that a specific ProofBundle was verified at a specific moment with a specific outcome (SPEC §17.5).
VerifierContext
Application-supplied inputs for evaluating first-class constraints. A cert bearing a constraint whose required context field is absent will be rejected with constraint_unverifiable (fail-closed).
VerifyOptions
Options passed to verify_bundle.
VerifyResult
Deterministic output of verify_bundle. Always check valid first.
WitnessEntry
v1.1 element in a hash-chain append-only witness log.

Enums§

IdentityStatus
Identity status values in a VerifyResult (SPEC §5.9). Granular failure statuses (scope_denied, constraint_denied, etc) let callers route on the enum directly — they do not have to parse error_reason text.
ParamsValue
Extension-constraint parameter value under the restricted value model (SPEC §5.7.1): null, booleans, strings, safe integers (|n| ≤ 2^53−1), and arrays/objects of these. Floats and non-integer numbers are prohibited; integers beyond the safe range travel as decimal strings. Object keys are held in a BTreeMap so canonical serialization emits them in byte-lex order (RFC 8785) with no extra sort.

Constants§

CHALLENGE_WINDOW_SECONDS
ED25519_PUBLIC_KEY_SIZE
ED25519_SIGNATURE_SIZE
MAX_AGENT_NAME_LENGTH_BYTES
Bounds AgentIdentity.name (UTF-8 bytes), enforced at construction.
MAX_CONSTRAINTS_PER_CERT
Bounds len(DelegationCert.constraints).
MAX_DELEGATION_CHAIN_DEPTH
Maximum number of certs in a delegation chain. A wire-determinism and denial-of-service bound, not cryptography (SPEC §5.1); raised from 3 to 8 in v1.0.0-alpha.16 for multi-hop agent topologies.
MAX_IDENTIFIER_LENGTH_BYTES
Bounds resource_path’s resource_id (SPEC §5.1).
MAX_JSON_NESTING_DEPTH
Bounds JSON container nesting in wire documents, enforced during parse.
MAX_PROOF_BUNDLE_BYTES
Bounds the encoded size of a ProofBundle. Wire decoders enforce it BEFORE parsing; an oversized payload is rejected without ever being parsed.
MAX_SCOPES_PER_CERT
Bounds len(DelegationCert.scope).
MAX_SCOPE_LENGTH_BYTES
Bounds the UTF-8 byte length of a single scope.
MLDSA65_PUBLIC_KEY_SIZE
MLDSA65_SIGNATURE_SIZE
NO_EXPIRY_SENTINEL
The expires_at value that means “no expiry (until revoked)”: 4070908799 = 2099-12-31 23:59:59 UTC. DelegationCert.expires_at is a required i64 with no null representation, so open-ended delegations carry this sentinel in the signed bytes. Conformant implementations MUST treat a cert with expires_at == NO_EXPIRY_SENTINEL as “no expiry (until revoked)” in display and policy evaluation — NOT as a literal 2099 expiry. Verification is unchanged: the sentinel is a future timestamp, so the temporal check passes; revocation is the sole termination mechanism for such certs. See SPEC §5.7.
PROTOCOL_VERSION

Traits§

AnchorResolver
Resolves a verified human_id to its external-identity binding (SPEC §17.8). Errors are non-fatal: the verifier MUST NOT fail the bundle because the resolver errored — it silently leaves VerifyResult.anchor None and continues.
AuditProvider
Pluggable audit-receipt persistence (SPEC §17.3).
ConstraintEvaluator
Pluggable evaluator for extension constraint types (SPEC §17.7).
PolicyProvider
Pluggable evaluator for verifier-local policy (SPEC §17.2).
RevocationProvider
Pluggable provider for revocation state (SPEC §17.1).

Functions§

is_canonical_constraint_type
Reports whether t is one of the canonical v1 constraint kinds (SPEC §5.7.2). params is permitted only on non-canonical types.

Type Aliases§

InvocationCounter
Callback answering “how many invocations of this cert in this window?” — (cert_id, window_s) -> count. Used by rate-limit constraints. A negative return means the count is unavailable; max_rate then fails closed with constraint_unverifiable.