@forgezero/agent 0.1.19 → 0.1.20

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 CHANGED
@@ -90,10 +90,11 @@ evidence: report acquisition and AMD-rooted measurement verification still have
90
90
  to cross the production fleet. Until then the node is honestly `enrolled`; the
91
91
  Agent never manufactures an attestation-shaped fallback.
92
92
 
93
- Every tenant Vault sync request uses the same hybrid signature codec as an
94
- external API key and signs its one-use hybrid ML-KEM-768 + X25519 response key.
95
- Vault values are AES-256-GCM sealed to that request before crossing the edge;
96
- there is no Ed25519-only or plaintext-response downgrade.
93
+ Every Agent request uses the same hybrid signature codec as an external API key
94
+ and signs its one-use hybrid ML-KEM-768 + X25519 response key. Vault replication,
95
+ deployment claims, attestation and metal provisioning responses are AES-256-GCM
96
+ sealed to that request before crossing the edge; there is no Ed25519-only or
97
+ successful plaintext-response downgrade.
97
98
 
98
99
  The first guest enrolment uses the same contract before the identity exists in
99
100
  the database: the guest signs the exact token and public-key body with both keys
@@ -135,7 +136,8 @@ code, and only an awaited successful pipeline writes `deployed`. An expired
135
136
  claim can be recovered; its stale token cannot renew or finish.
136
137
 
137
138
  The same package also runs the identity-only Metal Agent. It initiates outbound
138
- signed HTTPS to pull only claims assigned to its enrolled hostname, then passes
139
+ hybrid-signed HTTPS and requires request-bound PQ-sealed responses while pulling
140
+ only claims assigned to its enrolled hostname, then passes
139
141
  the fixed claim over a local Unix socket to a narrowly privileged root helper.
140
142
  The helper can materialize the audited QEMU profile; it cannot clone a project,
141
143
  read Vault data, accept arbitrary commands, or retain tenant credentials. Root
package/dist/fz-agent.js CHANGED
@@ -123,19 +123,19 @@ class SignedNodeHttpError extends Error {
123
123
  this.name = "SignedNodeHttpError";
124
124
  }
125
125
  }
