@agenticprimitives/key-custody 1.0.0-alpha.6 → 1.0.0-alpha.8
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 +22 -5
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
# @agenticprimitives/key-custody
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
**Custody is not authority.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
In this stack, keys sign — they do not decide. Authority lives in delegations and custody policy; this package is the cryptographic floor underneath them: pluggable envelope encryption, KMS-backed signers, and HMAC providers behind one `A2AKeyProvider` interface. Local-AES and a local secp256k1 signer for development, AWS KMS and GCP KMS for real deployments. Because a signer here is just a signer, a compromised session key is a revocation event, not an identity loss — the Smart Agent address and its custody policy sit above the key, not inside it.
|
|
6
|
+
|
|
7
|
+
**Narrower than you might expect, on purpose:** session lifecycle is owned by `@agenticprimitives/delegation`. This package provides the crypto primitives; delegation's `SessionManager` wires them ([ADR-0002](../../docs/architecture/decisions/0002-session-lifecycle-in-delegation.md)). Payloads are opaque bytes with caller-supplied AAD — bound identically into AES-GCM AAD and KMS EncryptionContext, so tampering trips both.
|
|
8
|
+
|
|
9
|
+
> Part of [agenticprimitives](../../README.md) — the trust substrate for the agent economy: one canonical Smart Agent identity with custody, delegation, naming, credentials, and audit evidence designed as one system.
|
|
6
10
|
|
|
7
11
|
See [`spec.md`](./spec.md) → [`specs/203-key-custody.md`](../../specs/203-key-custody.md).
|
|
8
12
|
|
|
9
13
|
## Quick start
|
|
10
14
|
|
|
11
15
|
```ts
|
|
12
|
-
import { buildKeyProvider, createKmsAccount, canonicalContextBytes } from '@agenticprimitives/key-custody';
|
|
16
|
+
import { buildKeyProvider, buildSignerBackend, createKmsAccount, canonicalContextBytes } from '@agenticprimitives/key-custody';
|
|
13
17
|
|
|
14
18
|
const provider = buildKeyProvider({ backend: process.env.A2A_KMS_BACKEND });
|
|
15
19
|
|
|
@@ -22,10 +26,23 @@ const signer = buildSignerBackend({ backend: 'aws-kms' });
|
|
|
22
26
|
const kmsAccount = await createKmsAccount(signer);
|
|
23
27
|
```
|
|
24
28
|
|
|
29
|
+
Beyond the basics: per-OIDC-subject signer derivation via HKDF (`deriveSubjectSigner`, [spec 235](../../specs/235-google-kms-custody.md)), a relay-only master signer that throws on any signing call (`getRelayOnlySigner`), and HMAC providers under the `/mac` subpath. Every decrypt and signing operation emits an audit row with `keyVersion` and a hashed session ID — the raw session ID is never logged.
|
|
30
|
+
|
|
25
31
|
## Production guard
|
|
26
32
|
|
|
27
|
-
`local-aes` refuses to boot when `NODE_ENV=production`. AWS and GCP backends have **no local fallback** — they fail-closed on outage. This is intentional.
|
|
33
|
+
`local-aes` refuses to boot when `NODE_ENV=production`. AWS and GCP backends have **no local fallback** — they fail-closed on outage. This is intentional: a key-custody layer that silently downgrades to a weaker backend is not a custody layer.
|
|
34
|
+
|
|
35
|
+
## How it's different
|
|
36
|
+
|
|
37
|
+
Turnkey and Fireblocks are strong custody products: managed key infrastructure with their own policy engines, consoles, and trust models. They are also where your authority model ends up living — the policy that governs a key is the vendor's policy, expressed in the vendor's terms. This package takes the opposite position: KMS backends are interchangeable plumbing (`buildKeyProvider({ backend })`), and the authority model lives one layer up, in on-chain custody policy and EIP-712 delegations that the rest of the substrate enforces and audits. You keep cloud-KMS-grade key protection without making a vendor's policy engine your source of truth for who may do what.
|
|
38
|
+
|
|
39
|
+
## Validate
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
pnpm --filter @agenticprimitives/key-custody typecheck
|
|
43
|
+
pnpm --filter @agenticprimitives/key-custody test
|
|
44
|
+
```
|
|
28
45
|
|
|
29
46
|
## Status
|
|
30
47
|
|
|
31
|
-
|
|
48
|
+
Testnet/pilot-ready. Production launch is gated on the public checklist in the root README — including third-party contract audit and governance key rotation. Track every security finding live in [`docs/audits/findings.yaml`](../../docs/audits/findings.yaml).
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agenticprimitives/key-custody",
|
|
3
|
-
"version": "1.0.0-alpha.
|
|
3
|
+
"version": "1.0.0-alpha.8",
|
|
4
4
|
"description": "Pluggable envelope encryption + signers + HMAC providers (local-AES / AWS KMS / GCP KMS). Pure crypto primitives; no session lifecycle (that's in delegation).",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
},
|
|
65
65
|
"peerDependencies": {
|
|
66
66
|
"viem": "^2.52.2",
|
|
67
|
-
"@agenticprimitives/audit": "1.0.0-alpha.
|
|
68
|
-
"@agenticprimitives/connect-auth": "1.0.0-alpha.
|
|
69
|
-
"@agenticprimitives/types": "1.0.0-alpha.
|
|
67
|
+
"@agenticprimitives/audit": "1.0.0-alpha.8",
|
|
68
|
+
"@agenticprimitives/connect-auth": "1.0.0-alpha.8",
|
|
69
|
+
"@agenticprimitives/types": "1.0.0-alpha.8"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"vitest": "^4.1.8"
|
|
@@ -84,7 +84,7 @@
|
|
|
84
84
|
"build": "tsc -p tsconfig.build.json",
|
|
85
85
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
86
86
|
"test": "vitest run",
|
|
87
|
-
"test:unit": "vitest run test/unit",
|
|
87
|
+
"test:unit": "vitest run test/unit --passWithNoTests",
|
|
88
88
|
"test:integration": "vitest run test/integration --passWithNoTests",
|
|
89
89
|
"test:watch": "vitest",
|
|
90
90
|
"clean": "rm -rf dist"
|