The delegation depth cap lives only in the Card profile. MAX_DELEGATION_DEPTH = 10 is declared at src/card/delegation.ts:34 and applied in validateDelegationChain at :287 (const maxDepth = ctx.maxDepth ?? MAX_DELEGATION_DEPTH), with the rejection at :294. The override is deliberate API, documented at :220 as "override the fail-closed depth cap (default MAX_DELEGATION_DEPTH)" — this is not about the override.
The base delegation path has no equivalent. src/middleware contains no depth or chain.length check outside tests, so a base-profile chain is bounded only by whatever the caller does. Chain verification cost grows with length, which makes an unbounded base path a verification-cost DoS surface that the Card path does not have.
The second half of the same gap: a verifier receiving a delegation cannot tell which profile governs its interpretation. The base credential profile and the Entity Card profile (VC 2.0 + ZCAP-LD) carry different rules — depth being one of them — and there is no profile identifier in the credential to select between them.
This is a design question rather than a fix, so it seems worth settling here before any PR:
- a normative depth cap in the base path, or explicit verifier-discretion language saying the bound is the verifier's to set;
- an explicit profile identifier (or a registry) so a verifier can determine which rule set applies.
Related: decentralized-identity/trusted-ai-agents#37 (scoped delegation chains, authority narrowing across multi-hop workflows).
Reported by @IzuruToys in decentralized-identity/trusted-ai-agents#42: decentralized-identity/trusted-ai-agents#42 (comment)
The delegation depth cap lives only in the Card profile.
MAX_DELEGATION_DEPTH = 10is declared atsrc/card/delegation.ts:34and applied invalidateDelegationChainat:287(const maxDepth = ctx.maxDepth ?? MAX_DELEGATION_DEPTH), with the rejection at:294. The override is deliberate API, documented at:220as "override the fail-closed depth cap (default MAX_DELEGATION_DEPTH)" — this is not about the override.The base delegation path has no equivalent.
src/middlewarecontains nodepthorchain.lengthcheck outside tests, so a base-profile chain is bounded only by whatever the caller does. Chain verification cost grows with length, which makes an unbounded base path a verification-cost DoS surface that the Card path does not have.The second half of the same gap: a verifier receiving a delegation cannot tell which profile governs its interpretation. The base credential profile and the Entity Card profile (VC 2.0 + ZCAP-LD) carry different rules — depth being one of them — and there is no profile identifier in the credential to select between them.
This is a design question rather than a fix, so it seems worth settling here before any PR:
Related: decentralized-identity/trusted-ai-agents#37 (scoped delegation chains, authority narrowing across multi-hop workflows).
Reported by @IzuruToys in decentralized-identity/trusted-ai-agents#42: decentralized-identity/trusted-ai-agents#42 (comment)