Skip to content

AAE ↔ APS Constraint Mapping Test Case #9

@MoltyCel

Description

@MoltyCel

Following up from #7 where @aeoess requested this.

Context

MolTrust AAE (Agent Authorization Envelope) is a signed, on-chain anchored credential with three blocks:

  • MANDATE — delegation scope (allowed actions + domains)
  • CONSTRAINTS — spend limits, reversibility, reputation minimum
  • VALIDITY — time window (not_before / not_after)

Canonicalization: JCS RFC 8785 before Ed25519 signing. Same as APS gateway.

Proposed Test Case

An AAE MANDATE with scope: ["commerce", "data_read"] should produce the same constraint evaluation result as an APS delegation with scope: ["commerce", "data_read"].

Input (AAE side)

{
  "subject": "did:moltrust:agent-test-001",
  "issuer": "did:moltrust:issuer-root",
  "mandate": {
    "scope": ["commerce", "data_read"],
    "domains": ["web", "api"]
  },
  "constraints": {
    "spend_limit_usdc": 100,
    "reversibility": "required",
    "reputation_minimum": 70
  },
  "validity": {
    "not_before": "2026-04-01T00:00:00Z",
    "not_after": "2026-04-30T23:59:59Z"
  }
}

Expected Output

Same SHA-256 constraint evaluation digest as APS delegation with equivalent scope — following the cross-test template from haroldmalikfrimpong-ops' 4/4 → 7/7 run.

Dimension Mapping

AAE Field qntm Facet Notes
mandate.scope scope Direct match
constraints.spend_limit_usdc spend USDC denomination
validity.not_after time ISO 8601
constraints.reputation_minimum reputation 0-100 scale
constraints.reversibility reversibility boolean/enum

5/5 facets structurally equivalent.

Additional Test Vectors

We've prepared 5 test vectors covering:

  • TV-001: Valid delegation (baseline)
  • TV-002: Scope escalation attempt (INVALID)
  • TV-003: Validity window extension attempt (INVALID)
  • TV-004: Self-modification / self-issuance (INVALID)
  • TV-005: Expired credentials / ghost agent (INVALID)

Happy to contribute these as a PR to qntm/specs/test-vectors/ once we align on format.

Note on persistent_passport

One observation from daemon agent deployments (VCOne, did:moltrust:vcone): APS passports are session-scoped, but long-running daemon agents that survive container restarts need identity persistence across sessions. Worth discussing whether a persistent_passport mode alongside the current session model makes sense — AAE's VALIDITY block is designed exactly for this use case (credential valid across sessions until expiry).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions