Agent Context Distribution Protocol (ACDP) — Capabilities & Errors

RFC-ACDP-0007

Document: RFC-ACDP-0007 Version: 0.3.0 Status: Community Standards Track (Final)

This RFC specifies the registry capability declaration document and the standard error envelope used by all ACDP endpoints.


1. Status of This Memo

This document is a Final ACDP specification (acdp/0.1.0, with Final amendments through acdp/0.4.0). It is stable for the released lines; subsequent breaking changes require a new RFC and a version bump per VERSIONING.md.

Passages marked (0.2.0) are amendments from the acdp/0.2.0 Trust & Hardening program. Passages marked (0.4.0) are amendments from the acdp/0.4.0 witness-cosigning program (the invalid_witness_cosignature error code, RFC-ACDP-0015 §10). Passages marked (0.3.0) are amendments from the acdp/0.3.0 program (mandatory Idempotency-Key support per RFC-ACDP-0003 §6.4, the OPTIONAL limits.max_publish_per_minute capabilities field, and the RFC-ACDP-0011/0012/0013 surfaces). Both lines are Final as of 2026-07-05, promoted after their conformance packs passed against two independent interoperating implementations (see CHANGELOG.md); the markers record provenance, not status. Neither set changes any v0.1.0 body field, hash, or signature semantic; everything not so marked remains Final and wire-frozen for acdp/0.1.0.

Markers and status — read this before relying on a marked passage. A parenthetical version marker records which release line introduced a passage, not that the passage is Final. Passages marked (0.2.0), (0.3.0) and (0.4.0) belong to Final lines. Passages marked (0.5.0) belong to the 0.5.0 line, which is Final (promoted 2026-11-06, VERSIONING.md) and wire-frozen with it. Everything not marked at all is Final and wire-frozen for acdp/0.1.0. The document-level status above describes the unmarked body of this RFC and its Final-line amendments; the (0.5.0) passages share it now that the 0.5.0 line is Final.

The key words MUST, MUST NOT, REQUIRED, SHALL, SHALL NOT, SHOULD, SHOULD NOT, RECOMMENDED, MAY, and OPTIONAL in this document are to be interpreted as described in BCP 14 (RFC 2119, RFC 8174) when, and only when, they appear in all capitals — the conventions of RFC-ACDP-0001 §2.


2. Motivation

Two pieces of information must be discoverable about every registry:

  1. What does it support? — Which signature algorithms, profiles, and limits.
  2. How does it report failures? — A consistent error envelope and code registry, so consumers can react programmatically.

Both must be discoverable without prior bilateral configuration. The well-known capabilities document and the standard error envelope serve those needs respectively.


3. Capabilities Document

GET /.well-known/acdp.json

Returns the registry's capability declaration. Conforms to schemas/json/acdp-capabilities.schema.json.

3.1 Required fields

FieldTypeDescription
acdp_versionstringThe ACDP specification version this registry implements. Form: <major>.<minor>.<patch>.
registry_didstringThe registry's own DID, typically did:web:<hostname>.
supported_signature_algorithmsarray of stringSignature algorithms accepted on publish. MUST contain at least "ed25519".
supported_did_methodsarray of stringDID methods this registry can resolve. MUST be non-empty and MUST include "did:web" (RFC-ACDP-0001 §5.4 mandates did:web for v0.1.0 producers; RFC-ACDP-0001 §5.11 specifies the resolution algorithm). (0.2.0) MAY additionally include "did:key" (pure resolution per RFC-ACDP-0001 §5.11.1). A registry that does not advertise "did:key" MUST reject a did:key publish with key_resolution_failed (permanent, HTTP 400) — this code choice is pinned here and by fixture dk-003: the condition is producer-caused and not retryable against this registry, so key_resolution_unreachable (transient, 502) and unsupported_algorithm (the algorithm may well be supported) are both wrong.
profilesarray of stringProfile(s) this implementation claims conformance to. Any registry MUST declare at least "acdp-registry-core". See RFC-ACDP-0001 §9. (0.2.0) The profile "acdp-registry-receipts" (RFC-ACDP-0010 §11) declares that the registry mints and serves registry receipts on every publish response and full retrieval — advertising it is a hard commitment: there is no degraded "receipts sometimes" mode and no receipt_unavailable error. Registries advertising it MUST also advertise acdp_version ≥ 0.2.0.
limits.max_payload_bytesintegerMaximum size of a publish request body in bytes.
limits.max_embedded_bytesintegerMaximum decoded size of any embedded data reference. Fixed at 65536 by the spec.

3.2 Optional fields