126
- async function postSignedNode(options, path, body, sealedResponse = false) {
126
+ async function postSignedNode(options, path, body) {
127
127
  const url = new URL(options.apiUrl);
128
128
  url.pathname = `${url.pathname.replace(/\/$/, "")}/${path.replace(/^\//, "")}`.replace(/\/+/g, "/");
129
129
  url.search = "";
130
130
  url.hash = "";
131
131
  const raw = JSON.stringify(body);
132
- const recipient = sealedResponse ? generateResponseRecipient() : undefined;
132
+ const recipient = generateResponseRecipient();
133
133
  const envelope = signRequest(options.keys, options.nodeKey, {
134
134
  method: "POST",
135
135
  path: url.pathname,
136
136
  query: "",
137
137
  body: raw,
138
- responseKey: recipient?.publicKey
138
+ responseKey: recipient.publicKey
139
139
  });
140
140
  const signature = encodeSignatureHeader(envelope);
141
141
  const response = await (options.fetch ?? globalThis.fetch)(url, {
@@ -144,7 +144,7 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
144
144
  "content-type": "application/json",
145
145
  "x-fz-node": options.nodeKey,
146
146
  "x-fz-signature": signature,
147
- ...recipient ? { [RESPONSE_KEY_HEADER]: recipient.publicKey } : {}
147
+ [RESPONSE_KEY_HEADER]: recipient.publicKey
148
148
  },
149
149
  body: raw,
150
150
  signal: AbortSignal.timeout(options.requestTimeoutMs ?? 15000)
@@ -155,14 +155,11 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
155
155
  const reason = failure ? failure.error?.message ?? failure.message : undefined;
156
156
  throw new SignedNodeHttpError(response.status, reason || `signed node request returned HTTP ${response.status}`);
157
157
  }
158
- if (recipient) {
159
- try {
160
- return await openResponse(recipient.secretKey, signature, payload);
161
- } catch {
162
- throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
163
- }
158
+ try {
159
+ return await openResponse(recipient.secretKey, signature, payload);
160
+ } catch {
161
+ throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
164
162
  }
165
- return payload;
166
163
  }
167
164
 
168
165
  // src/node-vault.ts
@@ -194,7 +191,7 @@ function tenantNodeApiUrl(apiUrl, tenantSlug) {
194
191
  return url.toString().replace(/\/$/, "");
195
192
  }
196
193
  function createNodeVaultCache(options) {
197
- const post = (operation, body) => postSignedNode(options, `v1/node/vault/${operation}`, body, true);
194
+ const post = (operation, body) => postSignedNode(options, `v1/node/vault/${operation}`, body);
198
195
  return createSecretCache({
199
196
  ttlMs: options.ttlMs,
200
197
  maxStaleMs: options.maxStaleMs,
@@ -1216,7 +1213,7 @@ async function enrolGuestIdentity(options) {
1216
1213
  ed25519: options.keys.ed25519.publicKey,
1217
1214
  mlDsa: options.keys.mlDsa.publicKey
1218
1215
  }
1219
- }, true);
1216
+ });
1220
1217
  if (!payload?.ok || payload.nodeKey !== options.nodeKey || !payload.computeReference || !payload.projectKey || !payload.environmentKey || payload.realm !== "platform" && (payload.realm !== "tenant" || !payload.tenantSlug)) {
1221
1218
  throw new Error(payload?.error?.message || "guest enrolment response was not accepted");
1222
1219
  }
@@ -2718,7 +2715,7 @@ async function applyMetalIsolation(profile, exec = defaultExec) {
2718
2715
  }
2719
2716
 
2720
2717
  // src/version.ts
2721
- var VERSION = "0.1.19";
2718
+ var VERSION = "0.1.20";
2722
2719
 
2723
2720
  // src/index.ts
2724
2721
  function loadOrCreateSeed(path) {
package/dist/fz.js CHANGED
@@ -774,7 +774,7 @@ async function resolveIdentity(selector, socketPath) {
774
774
  }
775
775
 
776
776
  // src/version.ts
777
- var VERSION = "0.1.19";
777
+ var VERSION = "0.1.20";
778
778
 
779
779
  // src/cli/index.ts
780
780
  var DEFAULT_MODE = THRESHOLD_MODES[0].id;
@@ -28,19 +28,19 @@ class SignedNodeHttpError extends Error {
28
28
  this.name = "SignedNodeHttpError";
29
29
  }
30
30
  }
31
- async function postSignedNode(options, path, body, sealedResponse = false) {
31
+ async function postSignedNode(options, path, body) {
32
32
  const url = new URL(options.apiUrl);
33
33
  url.pathname = `${url.pathname.replace(/\/$/, "")}/${path.replace(/^\//, "")}`.replace(/\/+/g, "/");
34
34
  url.search = "";
35
35
  url.hash = "";
36
36
  const raw = JSON.stringify(body);
37
- const recipient = sealedResponse ? generateResponseRecipient() : undefined;
37
+ const recipient = generateResponseRecipient();
38
38
  const envelope = signRequest(options.keys, options.nodeKey, {
39
39
  method: "POST",
40
40
  path: url.pathname,
41
41
  query: "",
42
42
  body: raw,
43
- responseKey: recipient?.publicKey
43
+ responseKey: recipient.publicKey
44
44
  });
45
45
  const signature = encodeSignatureHeader(envelope);
46
46
  const response = await (options.fetch ?? globalThis.fetch)(url, {
@@ -49,7 +49,7 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
49
49
  "content-type": "application/json",
50
50
  "x-fz-node": options.nodeKey,
51
51
  "x-fz-signature": signature,
52
- ...recipient ? { [RESPONSE_KEY_HEADER]: recipient.publicKey } : {}
52
+ [RESPONSE_KEY_HEADER]: recipient.publicKey
53
53
  },
54
54
  body: raw,
55
55
  signal: AbortSignal.timeout(options.requestTimeoutMs ?? 15000)
@@ -60,14 +60,11 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
60
60
  const reason = failure ? failure.error?.message ?? failure.message : undefined;
61
61
  throw new SignedNodeHttpError(response.status, reason || `signed node request returned HTTP ${response.status}`);
62
62
  }
63
- if (recipient) {
64
- try {
65
- return await openResponse(recipient.secretKey, signature, payload);
66
- } catch {
67
- throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
68
- }
63
+ try {
64
+ return await openResponse(recipient.secretKey, signature, payload);
65
+ } catch {
66
+ throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
69
67
  }
70
- return payload;
71
68
  }
72
69
 
73
70
  // src/guest-enrolment.ts
@@ -121,7 +118,7 @@ async function enrolGuestIdentity(options) {
121
118
  ed25519: options.keys.ed25519.publicKey,
122
119
  mlDsa: options.keys.mlDsa.publicKey
123
120
  }
124
- }, true);
121
+ });
125
122
  if (!payload?.ok || payload.nodeKey !== options.nodeKey || !payload.computeReference || !payload.projectKey || !payload.environmentKey || payload.realm !== "platform" && (payload.realm !== "tenant" || !payload.tenantSlug)) {
126
123
  throw new Error(payload?.error?.message || "guest enrolment response was not accepted");
127
124
  }
