Error Code Registry

AITP error codes returned in error envelopes (AitpError.code), with one exception: CHALLENGE_REFUSED travels in the transport of the challenge it refuses (see Pinned-admission codes). AITP is JSON-only; codes are string constants in the canonical JSON wire format (see RFC-AITP-0001 §5.6).

Stability: The codes listed below are stable for v0.3. Implementations MUST treat unknown codes as opaque failures and MUST NOT key behavior off codes that are not in this registry. New codes can be added without an RFC; renaming or removing an existing code is a breaking change and requires the RFC process. (v0.2 renamed DELEGATION_INVALID_GRANT_PROOF → DELEGATION_INVALID_VOUCHER via that process, as part of the JWS migration — see the delegation table below.) "Without an RFC" waives the need for a new RFC document, not VERSIONING.md's change classes: adding a code is a backward-compatible addition there. Note that the change class and the version position are separate questions: pre-1.0, VERSIONING.md reserves the minor position for the protocol revision, so a backward-compatible addition made inside an existing protocol revision takes a patch-position bump on the RFCs whose normative text gains the code, and records its minor class in the CHANGELOG. The two policies answer different questions — whether a new document is required (no) and how the version numbers move (patch position, minor class) — and compose rather than conflict.

spec_status column. Each code below carries a spec_status of either core or draft. core codes are part of v0.3 conformance and MAY be emitted by any conformant implementation. draft codes are reserved for the opt-in draft RFCs (currently RFC-AITP-0010 Session Trust Bundle, RFC-AITP-0011 Multi-hop Delegation and RFC-AITP-0013 TCT Renewal) and MUST NOT be used except when implementing the cited draft RFC. Conformance runners MUST treat receipt of a draft code from an implementation that does not opt into the corresponding draft as a non-conformance.

Code naming convention

Object-level failures use the <OBJECT>_<FAILURE> form (e.g. MANIFEST_SIGNATURE_INVALID, TCT_EXPIRED, DELEGATION_SCOPE_EXCEEDED). Envelope-level failures use bare codes (e.g. INVALID_SIGNATURE, REPLAY_DETECTED). This granularity is deliberate: a consumer needs to know which object failed, not only that something failed. Codes that apply uniformly across objects — UNKNOWN_VERSION, UNKNOWN_FIELD — also use the bare form: the failing object is whichever one was being verified, and prefixed variants per object would multiply names without adding information. New codes proposed via the RFC process MUST follow this convention.

Structural rejection

A verifier rejects an artifact structurally when the object does not match its schema at all — a missing REQUIRED member, a member of the wrong type, a value outside its grammar. Every artifact RFC positions this check before the cryptographic steps, so a malformed object is rejected before any signature work is spent on it. This table is normative: implementations MUST use the code named here so that two independent implementations reject the same malformed artifact with the same code.

ArtifactStructural rejection code
EnvelopeINVALID_ENVELOPE
Handshake payloadINVALID_ENVELOPE — the payload is a member of the envelope, and RFC-AITP-0004 §5.2 step 4 and §6 already map payload-level defects this way
ManifestMANIFEST_INVALID
Identity descriptorIDENTITY_FAILED
Revocation snapshotREVOCATION_SNAPSHOT_INVALID
Session Trust BundleSESSION_BUNDLE_INVALID (draft)
TCTTCT_SIGNATURE_INVALID
Grant voucherDELEGATION_INVALID_VOUCHER
Delegation tokenDELEGATION_INVALID_SIGNATURE