FieldTypeDescription
read_authentication_methodsarray of stringRead-authentication methods supported by this registry. At least one MUST be declared if the registry serves any non-public contexts. Defined values: http_signatures, mtls, oauth, bearer_jwt (0.5.0), bearer_static (0.5.0). See RFC-ACDP-0008 §6.2.
anonymous_public_readsbooleanWhether anonymous (unauthenticated) reads are permitted for public contexts. Default false. See RFC-ACDP-0008 §6.3.
supports_idempotency_keybooleanWhether this registry honors the Idempotency-Key header on POST /contexts. Default false. See RFC-ACDP-0003 §6. (0.3.0) A registry advertising acdp_version ≥ 0.3.0 MUST support the header and MUST advertise this field as true — the field stays in the document for introspection even though its value is no longer free (RFC-ACDP-0003 §6.4; §3.5 item 10; fixture idem-007).
limits.idempotency_key_ttl_secondsintegerHow long this registry retains idempotency-key mappings, in seconds. MUST be present when supports_idempotency_key is true. Range 86400 (24h) to 604800 (7d).
limits.max_publish_per_minuteinteger(0.3.0) OPTIONAL. The nominal per-agent publish ceiling this registry enforces on POST /contexts, in requests per minute. Integer ≥ 1. Advisory: producers SHOULD use it to pace publishes below the limiter's threshold. Its presence does NOT change the RFC-ACDP-0008 §4.3 requirements — per-agent rate limiting is REQUIRED whether or not the ceiling is advertised, and 429 responses MUST still carry Retry-After. The limits sub-object was a closed schema through 0.4.0 (§3.3.1), so this field is a 0.3.0 schema addition: strict pre-0.3.0 validators of limits will reject documents carrying it (same compatibility posture as registry_receipt on the closed publish response — validators must track the additive schema edit). (0.5.0) limits is Open from 0.5.0 (§3.3.1). Fixture caps-007.
limits.max_reads_per_minuteinteger(0.5.0) OPTIONAL. The nominal read ceiling this registry enforces per authenticated principal (effective_requester_did, RFC-ACDP-0008 §6.2) across its read endpoints, in requests per minute. Integer ≥ 1. Advisory: consumers SHOULD use it to pace reads below the limiter's threshold. Its presence does NOT change the RFC-ACDP-0008 §4.3 requirements: 429 responses MUST still carry Retry-After, which remains the authoritative backoff signal, and a registry MAY enforce tighter dynamic limits. Fixture caps-008.
limits.max_anonymous_reads_per_minuteinteger(0.5.0) OPTIONAL. The nominal read ceiling this registry enforces per source address on anonymous reads (RFC-ACDP-0008 §6.3), in requests per minute. Integer ≥ 1. Meaningful only when anonymous_public_reads is true. Advisory in the same sense as max_reads_per_minute. Fixture caps-008.
limits.change_retention_seconds, limits.max_change_filters, limits.max_changes_pageinteger(0.5.0) Changes-feed limits defined by RFC-ACDP-0018 §9. REQUIRED (with the floors stated there) on a registry claiming acdp-registry-changes, absent otherwise. Because that profile requires acdp_version ≥ 0.5.0, a consumer that relies on it already tracks the 0.5.0 limits schema.
limits.max_change_bucket_lengthinteger(0.5.0) OPTIONAL. The longest lineage_bucket / agent_bucket value, in hex digits, this registry accepts on GET /changes (RFC-ACDP-0018 §6.1, §9). Range 4 to 16. Its presence advertises bucket-filter support. It is a limits field added on the 0.5.0 line, so the rollout caution below applies to it as to the read ceilings. Fixture rec-010.

(0.5.0) Rollout of the read ceilings. Through 0.4.0 limits was closed (§3.3.1): a consumer built against a pre-0.5.0 schema rejects a document carrying max_reads_per_minute, max_anonymous_reads_per_minute or max_change_bucket_length, and then MUST NOT proceed (§3.5). Registries SHOULD NOT advertise any of these fields until the consumers they serve track the 0.5.0 schema (RFC-ACDP-0008 §4.3). Enforcing a read limiter is independent of advertising its ceiling. Because limits is Open from 0.5.0, this rollout caution applies only to the limits fields added on the 0.5.0 line against pre-0.5.0 consumers; a limits field added after 0.5.0 needs no such staging for consumers that implement 0.5.0 or later.

3.3 Forward-compatible additions

The capabilities document is additionalProperties: true to support forward compatibility — future versions of ACDP will add capability flags here as new features become available. Consumers MUST tolerate unknown fields.

