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§
- Agent
Identity - An AI agent’s identity.
- Anchor
- Optional external binding for higher-assurance identity.
- Constraint
- Delegation
Cert - Signed authorization from a principal to an agent.
- Human
Root - Master identity for a human (or tenant admin).
- Hybrid
Private Key - Both component private keys. Never serialized to the wire.
- Hybrid
Public Key - Ed25519 + ML-DSA-65 public key pair.
- Hybrid
Signature - Ed25519 + ML-DSA-65 signature pair over the same canonical bytes.
- KeyRotation
Statement - Signed continuity statement from an old root key to a new root key.
- Policy
Verdict - 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 ofvalid_untilwithout re-calling the backend. - Proof
Bundle - Proof an agent presents to a verifier.
- Receipt
Party - One party to a TransactionReceipt.
- Receipt
Party Signature - Hybrid signature by a party over the canonical receipt signable.
- Revocation
List - Signed list of revoked cert IDs, served by the issuer.
- Revocation
Push - v1.1 signed push notification of newly revoked cert IDs.
- Session
Token - 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.
- Stream
Context - Verifier state tracked per stream_id for v1.1 stream-bound bundles.
- Transaction
Receipt - v1.1 canonical envelope for a multi-party, atomic transaction.
- Transaction
Receipt Result - Outcome of verify_transaction_receipt.
- Verification
Receipt - Verifier-signed attestation that a specific ProofBundle was verified at a specific moment with a specific outcome (SPEC §17.5).
- Verifier
Context - 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). - Verify
Options - Options passed to
verify_bundle. - Verify
Result - Deterministic output of
verify_bundle. Always checkvalidfirst. - Witness
Entry - v1.1 element in a hash-chain append-only witness log.
Enums§
- Identity
Status - 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.
- Params
Value - 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
BTreeMapso 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’sresource_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.
- MLDS
A65_ PUBLIC_ KEY_ SIZE - MLDS
A65_ SIGNATURE_ SIZE - NO_
EXPIRY_ SENTINEL - The
expires_atvalue that means “no expiry (until revoked)”: 4070908799 = 2099-12-31 23:59:59 UTC.DelegationCert.expires_atis a required i64 with no null representation, so open-ended delegations carry this sentinel in the signed bytes. Conformant implementations MUST treat a cert withexpires_at == NO_EXPIRY_SENTINELas “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§
- Anchor
Resolver - Resolves a verified
human_idto its external-identity binding (SPEC §17.8). Errors are non-fatal: the verifier MUST NOT fail the bundle because the resolver errored — it silently leavesVerifyResult.anchorNoneand continues. - Audit
Provider - Pluggable audit-receipt persistence (SPEC §17.3).
- Constraint
Evaluator - Pluggable evaluator for extension constraint types (SPEC §17.7).
- Policy
Provider - Pluggable evaluator for verifier-local policy (SPEC §17.2).
- Revocation
Provider - Pluggable provider for revocation state (SPEC §17.1).
Functions§
- is_
canonical_ constraint_ type - Reports whether
tis one of the canonical v1 constraint kinds (SPEC §5.7.2).paramsis permitted only on non-canonical types.
Type Aliases§
- Invocation
Counter - 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_ratethen fails closed withconstraint_unverifiable.