Two rules govern the table:

  • UNKNOWN_FIELD is more specific and wins. When the object's only defect is a member outside its schema and outside its extensions / ext namespace, the code is UNKNOWN_FIELD (RFC-AITP-0001 §7), not the code above. The codes above cover every other structural defect.
  • The compact-JWS artifacts deliberately collapse onto their signature-family code. A TCT, voucher, or delegation token is verified by decoding a JWS; a payload that will not decode into the expected claim set is indistinguishable, to the caller, from one whose signature does not verify — in both cases the artifact failed to produce a trustworthy claim set, and distinguishing them would leak parse detail about an unauthenticated token. This collapse is intentional; it is written down here because it was previously only a convention, which let two implementations diverge and both believe they were conformant (issue #39).

The JCS-profile artifacts do not collapse this way: they are verified as JSON objects against a published schema, the caller is expected to fix the object, and a misleading code sends an operator looking in the wrong place. MANIFEST_INVALID and REVOCATION_SNAPSHOT_INVALID exist so that a Manifest or snapshot with a shape defect is not reported as a signature failure — the mapping two implementations were previously forced to invent for themselves.

Envelope-level codes

CodeMeaningRetryablespec_statusSpec
INVALID_ENVELOPEEnvelope failed schema validation.falsecoreRFC-AITP-0001 §5.6
INVALID_SIGNATURESignature verification failed.falsecoreRFC-AITP-0001 §5.4
REPLAY_DETECTEDDuplicate message_id.falsecoreRFC-AITP-0001 §5.5
TIMESTAMP_EXPIREDTimestamp outside tolerance.truecoreRFC-AITP-0001 §5.5
UNKNOWN_VERSIONUnsupported version field.falsecoreRFC-AITP-0001 §7
UNKNOWN_FIELDA signed object carried a member outside its schema and outside its extensions / ext extension namespace. Unknown keys inside the namespace are ignored, never rejected — the asymmetry is deliberate (forward compatibility rides exclusively on the namespace). One generic code for every signed AITP object: the JCS-profile artifacts (envelope, Manifest, handshake payloads, revocation snapshot, session bundle) spell the namespace extensions; the compact-JWS artifacts (TCT, grant voucher, delegation token) spell it ext, and the unknown member is an unknown claim in the decoded payload. More specific than INVALID_ENVELOPE when an envelope's only defect is an unknown member.falsecoreRFC-AITP-0001 §7
IDENTITY_FAILEDIdentity binding could not be verified.falsecoreRFC-AITP-0002
POLICY_VIOLATIONRequested capability not granted.falsecoreRFC-AITP-0004 §4
GRANT_OVERFLOWPeer-issued TCT grants exceed offered_capabilities.falsecoreRFC-AITP-0004
INSUFFICIENT_GRANTSReceived peer-issued TCT lacks a capability listed in the receiver's own required_peer_capabilities.falsecoreRFC-AITP-0004 §5.3/§5.4
KEY_RESOLUTION_FAILEDCould not resolve issuer or peer keys.truecoreRFC-AITP-0007

Token-format codes (RFC-AITP-0001 §5.4.5)

Returned when a compact-JWS artifact (TCT, grant voucher, delegation token) fails the JOSE-header enforcement rules. The two codes are deliberately distinct so conformance fixtures can assert the rejection reason.

CodeMeaningRetryablespec_status
TOKEN_ALG_MISMATCHJWS header alg is not the sole value derived from the signer's AID — including none (any capitalization) and unknown algorithms.falsecore
TOKEN_TYP_MISMATCHJWS header typ does not exactly match the value expected for the verification context (aitp-tct+jwt, aitp-grant+jwt, or aitp-delegation+jwt).falsecore

TCT-verification codes (RFC-AITP-0005)

Returned when a peer evaluates a TCT outside the handshake context — e.g. via a TCT verification API or local verification of a presented TCT.

CodeMeaningRetryablespec_status
TCT_EXPIREDTCT exp is in the past.falsecore
TCT_REVOKEDTCT jti is in the issuing peer's deny list.falsecore
TCT_SIGNATURE_INVALIDTCT JWS signature does not validate under the issuing peer's key. Also the TCT's structural-rejection code (see Structural rejection): a claim set that does not decode, or a jti outside the RFC-AITP-0005 §2.2 layout. It is also the code for these rejections, which run after the signature has verified and so are not structural: in a grant context, a self-issued TCT (iss == sub) or any TCT carrying the aitp.attestation marker grant (RFC-AITP-0005 §7.2 step 5); and, to a relying party verifying a self-attestation, an attestation-shape defect, an ext lacking the key it expects, or an issuer key the relying party's records do not show as trusted at iat (RFC-AITP-0005 §5.3).falsecore
TCT_EXPIRES_AFTER_MANIFESTTCT exp exceeds the issuing peer's Manifest expires_at (RFC-AITP-0004 §4.3). The peer-issued TCT cannot outlive the credential that authenticates its issuer's key.falsecore

Downstream PoP codes (RFC-AITP-0005 §6)

CodeMeaningRetryablespec_status
POP_CHALLENGE_INVALIDChallenge envelope was malformed or stale.falsecore
POP_RESPONSE_INVALIDResponse signature failed verification against the subject key bound via cnf.jkt.falsecore

Pinned-admission codes (RFC-AITP-0002 §3.4)

Returned by a verifier implementing the OPTIONAL one-way pinned-admission profile of RFC-AITP-0002 §3.4. A presentation that fails verification uses the existing codes (IDENTITY_FAILED, INVALID_ENVELOPE, INVALID_SIGNATURE, REPLAY_DETECTED, TIMESTAMP_EXPIRED), per the §3.4 check order.

Transport note. CHALLENGE_REFUSED is the one code in this registry that is not delivered in an AITP error envelope. The challenge it refuses is not an envelope (RFC-AITP-0002 §3.4, challenge format), so the refusal travels in the challenge's own transport. RFC-AITP-0002 §3.4 gives an informative HTTP mapping: status 503, a Retry-After header, and the body {"error":"CHALLENGE_REFUSED"}.

CodeMeaningRetryablespec_status
CHALLENGE_REFUSEDThe verifier refused to issue a new pop_nonce challenge because its bound on outstanding nonces is reached; RFC-AITP-0002 §3.4 requires refusal rather than eviction of unexpired nonces. Retrying after outstanding nonces are consumed or expire can succeed. A per-source rate-limit refusal is an HTTP 429 instead, which the profile REQUIRES (RFC-AITP-0002 §3.4, tightening RFC-AITP-0009 §3.1); a client MUST be able to tell the two apart.truecore

Manifest codes (RFC-AITP-0003)

CodeMeaningRetryablespec_status
MANIFEST_EXPIREDexpires_at is in the past.falsecore
MANIFEST_SIGNATURE_INVALIDSignature verification failed.falsecore
MANIFEST_INVALIDManifest failed schema validation — a missing REQUIRED member, a member of the wrong type, or a value outside its grammar (RFC-AITP-0003 §5 step 2). Mirrors INVALID_ENVELOPE for the Manifest. MUST NOT be reported as MANIFEST_SIGNATURE_INVALID: the signature was never reached. When the only defect is an unknown member outside extensions, use the more specific UNKNOWN_FIELD instead.falsecore
MANIFEST_POP_FAILEDProof-of-possession verification failed.falsecore
INCOMPATIBLE_TRUST_ANCHORSNo overlap in accepted trust anchors.falsecore
INCOMPATIBLE_IDENTITY_TYPEPeer's identity.type is not present in the receiver's accepted_identity_types. More specific than INCOMPATIBLE_TRUST_ANCHORS: signals identity-type incompatibility (e.g. pinned_key vs. oidc) rather than trust-anchor incompatibility.falsecore
MANIFEST_VERSION_UNKNOWNversion not supported by this implementation.falsecore

Mutual Handshake codes (RFC-AITP-0004)

Returned in error envelopes during the four-message handshake.

CodeMeaningspec_status
INCOMPATIBLE_TRUST_ANCHORSNo trust-anchor overlap.core
INCOMPATIBLE_IDENTITY_TYPEPeer's identity type not in accepted_identity_types.core
MANIFEST_INVALIDPeer's Manifest failed schema validation.core
MANIFEST_SIGNATURE_INVALIDPeer's Manifest signature invalid.core
MANIFEST_POP_FAILEDPeer's Manifest PoP failed.core
POP_VERIFICATION_FAILEDRound-2 PoP signature failed.core
NONCE_MISMATCHpop_nonce_echo mismatch.core
PEER_MISMATCHMUTUAL_HELLO_ACK sender is not the AID the initiator addressed in MUTUAL_HELLO (RFC-AITP-0004 §5.2 step 3).core
AUDIENCE_MISMATCHTCT aud ≠ self AID.core
GRANT_OVERFLOWTCT grants exceed peer's offered_capabilities.core
TCT_EXPIREDTCT already expired.core
TCT_EXPIRES_AFTER_MANIFESTTCT exp exceeds issuer's Manifest expires_at.core
TOKEN_ALG_MISMATCHReceived TCT/voucher JWS alg not the AID-derived value.core
TOKEN_TYP_MISMATCHReceived TCT/voucher JWS typ not the expected value.core
IDENTITY_FAILEDPeer identity verification failed.core
REPLAY_DETECTEDDuplicate message_id.core
TIMESTAMP_EXPIREDEnvelope timestamp outside tolerance.core
UNKNOWN_FIELDA handshake payload (or other signed object in the exchange) carried a member outside its schema and outside extensions (RFC-AITP-0001 §7).core

Manifest-service codes

Returned by an HTTP endpoint serving /.well-known/aitp-manifest or by an out-of-band manifest lookup.

CodeMeaningspec_status
MANIFEST_EXPIREDexpires_at in the past.core
MANIFEST_SIGNATURE_INVALIDSignature verification failed.core
MANIFEST_POP_FAILEDProof-of-possession failed.core
MANIFEST_INVALIDManifest failed schema validation.core
MANIFEST_VERSION_UNKNOWNVersion not supported.core
MANIFEST_NOT_FOUNDNo manifest for the requested AID.core

Revocation codes (RFC-AITP-0008)

Returned when a consuming peer verifies a signed revocation snapshot pulled from an issuing peer's ListRevoked endpoint (RFC-AITP-0008 §1.5). Before these codes existed the registry had no revocation-specific family at all, and implementations borrowed TCT_SIGNATURE_INVALID — a code about a token, for a failure of the snapshot that lists tokens (issue #39).

CodeMeaningRetryablespec_status
REVOCATION_SNAPSHOT_INVALIDRevocation snapshot failed schema validation — the transport wrapper carried members other than revocation_list and signature, or the inner body has a missing/mistyped member. When the only defect is an unknown member outside extensions, use UNKNOWN_FIELD instead.falsecore
REVOCATION_SNAPSHOT_SIGNATURE_INVALIDSnapshot signature does not validate under the issuing peer's key, resolved from that peer's Manifest. Distinct from TCT_SIGNATURE_INVALID, which is about a token's own JWS.falsecore

Not to be confused with TCT_REVOKED. A snapshot that is merely stale or unreachable is not invalid — it is absent, and what happens next is the consuming peer's revocation_policy.mode decision (RFC-AITP-0008 §3.1), not a snapshot-verification failure. Under fail_closed that decision surfaces as TCT_REVOKED — unknown revocation status is treated as revoked, which is what fail-closed means — and conformance fixture rev-001 pins it. The two codes above are for a snapshot the peer did obtain and could not trust, and they are reported by an operation that verifies the snapshot itself. For the token decision that snapshot is discarded and counts as absent, so the mode decides it the same way (tct-022, tct-023; RFC-AITP-0008 §1.5).

Delegation codes (RFC-AITP-0006)

Delegation-layer codes carry the DELEGATION_ prefix so they cannot be confused with the envelope-level or manifest-level codes that share the same root.

CodeMeaningspec_status
DELEGATION_AUDIENCE_MISMATCHaud ≠ verifier's AID.core
DELEGATION_SCOPE_EXCEEDEDscope ⊄ voucher.grants.core
DELEGATION_INVALID_VOUCHEREmbedded voucher JWS signature invalid, voucher.iss ≠ verifier's AID, or voucher.sub ≠ outer iss. Renamed in v0.2 from DELEGATION_INVALID_GRANT_PROOF (the grant_proof reconstruction mechanism was removed by the JWS migration).core
DELEGATION_SOURCE_TCT_REVOKEDvoucher.src_jti is in the issuing peer's deny list.core
DELEGATION_INVALID_SIGNATUREOuter delegation JWS signature invalid, or self-delegation (iss == sub).core
DELEGATION_EXPIREDToken or voucher expired, or exp > voucher.exp.core
DELEGATION_POP_FAILEDProof-of-possession failed.core
DELEGATION_MULTIHOP_NOT_SUPPORTEDMulti-hop attempt detected (chain claim present without RFC-AITP-0011 opt-in).core

DELEGATION_MULTIHOP_NOT_SUPPORTED is a core code, not a draft code. Implementations with default max_hops = 0 MUST emit this code for any delegation token carrying a chain claim — rejecting multi-hop is the required core behavior, not an optional one. The code is distinct from the draft codes in the "Multi-hop delegation codes (RFC-AITP-0011, opt-in)" table below: those codes (DELEGATION_HOP_LIMIT_EXCEEDED, DELEGATION_CHAIN_HASH_MISMATCH) are emitted by implementations that have opted into multi-hop and are validating chain semantics. DELEGATION_MULTIHOP_NOT_SUPPORTED is the core refusal to even process the chain — a structural rejection before any per-hop verification. See conformance fixture del-004 for the pinned v0.1-era behavior and its v0.2 sibling for the claim-shaped equivalent.

Multi-hop delegation codes (RFC-AITP-0011, opt-in)

These codes are reserved for multi-hop delegation (RFC-AITP-0011 is Draft and not part of core conformance). Implementations that do not opt in will not emit them.

CodeMeaningspec_status
DELEGATION_HOP_LIMIT_EXCEEDEDChain length exceeds max_delegation_hops (default 3).draft
DELEGATION_CHAIN_HASH_MISMATCHchain_hash does not match the chain array contents (truncation or tampering detected).draft

Session Trust Bundle codes (RFC-AITP-0010, opt-in)

These codes are reserved for Session Trust Bundles (RFC-AITP-0010 is Draft and not part of core conformance). The granular code set was pinned to align with the aitp-rs adapter that emits them ahead of bundle conformance.

CodeMeaningspec_status
BUNDLE_INVALID_SIGNATURECoordinator's outer bundle signature failed verification under the coordinator's Manifest key.draft
BUNDLE_VERSION_MISMATCHversion is not "aitp/0.3" (or a later version this implementation supports).draft
BUNDLE_EXPIREDexpires_at is in the past at verification time.draft
BUNDLE_EXPIRY_WINDOW_INVARIANTexpires_at is greater than min(participants[*].tct.exp) (violates RFC-AITP-0010 §6).draft
BUNDLE_COORDINATOR_ISSUER_MISMATCHOne or more participant TCT iss claims do not equal coordinator.draft
BUNDLE_AUDIENCE_MISMATCHA participant TCT aud claim does not equal that participant's aid.draft
BUNDLE_EMPTY_PARTICIPANTSparticipants array is empty.draft
BUNDLE_PARTICIPANT_TCT_INVALIDAt least one embedded participant TCT failed standard TCT verification.draft
BUNDLE_NOT_MEMBERReceiver's AID is not in participants[*].aid.draft
SESSION_BUNDLE_INVALIDAggregate fallback — implementations MAY return this when a deployment policy requires a single-error surface for bundles, in lieu of the specific codes above.draft

TCT renewal codes (RFC-AITP-0013, opt-in)

TCT renewal (RFC-AITP-0013 is Draft and not part of core conformance) registers one code of its own, below. An issuer that does not offer renewal advertises no renew_uri and never emits it.

CodeMeaningRetryablespec_status
RENEWAL_UNAVAILABLEThe issuer could not complete renewal because an issuer-side dependency it must consult (its revocation state, its renewal nonce store) was unavailable. The issuer does not mint. It is not TCT_REVOKED: the current TCT is not known to be revoked. The issuer SHOULD send it with HTTP 503; the holder MAY retry with backoff and a fresh pop_nonce before the current TCT's exp (RFC-AITP-0013 §4 step 4, §5, §6).truedraft

Every other renewal failure reuses a code defined in its own table above; the table below gives the meaning each takes in renewal, and lists RENEWAL_UNAVAILABLE at the steps that raise it. An issuer that does not offer renewal emits none of them for renewal.

StepCodeMeaning in renewal
Issuer, §4 step 1POP_RESPONSE_INVALIDThe renewal request is not an object with exactly current_tct, pop_nonce and pop_signature, or pop_nonce is not 16 bytes in 22 unpadded base64url characters.
Issuer, §4 step 2TCT_SIGNATURE_INVALID, TOKEN_TYP_MISMATCH, TOKEN_ALG_MISMATCH, UNKNOWN_FIELDcurrent_tct fails RFC-AITP-0005 §7.2 as read by its issuer: not issued by this issuer, aud ≠ sub, or a grant-context defect.
Issuer, §4 step 2TCT_EXPIREDcurrent_tct has expired. An expired TCT is never renewed.
Issuer, §4 step 2TCT_EXPIRES_AFTER_MANIFESTcurrent_tct.exp exceeds the issuer's current Manifest expires_at.
Issuer, §4 step 3POP_RESPONSE_INVALIDpop_signature does not verify under the sub key over the renewal PoP input (RFC-AITP-0013 §3.1).
Issuer, §4 step 4TCT_REVOKEDcurrent_tct.jti is in the issuer's deny list. Only then: an issuer that cannot read its own revocation state answers RENEWAL_UNAVAILABLE.
Issuer, §4 step 4RENEWAL_UNAVAILABLEThe issuer cannot determine its own revocation state for current_tct.jti: its deny list, or the source that produces it, cannot be read.
Issuer, §4 step 5 (§5)RENEWAL_UNAVAILABLEThe renewal nonce store cannot be read or cannot record the nonce.
Issuer, §4 step 5REPLAY_DETECTEDThe issuer has already accepted a renewal request with this pop_nonce.
Issuer, §4 step 6POLICY_VIOLATIONNo grant survives re-evaluation against the issuer's current Manifest and policy, or policy refuses renewal to this holder.
Holder, §6.1 step 2PEER_MISMATCHThe response envelope's sender.agent_id is not the current TCT's iss.
Holder, §6.1 step 3NONCE_MISMATCHpop_nonce_echo is not the pop_nonce the holder sent.
Holder, §6.1 step 5AUDIENCE_MISMATCHThe renewed TCT's sub is not the holder, or its cnf.jkt differs from the current TCT's.
Holder, §6.1 step 6GRANT_OVERFLOWThe renewed TCT carries a grant the current TCT does not.

Adding a code

Open a PR adding a row to one of the tables above. Verifiers MUST NOT reveal which specific policy check failed beyond the registered code; reason strings are informational only.