Implementer note. The CapabilitiesDocument model MUST be deserialized with unknown-field tolerance enabled. Concrete patterns:

  • Rust (serde): add #[serde(flatten)] pub extensions: serde_json::Map<String, serde_json::Value> (or a typed BTreeMap<String, Value>) to capture unknown keys; do NOT annotate the struct with #[serde(deny_unknown_fields)].
  • Python (pydantic v2): set model_config = ConfigDict(extra="allow") on the capabilities model, OR keep the model loose and operate on dict[str, Any] for unknown keys.
  • Python (dataclasses or attrs): keep an explicit catch-all field (e.g. extensions: dict[str, Any] = field(default_factory=dict)) and route unknown keys into it.
  • TypeScript: no action needed by default — object types are open. Runtime decoders (zod, valibot) MUST use a passthrough or partial-strict mode (e.g. zod's .passthrough()); decoders configured to strip or fail unknown keys MUST NOT be used.
  • Go: unmarshalling into map[string]any or a struct with an Extensions json.RawMessage field both work; do NOT use json.UnmarshalDisallowUnknownFields.

Libraries that throw, panic, or strip unknown fields will break silently the next time ACDP adds a capability flag — for example, when push subscriptions ship in a future version, registries will start advertising supports_push_subscriptions: true, and a strict-decoder consumer will fail to read the document at all. The same forward-compat policy applies to the status field on registry state (RFC-ACDP-0004 §4.1).

3.3.1 Schema openness map (NORMATIVE)

ACDP uses a mix of CLOSED schemas (additionalProperties: false, used for tightly defined wire shapes where unknown fields signal a bug) and OPEN schemas (additionalProperties: true, used where forward compatibility matters). Consumers and registries MUST honor each schema's openness exactly as documented; treating a closed schema as open masks bugs, and treating an open schema as closed breaks forward compatibility.

SchemaOpennessadditionalProperties
acdp-publish-request.schema.jsonClosedfalse
acdp-publish-response.schema.jsonClosedfalse
acdp-search-response.schema.jsonClosedfalse
acdp-error.schema.jsonClosedfalse
acdp-error.schema.json (error.details)Opentrue
acdp-data-ref.schema.json (DataRef root object)Opentrue
acdp-data-ref.schema.json (embedded sub-object)Closedfalse
acdp-data-ref.schema.json (structured location object)Opentrue
acdp-context-body.schema.json (Body for retrieval)Opentrue
acdp-capabilities.schema.json (top level)Opentrue
acdp-capabilities.schema.json (limits sub-object)Open (0.5.0); Closed through 0.4.0true (0.5.0); false through 0.4.0
acdp-context.schema.json (full retrieval envelope)Opentrue
acdp-registry-state.schema.jsonOpentrue
match_summary (in acdp-common.schema.json)Closedfalse
signature (in acdp-common.schema.json)Closedfalse
data_period (in acdp-common.schema.json)Closedfalse
acdp-registry-receipt.schema.json (0.2.0)Closedfalse
acdp-lineage-head-receipt.schema.json (0.3.0)Closedfalse
acdp-log-leaf.schema.json (0.3.0)Closedfalse
acdp-log-checkpoint.schema.json (0.3.0)Closedfalse
acdp-log-inclusion.schema.json (0.3.0)Closedfalse
acdp-lifecycle-event.schema.json (0.3.0)Closedfalse — the event object is closed (every member is signed where a signature is present, RFC-ACDP-0013 §4); the event_type vocabulary is open (registries/lifecycle-event-types.md)
Conformant consumers MUST reject deserializing a closed-schema object that contains fields not defined in the schema (schema_violation). Conformant consumers MUST NOT reject deserializing an open-schema object that contains unknown fields. The fixtures pin specific instances of both rules:
  • Open (tolerate): caps-006/schema-004 (capabilities document top level), can-008 (unknown field at the body root), can-010 (unknown field inside a data_refs[] entry).
  • Closed (reject): pub-007/schema-002 (publish response — forbid extras like content_hash), schema-001 (search response — forbid results), schema-003 (DataRef embedded sub-object), schema-008 (signature object), schema-009 (data_period object).
  • (0.5.0) Open (tolerate), formerly closed: schema-010 (capabilities limits sub-object — a 0.5.0 consumer MUST tolerate an unknown limits field; through 0.4.0 it was a schema_violation).

The table above governs every shape across the schema set; the fixtures are representative, not exhaustive.

(0.3.0) Closed does not mean frozen: a closed schema can still gain a field through an additive schema edit in a minor version — the closure means only that fields not in the schema are rejected. The limits sub-object remains Closed (additionalProperties: false) and gains the OPTIONAL max_publish_per_minute field in 0.3.0 (§3.2), exactly as the closed publish response gained registry_receipt in 0.2.0. Validators MUST track the current schema text; a limits object carrying any field beyond max_payload_bytes, max_embedded_bytes, idempotency_key_ttl_seconds, (0.3.0) max_publish_per_minute, (0.5.0) max_reads_per_minute and max_anonymous_reads_per_minute, and the (0.5.0) changes-feed limits defined by RFC-ACDP-0018 §9 (change_retention_seconds, max_change_filters) remains a schema_violation (fixture schema-010). The (0.5.0) additions follow the same additive-edit posture as max_publish_per_minute did in 0.3.0: strict validators of limits that do not track the 0.5.0 schema will reject documents carrying them.

(0.5.0) limits is Open from 0.5.0. The limits sub-object changes from Closed to Open (additionalProperties: true). Known limits fields keep their types, ranges and required-ness, and a known field with an invalid value is still a schema_violation (e.g. caps-005, caps-007, caps-008, schema-014). An unknown limits field MUST be tolerated by a consumer implementing 0.5.0: it MUST NOT reject the document for it, and it MAY ignore the field (fixture schema-010, which flips from reject to tolerate on this line). Why: under closure every new limit was a hard break for every deployed consumer, forcing a coordinated rollout per field even though limits are advisory pacing hints that a consumer can safely ignore. This relaxes a constraint, so no previously valid document becomes invalid. Consumers implementing 0.4.0 or earlier may still reject unknown limits fields, so the staging rule for the fields added on the 0.5.0 line (§3.2, RFC-ACDP-0008 §4.3) stays; limits fields added after this change need no staging for 0.5.0+ consumers. The previous paragraph's closed-limits reject rule therefore describes 0.4.0 and earlier.

3.4 Example

{
  "acdp_version": "0.1.0",
  "registry_did": "did:web:registry.example.com",
  "supported_signature_algorithms": ["ed25519"],
  "supported_did_methods": ["did:web"],
  "read_authentication_methods": ["http_signatures"],
  "anonymous_public_reads": true,
  "supports_idempotency_key": true,
  "profiles": ["acdp-registry-core", "acdp-registry-discovery"],
  "limits": {
    "max_payload_bytes": 1048576,
    "max_embedded_bytes": 65536,
    "idempotency_key_ttl_seconds": 86400
  }
}

3.5 Consumer validation checklist (NORMATIVE)

After fetching /.well-known/acdp.json, consumers and cross-registry resolvers MUST validate the following before relying on the document. Schema validation alone is necessary but not sufficient — the items marked (value) below are not enforceable by the JSON Schema in all toolchains, so implementations MUST verify them in code.

  1. acdp_version matches the semver pattern ^\d+\.\d+\.\d+$.
  2. registry_did is a valid DID. For v0.1.0 registries, registry_did MUST be did:web:<authority>, and <authority> MUST equal the hostname the capabilities document was fetched from. (value, cross-field)
  3. supported_signature_algorithms MUST contain "ed25519".
  4. supported_did_methods MUST contain "did:web".
  5. profiles MUST contain "acdp-registry-core".
  6. limits.max_embedded_bytes MUST equal 65536.
  7. limits.max_payload_bytes MUST be >= 1024.
  8. If supports_idempotency_key is true, limits.idempotency_key_ttl_seconds MUST be present and in the inclusive range 86400..604800 (24h to 7d).
  9. If the registry serves any non-public contexts, read_authentication_methods MUST be non-empty (RFC-ACDP-0008 §6.2). (value, cross-field)
  10. (0.3.0) If acdp_version ≥ 0.3.0, supports_idempotency_key MUST be present and true (RFC-ACDP-0003 §6.4) — and check 8 therefore always applies. A 0.3.0-advertising registry without idempotency support is self-contradictory and NON-CONFORMANT. (value, cross-field) Fixture idem-007.
  11. (0.3.0) If limits.max_publish_per_minute is present, it MUST be an integer ≥ 1 (schema-enforced: zero, negative, or non-integer values are a schema_violation). Fixture caps-007.
  12. (0.5.0) If limits.max_reads_per_minute or limits.max_anonymous_reads_per_minute is present, it MUST be an integer ≥ 1 (schema-enforced, as in check 11). Fixture caps-008.

A consumer encountering a capabilities document that fails any of the checks above MUST NOT proceed with the operation that required fetching capabilities (publish, retrieval, cross-registry resolution). Implementations SHOULD surface the failing check to operators so the registry can be corrected. The conformance fixtures caps-001..007 (schemas/conformance/caps-001-valid-minimal.json through caps-007-max-publish-per-minute.json) plus (0.3.0) idem-007 and (0.5.0) caps-008 pin representative positive and negative payloads for the checklist.

3.5.1 Implementer note: validate capabilities at server construction time

The conditional and cross-field constraints above (registry_did must bind to the serving authority; limits.max_embedded_bytes is fixed at 65536; limits.idempotency_key_ttl_seconds is REQUIRED when supports_idempotency_key = true and is bounded to [86400, 604800]) are enforceable in code but not by JSON Schema in all toolchains. Registry implementers SHOULD validate the capabilities document they intend to serve at server construction time, not at runtime per request. A server that runs the §3.5 checklist once at startup cannot silently start serving with misconfigured limits, a mismatched registry_did, or a missing idempotency TTL. Recommended pattern (pseudocode, illustrative):

server = RegistryServer.try_new(store, caps, authority)
  # raises a typed configuration error at startup if any of the following hold:
  # - caps.registry_did != "did:web:" + authority
  # - "ed25519" not in caps.supported_signature_algorithms
  # - "did:web" not in caps.supported_did_methods
  # - "acdp-registry-core" not in caps.profiles
  # - caps.limits.max_embedded_bytes != 65536
  # - caps.limits.max_payload_bytes < 1024
  # - caps.supports_idempotency_key == true AND
  #     (caps.limits.idempotency_key_ttl_seconds is None
  #      or not 86400 <= caps.limits.idempotency_key_ttl_seconds <= 604800)
  # - caps.acdp_version >= 0.3.0 AND caps.supports_idempotency_key != true   (0.3.0)
  # - caps.limits.max_publish_per_minute is not None
  #     AND caps.limits.max_publish_per_minute < 1                           (0.3.0)
  # - caps.limits.max_reads_per_minute or max_anonymous_reads_per_minute
  #     is present AND < 1                                                   (0.5.0)
  # - caps serves any non-public visibility AND caps.read_authentication_methods is empty

Concrete idioms:

  • Rust: a RegistryServer::try_new(store, caps, authority) -> Result<Self, ConfigError> constructor that enumerates the checks above and returns a typed error per failure. Library APIs SHOULD prefer this over an infallible RegistryServer::new followed by per-request validation.
  • Python: raise ValueError (or a typed RegistryConfigError) from the registry application factory before binding the listening socket.
  • Go: return a non-nil error from the NewRegistryServer constructor; callers log.Fatal rather than starting http.ListenAndServe.
  • TypeScript: throw from the constructor or factory function before the framework starts listening.

The principle is uniform across languages: a misconfigured registry MUST refuse to start. Per-request validation is a defense-in-depth fallback for configuration that mutates at runtime (rare) and for capabilities documents fetched from external sources (consumer-side §3.5).

3.6 Caching

The capabilities document is moderately stable. Registries SHOULD set:

Cache-Control: public, max-age=3600

Consumers MUST refresh the capabilities document at least daily, and MUST refresh on receipt of any error code that suggests version drift (e.g. unsupported_algorithm for an algorithm the consumer believed was supported).


4. Error Envelope

All error responses use the following structure, conforming to schemas/json/acdp-error.schema.json:

{
  "error": {
    "code": "...",
    "message": "Human-readable description",
    "details": {}
  }
}
FieldTypeRequiredDescription
error.codestringYesA machine-readable error code from §5.
error.messagestringYesHuman-readable description, suitable for logs. MUST NOT be used for automated decisions.
error.detailsobjectNoOptional structured details. Shape is error-code-specific.

Content-Type MUST be application/acdp+json. The HTTP status code is per the table in §5. The error envelope MUST be returned for every failure response from an ACDP endpoint, including 4xx, 5xx, 415 Unsupported Media Type (0.5.0), 501 Not Implemented, and 502 Bad Gateway responses. Registries MUST NOT return empty bodies, framework default error pages, or non-application/acdp+json content types on ACDP endpoints. The corresponding fixture is err-001-internal-error.json (illustrating a 500 envelope).

4.1 Request media type (0.5.0) (NORMATIVE)

The rules above govern the media type a registry emits. This section governs the one it accepts, which had no normative statement before 0.5.0.

On a body-bearing request (POST, and any future method carrying a request body), a registry:

  • MUST accept application/acdp+json — the canonical type registered in registries/media-types.md (RFC-ACDP-0001 §5.1).
  • MAY accept application/json, and MAY accept any other media type it chooses. RFC-ACDP-0001 §5.1 permits the former explicitly, and registries/media-types.md RECOMMENDS it as a legacy-client fallback; neither permission is narrowed here. A registry's accept-set is its own choice beyond the one mandatory member.
  • MUST ignore media-type parameters when deciding acceptance. application/acdp+json; charset=utf-8 is the same media type as application/acdp+json for this comparison — RFC-ACDP-0001 §5.1 already fixes the encoding as UTF-8, so a charset parameter is redundant rather than distinguishing. Comparison is case-insensitive on the type and subtype, per RFC 9110 §8.3.1.
  • MUST, if and only if it advertises acdp_version ≥ 0.5.0, reject a request whose Content-Type is outside its accept-set with unsupported_media_type (HTTP 415) and the standard error envelope. The body MUST NOT be parsed first: the point of the code is that no structural claim about the body is being made.
  • MAY choose either behavior when Content-Type is absent on a body-bearing request — reject with unsupported_media_type, or infer application/acdp+json and proceed. Registries SHOULD document which they do. A missing header is a client defect either way, and mandating one reading would break deployed clients for no security gain.

Which of the above binds which version (NORMATIVE). Only the fourth bullet — the MUST to answer unsupported_media_type — is new behavior, and it is gated at acdp_version ≥ 0.5.0 because it adds a rejection, which a clarification to a Final line may never do.

The first three bullets bind every version, because none of them adds a rejection and none of them is new:

  • "MUST accept application/acdp+json" restates registries/media-types.md, which has said since v0.1.0 that "All ACDP endpoints accept and emit this type", and RFC-ACDP-0001 §5.1.
  • "MAY accept application/json and anything further" restates RFC-ACDP-0001 §5.1's existing MAY verbatim in effect; it grants latitude and withdraws none.
  • "MUST ignore media-type parameters" forbids a rejection rather than adding one, and makes coherent a permission registries/media-types.md already grants — implementations MAY send ; charset=utf-8, which is only meaningful if recipients tolerate it. A registry that rejects application/acdp+json; charset=utf-8 was never conformant with that permission; this states plainly what was already implied.

The fifth bullet's latitude (an absent Content-Type is the registry's choice) likewise binds every version; only the specific code named in its reject arm is 0.5.0-gated, since no earlier version may emit it.