@@ -108,19 +108,19 @@ class SignedNodeHttpError extends Error {
108
108
  this.name = "SignedNodeHttpError";
109
109
  }
110
110
  }
111
- async function postSignedNode(options, path, body, sealedResponse = false) {
111
+ async function postSignedNode(options, path, body) {
112
112
  const url = new URL(options.apiUrl);
113
113
  url.pathname = `${url.pathname.replace(/\/$/, "")}/${path.replace(/^\//, "")}`.replace(/\/+/g, "/");
114
114
  url.search = "";
115
115
  url.hash = "";
116
116
  const raw = JSON.stringify(body);
117
- const recipient = sealedResponse ? generateResponseRecipient() : undefined;
117
+ const recipient = generateResponseRecipient();
118
118
  const envelope = signRequest(options.keys, options.nodeKey, {
119
119
  method: "POST",
120
120
  path: url.pathname,
121
121
  query: "",
122
122
  body: raw,
123
- responseKey: recipient?.publicKey
123
+ responseKey: recipient.publicKey
124
124
  });
125
125
  const signature = encodeSignatureHeader(envelope);
126
126
  const response = await (options.fetch ?? globalThis.fetch)(url, {
@@ -129,7 +129,7 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
129
129
  "content-type": "application/json",
130
130
  "x-fz-node": options.nodeKey,
131
131
  "x-fz-signature": signature,
132
- ...recipient ? { [RESPONSE_KEY_HEADER]: recipient.publicKey } : {}
132
+ [RESPONSE_KEY_HEADER]: recipient.publicKey
133
133
  },
134
134
  body: raw,
135
135
  signal: AbortSignal.timeout(options.requestTimeoutMs ?? 15000)
@@ -140,14 +140,11 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
140
140
  const reason = failure ? failure.error?.message ?? failure.message : undefined;
141
141
  throw new SignedNodeHttpError(response.status, reason || `signed node request returned HTTP ${response.status}`);
142
142
  }
143
- if (recipient) {
144
- try {
145
- return await openResponse(recipient.secretKey, signature, payload);
146
- } catch {
147
- throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
148
- }
143
+ try {
144
+ return await openResponse(recipient.secretKey, signature, payload);
145
+ } catch {
146
+ throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
149
147
  }
150
- return payload;
151
148
  }
152
149
 
153
150
  // src/node-vault.ts
@@ -179,7 +176,7 @@ function tenantNodeApiUrl(apiUrl, tenantSlug) {
179
176
  return url.toString().replace(/\/$/, "");
180
177
  }
181
178
  function createNodeVaultCache(options) {
182
- const post = (operation, body) => postSignedNode(options, `v1/node/vault/${operation}`, body, true);
179
+ const post = (operation, body) => postSignedNode(options, `v1/node/vault/${operation}`, body);
183
180
  return createSecretCache({
184
181
  ttlMs: options.ttlMs,
185
182
  maxStaleMs: options.maxStaleMs,
@@ -15,19 +15,19 @@ class SignedNodeHttpError extends Error {
15
15
  this.name = "SignedNodeHttpError";
16
16
  }
17
17
  }
18
- async function postSignedNode(options, path, body, sealedResponse = false) {
18
+ async function postSignedNode(options, path, body) {
19
19
  const url = new URL(options.apiUrl);
20
20
  url.pathname = `${url.pathname.replace(/\/$/, "")}/${path.replace(/^\//, "")}`.replace(/\/+/g, "/");
21
21
  url.search = "";
22
22
  url.hash = "";
23
23
  const raw = JSON.stringify(body);
24
- const recipient = sealedResponse ? generateResponseRecipient() : undefined;
24
+ const recipient = generateResponseRecipient();
25
25
  const envelope = signRequest(options.keys, options.nodeKey, {
26
26
  method: "POST",
27
27
  path: url.pathname,
28
28
  query: "",
29
29
  body: raw,
30
- responseKey: recipient?.publicKey
30
+ responseKey: recipient.publicKey
31
31
  });
32
32
  const signature = encodeSignatureHeader(envelope);
33
33
  const response = await (options.fetch ?? globalThis.fetch)(url, {
@@ -36,7 +36,7 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
36
36
  "content-type": "application/json",
37
37
  "x-fz-node": options.nodeKey,
38
38
  "x-fz-signature": signature,
39
- ...recipient ? { [RESPONSE_KEY_HEADER]: recipient.publicKey } : {}
39
+ [RESPONSE_KEY_HEADER]: recipient.publicKey
40
40
  },
41
41
  body: raw,
42
42
  signal: AbortSignal.timeout(options.requestTimeoutMs ?? 15000)
@@ -47,14 +47,11 @@ async function postSignedNode(options, path, body, sealedResponse = false) {
47
47
  const reason = failure ? failure.error?.message ?? failure.message : undefined;
48
48
  throw new SignedNodeHttpError(response.status, reason || `signed node request returned HTTP ${response.status}`);
49
49
  }
50
- if (recipient) {
51
- try {
52
- return await openResponse(recipient.secretKey, signature, payload);
53
- } catch {
54
- throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
55
- }
50
+ try {
51
+ return await openResponse(recipient.secretKey, signature, payload);
52
+ } catch {
53
+ throw new SignedNodeHttpError(502, "The node response was not sealed to this request.");
56
54
  }
57
- return payload;
58
55
  }
59
56
 
60
57
  // src/provisioning-pull.ts
@@ -11,4 +11,4 @@ export declare class SignedNodeHttpError extends Error {
11
11
  constructor(status: number, message: string);
12
12
  }
13
13
  /** One implementation of the hybrid-signed machine HTTP contract. */
14
- export declare function postSignedNode<T>(options: SignedNodeHttpOptions, path: string, body: object, sealedResponse?: boolean): Promise<T>;
14
+ export declare function postSignedNode<T>(options: SignedNodeHttpOptions, path: string, body: object): Promise<T>;
package/dist/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
1
  /** One package version shared by both public binaries. Pinned to package.json by tests. */
2
- export declare const VERSION = "0.1.19";
2
+ export declare const VERSION = "0.1.20";
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "//": "Publishing happens from an operator's machine, not CI \u2014 CLAUDE.md records that the absence of CI is deliberate. npm's `provenance` attests a tarball was built by a recognised CI provider from a named commit, so it cannot be produced here: it was set, and the first publish failed with `Automatic provenance generation not supported for provider: null`. A setting that can never be satisfied is worse than none, because it reads as a guarantee nobody is getting. Restore it the day this publishes from CI, and not before.",
3
3
  "name": "@forgezero/agent",
4
- "version": "0.1.19",
4
+ "version": "0.1.20",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "check": "tsc --noEmit",