@agenticprimitives/delegation 1.0.0-alpha.42 → 1.0.0-alpha.44
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/package.json +6 -6
package/README.md
CHANGED
|
@@ -61,3 +61,58 @@ The closest neighbors are MetaMask's Delegation Toolkit and the session-key feat
|
|
|
61
61
|
## Status
|
|
62
62
|
|
|
63
63
|
**Alpha track — testnet-only.** Spec + API stable; do not deploy to production until the gates listed in the root [`README.md` Status section](../../README.md#status) are cleared — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).
|
|
64
|
+
|
|
65
|
+
## Delegated presentation
|
|
66
|
+
|
|
67
|
+
A person's credential is presented by her agent, never held by it. She signs one standing `credential.present` wire
|
|
68
|
+
(`PRESENTATION_CAPABILITY`) naming the audiences, predicate programs and issuer facets it covers;
|
|
69
|
+
`createPresentationRelease` derives the child mandate for one statement and judges it inside the device key's signing
|
|
70
|
+
callback — a statement for another venue signs nothing. `createEs256EvidenceMinter` and `boundEvidenceFrom` turn that
|
|
71
|
+
judgement into the bound evidence the key service requires before a P-256 device key signs: the judge attests what it
|
|
72
|
+
judged. The same minter serves an issuing runtime, whose issuance evidence names the digest, the facet and the type.
|
|
73
|
+
|
|
74
|
+
## Reference
|
|
75
|
+
|
|
76
|
+
**Exports.** Caveats: `ROOT_AUTHORITY`, `buildCaveat`, `buildMcpToolScopeCaveat`, `buildDataScopeCaveat`,
|
|
77
|
+
`buildVaultKeyUseCaveat` + `decodeVaultKeyUseTerms` + `VAULT_KEY_USE_ENFORCER` (spec 278), `buildVaultRecordScopeCaveat` +
|
|
78
|
+
`vaultRecordScopeAllows` + `decodeVaultRecordScopeTerms` + `VAULT_RECORD_SCOPE_ENFORCER` (spec 317, the one canonical
|
|
79
|
+
record/op matcher), `buildDelegateBindingCaveat`, `buildQuorumCaveat`, `encodeTimestampTerms`, `encodeValueTerms`,
|
|
80
|
+
`encodeAllowedTargetsTerms`, `encodeAllowedMethodsTerms`, `encodeCallDataHashTerms`. Hashing: `hashDelegation`,
|
|
81
|
+
`hashCaveats`, `evaluateCaveats`. Browser: `DelegationClient`. Sessions: `SessionManager`, `SessionStore`. Token:
|
|
82
|
+
`mintDelegationToken`, `verifyDelegationToken` (with `requireQuorumForTier`). On chain: `isRevoked`, `revokeDelegation`.
|
|
83
|
+
Method authorization: `authorizeMethodDelegation`, `methodSelector`. Mandates: `intentDigest`, `deriveMandate`,
|
|
84
|
+
`readMandate`, `verifyMandateForStep`, `registerSubsetHandler`, `registerDefaultSubsetHandlers`,
|
|
85
|
+
`buildDigestBindingCaveat`, `readDigestBindings`. Presentation: `PRESENTATION_RAR_TYPE`, `presentationHandler`,
|
|
86
|
+
`buildStandingWire`, `deriveFromStanding`, `presentationIntent`, `createPresentationRelease`,
|
|
87
|
+
`parseAudienceBoundChallenge`, `createEs256EvidenceMinter`, `boundEvidenceFrom`. Types: `Delegation`, `Caveat`,
|
|
88
|
+
`DataScopeGrant`, `VaultRecordScopeGrant`, `DelegationTokenClaims`, `EnforcerAddressMap`, `JtiStore`, `CaveatContext`,
|
|
89
|
+
`VerifyOpts`, `VerifyError`, `SessionRow`, `SessionPackage`, `SessionMeta`.
|
|
90
|
+
|
|
91
|
+
**Mandates (spec 350 §2, spec 336 E4).** A mandate is a delegation with a reason: a `DigestBindingEnforcer` caveat binding it
|
|
92
|
+
to an intent digest (JCS, then keccak). `MandateRequirementV1` is RAR-shaped; subset handlers are registered per `type`
|
|
93
|
+
(RFC 9396 defines no universal "narrower than"); `deriveMandate` makes a chain (the child's `authority` is the parent's
|
|
94
|
+
hash); `verifyMandateForStep` is the per-step check, never once at admission. `src/mandate-handlers.ts` ships the
|
|
95
|
+
capability and payment handlers.
|
|
96
|
+
|
|
97
|
+
**Delegated presentation (spec 305 W2, zkID Z2).** `credential.present` bounds which verifiers, which predicate programs (by
|
|
98
|
+
digest) and which issuer facets a delegate key may cause the person's P-256 device key to sign a `Show` challenge for, through
|
|
99
|
+
the `PRESENTATION_SCOPE_ENFORCER` sentinel judged off chain. `deriveFromStanding` gives the child for one statement;
|
|
100
|
+
`createPresentationRelease` is the only road to the device signature: it runs `verifyMandateForStep` per signature, requires
|
|
101
|
+
the challenge (`<scheme>:<audience>:<nonce>`) to be bound to the audience the mandate covers, and with an `evidence` port
|
|
102
|
+
attests what it judged (digest · venue · predicate program · actor) as the key's sign context. Issuance evidence (spec 444)
|
|
103
|
+
is minted by the issuing runtime's own key with the same minter. The port of smart-agent's `SessionGrantV1` +
|
|
104
|
+
`WalletAction` + `evaluateProofPolicy`, with the delegate moved to a custodied key.
|
|
105
|
+
|
|
106
|
+
**Method authorization.** `authorizeMethodDelegation` + `methodSelector` answer "may this delegate perform METHOD for
|
|
107
|
+
TARGET?" without an A2A message (publishing for another agent, issuing discovery grants). `a2a`'s `skillSelector` is
|
|
108
|
+
`methodSelector` plus the any-skill sentinel.
|
|
109
|
+
|
|
110
|
+
**Common tasks.** A new caveat type: builder and encoder in `src/caveats.ts`, dispatch in `src/evaluator.ts`, export in
|
|
111
|
+
`src/index.ts`, a golden test. A token envelope change: `src/token.ts`, coordinated with `mcp-runtime`. A session lifecycle
|
|
112
|
+
method: `src/sessions.ts` with an integration test.
|
|
113
|
+
|
|
114
|
+
**Cross-cutting.** Audit events: `delegation.mint`, `delegation.verify.accept`, `delegation.verify.reject` (spec 206). DTK
|
|
115
|
+
interop: the off-chain `Caveat` + `EnforcerAddressMap` mirror the on-chain registry; the signed caveat hash matches
|
|
116
|
+
`DelegationManager` CAVEAT_TYPEHASH (enforcer + terms, no args) — [spec 208](../../specs/208-argument-level-caveats.md).
|
|
117
|
+
Relying sites (spec 229, [ADR-0019](../../docs/architecture/decisions/0019-relying-site-authority-is-a-scoped-delegation.md),
|
|
118
|
+
`docs/relying-site-delegation.md`): a relying site is a scoped delegate of the person, never a custodian.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/delegation",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.44",
|
|
4
4
|
"description": "EIP-712 smart-account delegations with caveats; web→agent→MCP token flow; session lifecycle.",
|
|
5
5
|
"homepage": "https://agenticprimitives.dev",
|
|
6
6
|
"bugs": {
|
|
@@ -40,11 +40,11 @@
|
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"viem": "^2.52.2",
|
|
43
|
-
"@agenticprimitives/agent-account": "^1.0.0-alpha.
|
|
44
|
-
"@agenticprimitives/audit": "^1.0.0-alpha.
|
|
45
|
-
"@agenticprimitives/connect-auth": "^1.0.0-alpha.
|
|
46
|
-
"@agenticprimitives/key-custody": "^1.0.0-alpha.
|
|
47
|
-
"@agenticprimitives/types": "^1.0.0-alpha.
|
|
43
|
+
"@agenticprimitives/agent-account": "^1.0.0-alpha.44",
|
|
44
|
+
"@agenticprimitives/audit": "^1.0.0-alpha.44",
|
|
45
|
+
"@agenticprimitives/connect-auth": "^1.0.0-alpha.44",
|
|
46
|
+
"@agenticprimitives/key-custody": "^1.0.0-alpha.44",
|
|
47
|
+
"@agenticprimitives/types": "^1.0.0-alpha.44"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"vitest": "^4.1.11"
|