This check precedes every step of the RFC-ACDP-0003 §2.1 publish pipeline, including its step 1 schema validation — see that section's pre-step.

GET and other body-less methods are out of scope: with no request body there is no request media type to reject. Content negotiation on responses is governed by the Accept header (registries/media-types.md), which is unchanged.

Method-level rejection (405) is deliberately out of scope and no code is minted for it. ACDP maintains a media-types registry, requests IANA registration for its type (RFC-ACDP-0001 §11.2), and carries normative acceptance prose — so the media type is protocol surface a registry governs, and 415 is adjudicable against the spec. ACDP registers no method vocabulary and states nothing about method routing, so a 405 is a framework concern with no ACDP-level rule to violate. A 405 is therefore not "a failure response from an ACDP endpoint" in the sense of §4: the request never reached an ACDP operation, so §4's envelope requirement does not attach and no error.code is owed. Implementations MAY answer 405 however their framework does. They MUST NOT invent an ACDP code for it, and MUST NOT reuse internal_error (which is reserved for genuine internal faults and is in consumers' retryable set). An implementation that prefers envelope-shaped 405s for consistency is free to do so, but that is a local choice outside this specification, not a conformance requirement — §4's error.code is REQUIRED and drawn from the closed §5 enum, so there is deliberately no conformant ACDP code to place in such a body.


5. Error Code Registry

The full registry is maintained in registries/error-codes.md. The codes defined by v0.1.0:

CodeHTTPMeaningSource
invalid_signature400Signature verification failed.RFC-ACDP-0001 §5.8, RFC-ACDP-0003 §2.1
hash_mismatch400The body's content_hash (over ProducerContent) does not match the canonicalized body.RFC-ACDP-0001 §5.7, RFC-ACDP-0003 §2.1
data_ref_hash_mismatch400A DataRef's bytes do not match the producer-declared hash. Two distinct, independent fields can trigger this, and a DataRef MAY carry both. Returned by a registry at publish time when embedded.content_hash — the optional member inside the closed embedded sub-object (RFC-ACDP-0002 §6.3) — does not match the decoded embedded.content (RFC-ACDP-0002 §6.6 Check 8; fixture data-ref-007). Also the code a consumer SHOULD surface when it fetches an external data_ref.location and the retrieved bytes do not match the DataRef-root content_hash (RFC-ACDP-0002 §6.1, §6.5; fixture data-ref-008). The body's own content_hash and signature are still valid — the integrity failure is at the data-reference level, not the body level.RFC-ACDP-0002 §6.5, §6.6
schema_violation400Request body or query failed structural validation.RFC-ACDP-0003 §2.1
not_authorized403Agent lacks permission for the operation. Returned for supersession by a different agent_id, for unauthenticated reads on a registry that does not advertise anonymous_public_reads, and (0.5.0) for a read presenting an invalid or revoked bearer_static token.RFC-ACDP-0003 §3.1, RFC-ACDP-0008 §6.3, RFC-ACDP-0008 §6.2
not_found404Resource not found. (Also returned for visibility-restricted contexts to non-audience requesters; see RFC-ACDP-0008 §4.5.)RFC-ACDP-0004 §7
superseded_target400 / 409The supersedes target is invalid. details.reason provides specifics. HTTP 400 for static violations (not_found, lineage_mismatch, cross_registry_supersession_unsupported, lineage_walk_failed); HTTP 409 Conflict for race conditions (already_superseded, version_mismatch).RFC-ACDP-0001 §5.6.1, RFC-ACDP-0003 §2.1 steps 9–10, §3.1
unsupported_algorithm400Signature algorithm not in the registry's supported_signature_algorithms.RFC-ACDP-0001 §5.10, RFC-ACDP-0003 §2.1 step 5
rate_limited429Rate limit exceeded: per-agent on publish; (0.5.0) per authenticated principal or per source address on reads.RFC-ACDP-0008 §4.3
payload_too_large413Request body exceeds limits.max_payload_bytes.RFC-ACDP-0003 §2.1 step 2
embedded_too_large413An embedded data reference exceeds 64 KB.RFC-ACDP-0002 §6.3, RFC-ACDP-0003 §2.1 step 3
key_resolution_failed400The signing key referenced by signature.key_id could not be resolved due to a permanent condition: the DID document parsed successfully but does not contain the requested key fragment; the fragment is missing from key_id; or the producer DID resolves to a network target forbidden by SSRF policy (RFC-ACDP-0008 §4.8). For did:key, resolution is pure (RFC-ACDP-0001 §5.11.1) and the same code covers its step 1-4 failures: a signature.key_id fragment that does not byte-equal the method-specific identifier, a method-specific identifier that is not valid base58-btc under the z multibase prefix, a multicodec prefix that is neither 0xed01 nor 0x8024, or a key-byte length that does not match the curve — none of which involves a DID document or a network fetch. Fixtures dk-001, dk-002, dk-004; dk-002 (cases 1-2 only) and dk-004 tolerate schema_violation from a registry whose stricter grammar rejects the encoding; dk-001 does not, because its fault is the key material (an unsupported curve), whose remedy is to re-key rather than to fix the request — and neither does dk-002 case 3 (z6Mk), which decodes cleanly and is likewise a step-3 rejection. Producer error; not retryable.RFC-ACDP-0003 §2.1 step 6, RFC-ACDP-0008 §4.8
key_resolution_unreachable502The signing key could not be resolved due to a transient condition (DNS failure, TLS error, HTTP non-2xx, network timeout fetching the DID document). Retryable with backoff.RFC-ACDP-0003 §2.1 step 6
key_not_authorized403The DID portion of signature.key_id does not equal body.agent_id, or the resolved verification method is not in the DID document's assertionMethod array.RFC-ACDP-0003 §2.1 step 6
not_implemented501Endpoint or capability not implemented by this registry. Returned with the standard error envelope. Emitted when the requested endpoint requires a profile this registry does not advertise (e.g., GET /contexts/search on a registry that does not declare acdp-registry-discovery in profiles). All acdp-registry-core endpoints are mandatory and MUST NOT return not_implemented.RFC-ACDP-0001 §9.1, RFC-ACDP-0007 §4
cursor_expired400A previously-issued pagination cursor is no longer valid. Client SHOULD restart pagination.RFC-ACDP-0005 §2.5.4
invalid_cursor400A pagination cursor is malformed or unrecognized.RFC-ACDP-0005 §2.5.4
duplicate_publish409An idempotent publish was retried with conflicting content (same Idempotency-Key, different content_hash).RFC-ACDP-0003 §6.2
cross_registry_resolution_failed502A cross-registry resolution failed (DNS resolution refused, response oversize, timeout, redirect-policy violation, or upstream registry unavailable).RFC-ACDP-0006 §7
invalid_receipt (0.2.0)502A registry receipt failed the RFC-ACDP-0010 §8 verification procedure (signature, registry/authority binding, context binding, content binding, key binding, or timestamp form). Emitted on the wire by a federated resolver (or any registry validating an upstream receipt on a caller's behalf) about a receipt obtained from an upstream registry — hence 502, the upstream is at fault. It is also the verification-failure category consumer SDKs MUST use in their own diagnostics when a locally verified receipt fails; in that consumer-side use it does not invalidate the body, whose producer signature is judged independently (RFC-ACDP-0010 §8). There is deliberately no receipt_unavailable: registries advertising acdp-registry-receipts MUST always mint (RFC-ACDP-0010 §7), so a missing receipt from such a registry is a registry fault, not an error category.RFC-ACDP-0010 §8, §11
immutable_field (0.3.0)400A lifecycle (or any future mutation) endpoint request attempted to supply or alter immutable body content — e.g. a body member or a body-field-named member on POST /contexts/{ctx_id}/retract. Bodies are immutable; lifecycle endpoints mutate registry state only. Activated by RFC-ACDP-0013 §6 from the reservation held since v0.1.0 (RFC-ACDP-0009 §2.1); distinct from schema_violation so producers learn the category error. Not retryable.RFC-ACDP-0013 §6, §10
invalid_lifecycle_transition (0.3.0)409The requested lifecycle transition conflicts with the context's current retraction state (retract of an already-retracted context; republish of a never-retracted one). A state conflict, like the 409 arm of superseded_target; retryable only after the state changes.RFC-ACDP-0013 §6 step 4, §10
invalid_log_proof (0.3.0)502A transparency-log artifact failed the RFC-ACDP-0012 §9 verification procedures: an inclusion proof whose folded audit path does not reproduce the checkpoint's root_hash, a consistency proof that fails between two tree sizes of the same log_id, or a checkpoint whose signature does not verify over the recomputed preimage. Deliberately not invalid_receipt: a proof failure indicts the log, not the receipt, and the verdicts are independent (RFC-ACDP-0012 §9.3). Emitted on the wire by a federated resolver (or any registry validating an upstream's proofs on a caller's behalf) — hence 502, the upstream is at fault; also the verification-failure category consumer SDKs use for locally failing proofs. Malformed proof requests are schema_violation; an unlogged or invisible ctx_id on GET /log/proof is not_found; there is deliberately no log_unavailable (RFC-ACDP-0012 §7).RFC-ACDP-0012 §9, §11
invalid_witness_cosignature (0.4.0)502A transparency-log witness cosignature failed the RFC-ACDP-0015 §8 verification procedure: a closed-schema parse failure, a witness-key signature that does not verify over the recomputed cosignature preimage, a signature.key_id whose DID portion ≠ witness_id, a witnessed_checkpoint tuple that does not match the checkpoint being evaluated, or a future-dated witnessed_at beyond the skew allowance. Deliberately not invalid_log_proof: a cosignature failure indicts a witness's attestation (an independent signer), not the registry's log, and the verdicts are independent (RFC-ACDP-0015 §8, RFC-ACDP-0012 §9.3). Emitted on the wire by a registry aggregating cosignatures, or a resolver validating a witness's cosignatures on a caller's behalf — hence 502, the upstream party is at fault; also the verification-failure category consumer SDKs use for a locally failing cosignature. A merely stale (but valid) cosignature is consumer freshness policy, not this code; an un-witnessed (0-witnessed) checkpoint is not an error.RFC-ACDP-0015 §8, §10
unsupported_media_type (0.5.0)415The request Content-Type on a body-bearing method is a media type this registry does not accept (see §4.1). The request body was not parsed, so no structural claim about it is made — this is deliberately not schema_violation, which asserts a validation that did not run and is pinned to 400. The client's remedy is to resend the identical request under an accepted media type.RFC-ACDP-0001 §5.1, RFC-ACDP-0007 §4.1
internal_error500The registry encountered an unexpected internal condition. The standard error envelope MUST be used; error.message MUST NOT leak stack traces or sensitive context. Retryable.RFC-ACDP-0007 §4

Reserved codes (not in this table or the v0.1.0 wire enum): unsupported_embedding_model is reserved for a future version's similarity endpoints (see RFC-ACDP-0009 §2.9). Implementations MUST NOT emit it. (0.2.0) invalid_receipt graduated from reserved space into the table above and the wire enum; implementations declaring acdp_version 0.1.0 MUST NOT emit it. (0.3.0) immutable_field — reserved for "a future version's mutation endpoints" since v0.1.0 — is activated by RFC-ACDP-0013 and likewise graduates, together with the new invalid_lifecycle_transition; and invalid_log_proof is added via the §5.1 process by RFC-ACDP-0012 (it was never in reserved space — RFC-ACDP-0009 §2.11 reserved field/endpoint/profile names only). Implementations declaring acdp_version < 0.3.0 MUST NOT emit any of the three. (0.4.0) invalid_witness_cosignature is added via the §5.1 process by RFC-ACDP-0015 (it was never in reserved space — RFC-ACDP-0009 §2.12 reserved field/endpoint/profile names only). Implementations declaring acdp_version < 0.4.0 MUST NOT emit it. (0.5.0) unsupported_media_type is added via the §5.1 process for the request-media-type rule of §4.1; it was never in reserved space. Implementations declaring acdp_version < 0.5.0 MUST NOT emit it — such a registry has no specified behavior for an unaccepted request media type and SHOULD continue to do whatever it does today. Distinguishing hash failures. Three failure codes can arise from integrity checks; implementations MUST keep them distinct so consumers can react correctly:

  • hash_mismatch — the body's ProducerContent hash, recomputed by the registry or consumer, does not match body.content_hash. The body's signed content cannot be verified; the body is untrusted.
  • data_ref_hash_mismatch — a DataRef's bytes do not match the producer-declared hash: fetched (external) bytes against the DataRef-root content_hash (RFC-ACDP-0002 §6.1), or decoded (embedded) bytes against embedded.content_hash (RFC-ACDP-0002 §6.3). These are two independent fields and a DataRef MAY carry both. The body itself is cryptographically valid; only the referenced data has diverged from what the producer signed. Returning hash_mismatch here would wrongly imply the whole body failed verification; returning invalid_signature would wrongly imply a signature-verification failure.
  • invalid_signature — signature.value does not verify against the resolved public key. The body's authorship cannot be established.

A registry emits data_ref_hash_mismatch only at publish time, for embedded data (embedded.content_hash mismatch — RFC-ACDP-0002 §6.6 Check 8). For external data_refs[].location, hash verification happens consumer-side after fetch (RFC-ACDP-0002 §6.5); a consumer SHOULD surface the mismatch with the same data_ref_hash_mismatch semantic in its own diagnostics, logs, or API surface.

5.1 Adding a code

New codes are added via the RFC process. Codes MUST be lowercase snake_case. Codes MUST NOT collide with existing entries.

5.2 Information leakage

Registries MUST NOT reveal which specific policy check failed beyond the registered code. The error.message string is informational only and MUST NOT be used in automated decision-making by consumers.

For visibility-restricted contexts, registries MUST return not_found (HTTP 404) — they MUST NOT distinguish "not found" from "not authorized" externally. The internal label visibility_denied MAY be used in registry logs or metrics for auditing purposes but MUST NOT appear in wire responses.

5.3 SDK guidance — data_ref_hash_mismatch vs body hash mismatch

The error-code table and the "Distinguishing hash failures" note above are normative for the wire. This section is implementation guidance for SDK authors who expose a verification API to application code.

SDKs exposing verification APIs MUST distinguish data_ref_hash_mismatch from body-level hash and signature failures:

  • Report data_ref_hash_mismatch when a DataRef's bytes do not match the producer-declared hash. Two distinct, independent fields can trigger this, and a DataRef MAY carry both: bytes fetched from an external data_ref.location are checked against the DataRef-root content_hash (RFC-ACDP-0002 §6.1, §6.5 — consumer-side, at fetch time), while bytes decoded from data_ref.embedded are checked against embedded.content_hash, the optional member inside the closed embedded sub-object (RFC-ACDP-0002 §6.3, §6.6 Check 8 — registry-side, at publish time). The root field is not restricted to location-form data — §6.1's generic wording covers embedded data too — but only embedded.content_hash is what §6.6 Check 8 makes a registry verify at publish.
  • An SDK MUST NOT report this case as invalid_signature. invalid_signature implies the producer's key or signature failed; here the signature is intact.
  • An SDK MUST NOT collapse this case into hash_mismatch. hash_mismatch implies the entire body's ProducerContent hash failed and the body is unverifiable; here the body is fully verifiable.

A data_ref_hash_mismatch indicates the body remains cryptographically valid: the producer signed the hash of the data they intended to reference, but the data at that location has since changed (external case) or was mis-encoded (embedded case). It is an integrity failure at the data layer, not the body layer. A verification result object SHOULD therefore carry the body-level verdict and the data-ref-level verdict as separate fields, so an application can decide — for example — to trust the body's metadata and derived_from lineage while treating one stale DataRef as unusable.

The data-ref-007 fixture pins the embedded case (registry-side, publish time). The data-ref-008 fixture pins the external case (consumer-side, fetch time): the body signature MUST still verify, and the SDK SHOULD surface data_ref_hash_mismatch, not invalid_signature.


6. Security Considerations

See RFC-ACDP-0008 Security. Specific to capabilities and errors:

  • The capabilities document MUST be served over TLS.
  • Registries SHOULD include the same registry_did value across all responses to avoid identity confusion.
  • Error messages MUST NOT echo unsanitized request content (defends against XSS in registry-served clients and injection into log pipelines).
  • Rate-limit responses (rate_limited) MUST include a Retry-After header (integer seconds or HTTP-date); a limiter without an exact refill horizon emits a conservative estimate rather than omitting the header (RFC-ACDP-0008 §4.3).

7. References