@aigrc/core 0.1.0 → 0.2.0
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/dist/air/index.d.mts +1669 -0
- package/dist/air/index.d.ts +1669 -0
- package/dist/air/index.js +450 -0
- package/dist/air/index.js.map +1 -0
- package/dist/air/index.mjs +410 -0
- package/dist/air/index.mjs.map +1 -0
- package/dist/governance-lock/index.d.mts +903 -0
- package/dist/governance-lock/index.d.ts +903 -0
- package/dist/governance-lock/index.js +444 -0
- package/dist/governance-lock/index.js.map +1 -0
- package/dist/governance-lock/index.mjs +389 -0
- package/dist/governance-lock/index.mjs.map +1 -0
- package/dist/index.d.mts +467 -4
- package/dist/index.d.ts +467 -4
- package/dist/index.js +2213 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +2114 -2
- package/dist/index.mjs.map +1 -1
- package/dist/schemas/index.d.mts +1950 -29
- package/dist/schemas/index.d.ts +1950 -29
- package/dist/schemas/index.js +354 -1
- package/dist/schemas/index.js.map +1 -1
- package/dist/schemas/index.mjs +332 -1
- package/dist/schemas/index.mjs.map +1 -1
- package/package.json +11 -1
|
@@ -0,0 +1,903 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { AIR } from '../air/index.mjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* governance.lock File Format
|
|
6
|
+
*
|
|
7
|
+
* The governance.lock file pins policy version to code version, similar to
|
|
8
|
+
* package-lock.json. It is generated by the Policy Compiler and verified
|
|
9
|
+
* by the Supply Chain Firewall in IDE, CI/CD, and runtime.
|
|
10
|
+
*
|
|
11
|
+
* @see I2E_Engine_Specification_v1.md Section 4.2.3
|
|
12
|
+
* @module @aigrc/core/governance-lock
|
|
13
|
+
*/
|
|
14
|
+
|
|
15
|
+
declare const GovernanceLockSignatureSchema: z.ZodObject<{
|
|
16
|
+
/** Signer identity (email or system ID) */
|
|
17
|
+
signer: z.ZodString;
|
|
18
|
+
/** Role of the signer (e.g., "CISO", "PolicyOwner", "SecurityLead") */
|
|
19
|
+
role: z.ZodOptional<z.ZodString>;
|
|
20
|
+
/** Algorithm used: RS256 (RSA-SHA256) or ES256 (ECDSA-P256) */
|
|
21
|
+
algorithm: z.ZodEnum<["RS256", "ES256"]>;
|
|
22
|
+
/** Base64-encoded signature */
|
|
23
|
+
signature: z.ZodString;
|
|
24
|
+
/** When the signature was created */
|
|
25
|
+
signed_at: z.ZodString;
|
|
26
|
+
/** Key ID for key rotation support */
|
|
27
|
+
key_id: z.ZodOptional<z.ZodString>;
|
|
28
|
+
/** Expiration of this signature (optional, separate from lock expiration) */
|
|
29
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
30
|
+
/** Certificate chain for verification (optional) */
|
|
31
|
+
certificate_chain: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
32
|
+
}, "strip", z.ZodTypeAny, {
|
|
33
|
+
signature: string;
|
|
34
|
+
algorithm: "RS256" | "ES256";
|
|
35
|
+
signer: string;
|
|
36
|
+
signed_at: string;
|
|
37
|
+
role?: string | undefined;
|
|
38
|
+
expires_at?: string | undefined;
|
|
39
|
+
key_id?: string | undefined;
|
|
40
|
+
certificate_chain?: string[] | undefined;
|
|
41
|
+
}, {
|
|
42
|
+
signature: string;
|
|
43
|
+
algorithm: "RS256" | "ES256";
|
|
44
|
+
signer: string;
|
|
45
|
+
signed_at: string;
|
|
46
|
+
role?: string | undefined;
|
|
47
|
+
expires_at?: string | undefined;
|
|
48
|
+
key_id?: string | undefined;
|
|
49
|
+
certificate_chain?: string[] | undefined;
|
|
50
|
+
}>;
|
|
51
|
+
type GovernanceLockSignature = z.infer<typeof GovernanceLockSignatureSchema>;
|
|
52
|
+
declare const GovernanceLockPolicySourceSchema: z.ZodObject<{
|
|
53
|
+
/** Unique identifier for this source */
|
|
54
|
+
id: z.ZodString;
|
|
55
|
+
/** Type of source */
|
|
56
|
+
type: z.ZodEnum<["pdf", "url", "confluence", "jira", "manual"]>;
|
|
57
|
+
/** URI to the source document */
|
|
58
|
+
uri: z.ZodString;
|
|
59
|
+
/** SHA-256 hash of the source content at time of compilation */
|
|
60
|
+
content_hash: z.ZodString;
|
|
61
|
+
/** When the source was fetched */
|
|
62
|
+
fetched_at: z.ZodString;
|
|
63
|
+
/** Title of the policy document */
|
|
64
|
+
title: z.ZodOptional<z.ZodString>;
|
|
65
|
+
/** Version of the policy document */
|
|
66
|
+
version: z.ZodOptional<z.ZodString>;
|
|
67
|
+
}, "strip", z.ZodTypeAny, {
|
|
68
|
+
type: "jira" | "url" | "pdf" | "confluence" | "manual";
|
|
69
|
+
id: string;
|
|
70
|
+
uri: string;
|
|
71
|
+
content_hash: string;
|
|
72
|
+
fetched_at: string;
|
|
73
|
+
version?: string | undefined;
|
|
74
|
+
title?: string | undefined;
|
|
75
|
+
}, {
|
|
76
|
+
type: "jira" | "url" | "pdf" | "confluence" | "manual";
|
|
77
|
+
id: string;
|
|
78
|
+
uri: string;
|
|
79
|
+
content_hash: string;
|
|
80
|
+
fetched_at: string;
|
|
81
|
+
version?: string | undefined;
|
|
82
|
+
title?: string | undefined;
|
|
83
|
+
}>;
|
|
84
|
+
type GovernanceLockPolicySource = z.infer<typeof GovernanceLockPolicySourceSchema>;
|
|
85
|
+
declare const GovernanceLockRegistryConstraintsSchema: z.ZodObject<{
|
|
86
|
+
/** List of approved vendor IDs */
|
|
87
|
+
allowed_vendor_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
88
|
+
/** List of blocked vendor IDs */
|
|
89
|
+
blocked_vendor_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
90
|
+
/** List of approved region codes */
|
|
91
|
+
allowed_region_codes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
92
|
+
/** List of blocked region codes */
|
|
93
|
+
blocked_region_codes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
94
|
+
/** List of approved model patterns */
|
|
95
|
+
allowed_model_patterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
96
|
+
/** List of blocked model patterns */
|
|
97
|
+
blocked_model_patterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
98
|
+
/** Maximum model parameters allowed */
|
|
99
|
+
max_model_parameters: z.ZodOptional<z.ZodNumber>;
|
|
100
|
+
}, "strip", z.ZodTypeAny, {
|
|
101
|
+
allowed_vendor_ids: string[];
|
|
102
|
+
blocked_vendor_ids: string[];
|
|
103
|
+
allowed_region_codes: string[];
|
|
104
|
+
blocked_region_codes: string[];
|
|
105
|
+
allowed_model_patterns: string[];
|
|
106
|
+
blocked_model_patterns: string[];
|
|
107
|
+
max_model_parameters?: number | undefined;
|
|
108
|
+
}, {
|
|
109
|
+
max_model_parameters?: number | undefined;
|
|
110
|
+
allowed_vendor_ids?: string[] | undefined;
|
|
111
|
+
blocked_vendor_ids?: string[] | undefined;
|
|
112
|
+
allowed_region_codes?: string[] | undefined;
|
|
113
|
+
blocked_region_codes?: string[] | undefined;
|
|
114
|
+
allowed_model_patterns?: string[] | undefined;
|
|
115
|
+
blocked_model_patterns?: string[] | undefined;
|
|
116
|
+
}>;
|
|
117
|
+
type GovernanceLockRegistryConstraints = z.infer<typeof GovernanceLockRegistryConstraintsSchema>;
|
|
118
|
+
declare const GovernanceLockRuntimeConstraintsSchema: z.ZodObject<{
|
|
119
|
+
/** Whether PII filtering is required */
|
|
120
|
+
pii_filter_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
121
|
+
/** PII filter action */
|
|
122
|
+
pii_filter_action: z.ZodOptional<z.ZodEnum<["redact", "block", "warn", "audit"]>>;
|
|
123
|
+
/** Whether toxicity filtering is required */
|
|
124
|
+
toxicity_filter_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
125
|
+
/** Toxicity threshold */
|
|
126
|
+
toxicity_threshold: z.ZodOptional<z.ZodNumber>;
|
|
127
|
+
/** Data retention period in days */
|
|
128
|
+
data_retention_days: z.ZodDefault<z.ZodNumber>;
|
|
129
|
+
/** Whether watermarking is required */
|
|
130
|
+
watermark_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
131
|
+
/** Logging level */
|
|
132
|
+
logging_level: z.ZodDefault<z.ZodEnum<["none", "errors", "all"]>>;
|
|
133
|
+
/** Maximum tokens per request */
|
|
134
|
+
max_tokens_per_request: z.ZodOptional<z.ZodNumber>;
|
|
135
|
+
/** Maximum cost per day in USD */
|
|
136
|
+
max_cost_per_day_usd: z.ZodOptional<z.ZodNumber>;
|
|
137
|
+
/** Kill switch enabled */
|
|
138
|
+
kill_switch_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
139
|
+
}, "strip", z.ZodTypeAny, {
|
|
140
|
+
data_retention_days: number;
|
|
141
|
+
watermark_enabled: boolean;
|
|
142
|
+
logging_level: "errors" | "none" | "all";
|
|
143
|
+
pii_filter_enabled: boolean;
|
|
144
|
+
toxicity_filter_enabled: boolean;
|
|
145
|
+
kill_switch_enabled: boolean;
|
|
146
|
+
max_tokens_per_request?: number | undefined;
|
|
147
|
+
max_cost_per_day_usd?: number | undefined;
|
|
148
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
149
|
+
toxicity_threshold?: number | undefined;
|
|
150
|
+
}, {
|
|
151
|
+
data_retention_days?: number | undefined;
|
|
152
|
+
watermark_enabled?: boolean | undefined;
|
|
153
|
+
logging_level?: "errors" | "none" | "all" | undefined;
|
|
154
|
+
max_tokens_per_request?: number | undefined;
|
|
155
|
+
max_cost_per_day_usd?: number | undefined;
|
|
156
|
+
pii_filter_enabled?: boolean | undefined;
|
|
157
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
158
|
+
toxicity_filter_enabled?: boolean | undefined;
|
|
159
|
+
toxicity_threshold?: number | undefined;
|
|
160
|
+
kill_switch_enabled?: boolean | undefined;
|
|
161
|
+
}>;
|
|
162
|
+
type GovernanceLockRuntimeConstraints = z.infer<typeof GovernanceLockRuntimeConstraintsSchema>;
|
|
163
|
+
declare const GovernanceLockBuildConstraintsSchema: z.ZodObject<{
|
|
164
|
+
/** Require Golden Thread linkage */
|
|
165
|
+
require_golden_thread: z.ZodDefault<z.ZodBoolean>;
|
|
166
|
+
/** Require asset card */
|
|
167
|
+
require_asset_card: z.ZodDefault<z.ZodBoolean>;
|
|
168
|
+
/** Require risk classification */
|
|
169
|
+
require_risk_classification: z.ZodDefault<z.ZodBoolean>;
|
|
170
|
+
/** Require model card */
|
|
171
|
+
require_model_card: z.ZodDefault<z.ZodBoolean>;
|
|
172
|
+
/** Require security review for high risk */
|
|
173
|
+
require_security_review: z.ZodDefault<z.ZodBoolean>;
|
|
174
|
+
/** Block merge on validation failure */
|
|
175
|
+
block_on_failure: z.ZodDefault<z.ZodBoolean>;
|
|
176
|
+
/** Generate SARIF report */
|
|
177
|
+
generate_sarif: z.ZodDefault<z.ZodBoolean>;
|
|
178
|
+
/** Allowed environments */
|
|
179
|
+
allowed_environments: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
180
|
+
}, "strip", z.ZodTypeAny, {
|
|
181
|
+
require_golden_thread: boolean;
|
|
182
|
+
require_asset_card: boolean;
|
|
183
|
+
require_risk_classification: boolean;
|
|
184
|
+
require_model_card: boolean;
|
|
185
|
+
require_security_review: boolean;
|
|
186
|
+
block_on_failure: boolean;
|
|
187
|
+
generate_sarif: boolean;
|
|
188
|
+
allowed_environments: string[];
|
|
189
|
+
}, {
|
|
190
|
+
require_golden_thread?: boolean | undefined;
|
|
191
|
+
require_asset_card?: boolean | undefined;
|
|
192
|
+
require_risk_classification?: boolean | undefined;
|
|
193
|
+
require_model_card?: boolean | undefined;
|
|
194
|
+
require_security_review?: boolean | undefined;
|
|
195
|
+
block_on_failure?: boolean | undefined;
|
|
196
|
+
generate_sarif?: boolean | undefined;
|
|
197
|
+
allowed_environments?: string[] | undefined;
|
|
198
|
+
}>;
|
|
199
|
+
type GovernanceLockBuildConstraints = z.infer<typeof GovernanceLockBuildConstraintsSchema>;
|
|
200
|
+
declare const GovernanceLockConstraintsSchema: z.ZodObject<{
|
|
201
|
+
/** Registry constraints (vendor/model/region) */
|
|
202
|
+
registry: z.ZodDefault<z.ZodObject<{
|
|
203
|
+
/** List of approved vendor IDs */
|
|
204
|
+
allowed_vendor_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
205
|
+
/** List of blocked vendor IDs */
|
|
206
|
+
blocked_vendor_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
207
|
+
/** List of approved region codes */
|
|
208
|
+
allowed_region_codes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
209
|
+
/** List of blocked region codes */
|
|
210
|
+
blocked_region_codes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
211
|
+
/** List of approved model patterns */
|
|
212
|
+
allowed_model_patterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
213
|
+
/** List of blocked model patterns */
|
|
214
|
+
blocked_model_patterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
215
|
+
/** Maximum model parameters allowed */
|
|
216
|
+
max_model_parameters: z.ZodOptional<z.ZodNumber>;
|
|
217
|
+
}, "strip", z.ZodTypeAny, {
|
|
218
|
+
allowed_vendor_ids: string[];
|
|
219
|
+
blocked_vendor_ids: string[];
|
|
220
|
+
allowed_region_codes: string[];
|
|
221
|
+
blocked_region_codes: string[];
|
|
222
|
+
allowed_model_patterns: string[];
|
|
223
|
+
blocked_model_patterns: string[];
|
|
224
|
+
max_model_parameters?: number | undefined;
|
|
225
|
+
}, {
|
|
226
|
+
max_model_parameters?: number | undefined;
|
|
227
|
+
allowed_vendor_ids?: string[] | undefined;
|
|
228
|
+
blocked_vendor_ids?: string[] | undefined;
|
|
229
|
+
allowed_region_codes?: string[] | undefined;
|
|
230
|
+
blocked_region_codes?: string[] | undefined;
|
|
231
|
+
allowed_model_patterns?: string[] | undefined;
|
|
232
|
+
blocked_model_patterns?: string[] | undefined;
|
|
233
|
+
}>>;
|
|
234
|
+
/** Runtime constraints */
|
|
235
|
+
runtime: z.ZodDefault<z.ZodObject<{
|
|
236
|
+
/** Whether PII filtering is required */
|
|
237
|
+
pii_filter_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
238
|
+
/** PII filter action */
|
|
239
|
+
pii_filter_action: z.ZodOptional<z.ZodEnum<["redact", "block", "warn", "audit"]>>;
|
|
240
|
+
/** Whether toxicity filtering is required */
|
|
241
|
+
toxicity_filter_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
242
|
+
/** Toxicity threshold */
|
|
243
|
+
toxicity_threshold: z.ZodOptional<z.ZodNumber>;
|
|
244
|
+
/** Data retention period in days */
|
|
245
|
+
data_retention_days: z.ZodDefault<z.ZodNumber>;
|
|
246
|
+
/** Whether watermarking is required */
|
|
247
|
+
watermark_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
248
|
+
/** Logging level */
|
|
249
|
+
logging_level: z.ZodDefault<z.ZodEnum<["none", "errors", "all"]>>;
|
|
250
|
+
/** Maximum tokens per request */
|
|
251
|
+
max_tokens_per_request: z.ZodOptional<z.ZodNumber>;
|
|
252
|
+
/** Maximum cost per day in USD */
|
|
253
|
+
max_cost_per_day_usd: z.ZodOptional<z.ZodNumber>;
|
|
254
|
+
/** Kill switch enabled */
|
|
255
|
+
kill_switch_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
256
|
+
}, "strip", z.ZodTypeAny, {
|
|
257
|
+
data_retention_days: number;
|
|
258
|
+
watermark_enabled: boolean;
|
|
259
|
+
logging_level: "errors" | "none" | "all";
|
|
260
|
+
pii_filter_enabled: boolean;
|
|
261
|
+
toxicity_filter_enabled: boolean;
|
|
262
|
+
kill_switch_enabled: boolean;
|
|
263
|
+
max_tokens_per_request?: number | undefined;
|
|
264
|
+
max_cost_per_day_usd?: number | undefined;
|
|
265
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
266
|
+
toxicity_threshold?: number | undefined;
|
|
267
|
+
}, {
|
|
268
|
+
data_retention_days?: number | undefined;
|
|
269
|
+
watermark_enabled?: boolean | undefined;
|
|
270
|
+
logging_level?: "errors" | "none" | "all" | undefined;
|
|
271
|
+
max_tokens_per_request?: number | undefined;
|
|
272
|
+
max_cost_per_day_usd?: number | undefined;
|
|
273
|
+
pii_filter_enabled?: boolean | undefined;
|
|
274
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
275
|
+
toxicity_filter_enabled?: boolean | undefined;
|
|
276
|
+
toxicity_threshold?: number | undefined;
|
|
277
|
+
kill_switch_enabled?: boolean | undefined;
|
|
278
|
+
}>>;
|
|
279
|
+
/** Build constraints */
|
|
280
|
+
build: z.ZodDefault<z.ZodObject<{
|
|
281
|
+
/** Require Golden Thread linkage */
|
|
282
|
+
require_golden_thread: z.ZodDefault<z.ZodBoolean>;
|
|
283
|
+
/** Require asset card */
|
|
284
|
+
require_asset_card: z.ZodDefault<z.ZodBoolean>;
|
|
285
|
+
/** Require risk classification */
|
|
286
|
+
require_risk_classification: z.ZodDefault<z.ZodBoolean>;
|
|
287
|
+
/** Require model card */
|
|
288
|
+
require_model_card: z.ZodDefault<z.ZodBoolean>;
|
|
289
|
+
/** Require security review for high risk */
|
|
290
|
+
require_security_review: z.ZodDefault<z.ZodBoolean>;
|
|
291
|
+
/** Block merge on validation failure */
|
|
292
|
+
block_on_failure: z.ZodDefault<z.ZodBoolean>;
|
|
293
|
+
/** Generate SARIF report */
|
|
294
|
+
generate_sarif: z.ZodDefault<z.ZodBoolean>;
|
|
295
|
+
/** Allowed environments */
|
|
296
|
+
allowed_environments: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
297
|
+
}, "strip", z.ZodTypeAny, {
|
|
298
|
+
require_golden_thread: boolean;
|
|
299
|
+
require_asset_card: boolean;
|
|
300
|
+
require_risk_classification: boolean;
|
|
301
|
+
require_model_card: boolean;
|
|
302
|
+
require_security_review: boolean;
|
|
303
|
+
block_on_failure: boolean;
|
|
304
|
+
generate_sarif: boolean;
|
|
305
|
+
allowed_environments: string[];
|
|
306
|
+
}, {
|
|
307
|
+
require_golden_thread?: boolean | undefined;
|
|
308
|
+
require_asset_card?: boolean | undefined;
|
|
309
|
+
require_risk_classification?: boolean | undefined;
|
|
310
|
+
require_model_card?: boolean | undefined;
|
|
311
|
+
require_security_review?: boolean | undefined;
|
|
312
|
+
block_on_failure?: boolean | undefined;
|
|
313
|
+
generate_sarif?: boolean | undefined;
|
|
314
|
+
allowed_environments?: string[] | undefined;
|
|
315
|
+
}>>;
|
|
316
|
+
}, "strip", z.ZodTypeAny, {
|
|
317
|
+
runtime: {
|
|
318
|
+
data_retention_days: number;
|
|
319
|
+
watermark_enabled: boolean;
|
|
320
|
+
logging_level: "errors" | "none" | "all";
|
|
321
|
+
pii_filter_enabled: boolean;
|
|
322
|
+
toxicity_filter_enabled: boolean;
|
|
323
|
+
kill_switch_enabled: boolean;
|
|
324
|
+
max_tokens_per_request?: number | undefined;
|
|
325
|
+
max_cost_per_day_usd?: number | undefined;
|
|
326
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
327
|
+
toxicity_threshold?: number | undefined;
|
|
328
|
+
};
|
|
329
|
+
build: {
|
|
330
|
+
require_golden_thread: boolean;
|
|
331
|
+
require_asset_card: boolean;
|
|
332
|
+
require_risk_classification: boolean;
|
|
333
|
+
require_model_card: boolean;
|
|
334
|
+
require_security_review: boolean;
|
|
335
|
+
block_on_failure: boolean;
|
|
336
|
+
generate_sarif: boolean;
|
|
337
|
+
allowed_environments: string[];
|
|
338
|
+
};
|
|
339
|
+
registry: {
|
|
340
|
+
allowed_vendor_ids: string[];
|
|
341
|
+
blocked_vendor_ids: string[];
|
|
342
|
+
allowed_region_codes: string[];
|
|
343
|
+
blocked_region_codes: string[];
|
|
344
|
+
allowed_model_patterns: string[];
|
|
345
|
+
blocked_model_patterns: string[];
|
|
346
|
+
max_model_parameters?: number | undefined;
|
|
347
|
+
};
|
|
348
|
+
}, {
|
|
349
|
+
runtime?: {
|
|
350
|
+
data_retention_days?: number | undefined;
|
|
351
|
+
watermark_enabled?: boolean | undefined;
|
|
352
|
+
logging_level?: "errors" | "none" | "all" | undefined;
|
|
353
|
+
max_tokens_per_request?: number | undefined;
|
|
354
|
+
max_cost_per_day_usd?: number | undefined;
|
|
355
|
+
pii_filter_enabled?: boolean | undefined;
|
|
356
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
357
|
+
toxicity_filter_enabled?: boolean | undefined;
|
|
358
|
+
toxicity_threshold?: number | undefined;
|
|
359
|
+
kill_switch_enabled?: boolean | undefined;
|
|
360
|
+
} | undefined;
|
|
361
|
+
build?: {
|
|
362
|
+
require_golden_thread?: boolean | undefined;
|
|
363
|
+
require_asset_card?: boolean | undefined;
|
|
364
|
+
require_risk_classification?: boolean | undefined;
|
|
365
|
+
require_model_card?: boolean | undefined;
|
|
366
|
+
require_security_review?: boolean | undefined;
|
|
367
|
+
block_on_failure?: boolean | undefined;
|
|
368
|
+
generate_sarif?: boolean | undefined;
|
|
369
|
+
allowed_environments?: string[] | undefined;
|
|
370
|
+
} | undefined;
|
|
371
|
+
registry?: {
|
|
372
|
+
max_model_parameters?: number | undefined;
|
|
373
|
+
allowed_vendor_ids?: string[] | undefined;
|
|
374
|
+
blocked_vendor_ids?: string[] | undefined;
|
|
375
|
+
allowed_region_codes?: string[] | undefined;
|
|
376
|
+
blocked_region_codes?: string[] | undefined;
|
|
377
|
+
allowed_model_patterns?: string[] | undefined;
|
|
378
|
+
blocked_model_patterns?: string[] | undefined;
|
|
379
|
+
} | undefined;
|
|
380
|
+
}>;
|
|
381
|
+
type GovernanceLockConstraints = z.infer<typeof GovernanceLockConstraintsSchema>;
|
|
382
|
+
declare const GovernanceLockSchema: z.ZodObject<{
|
|
383
|
+
/** Schema version for forward compatibility */
|
|
384
|
+
version: z.ZodLiteral<"1.0">;
|
|
385
|
+
/** When this lock file was generated */
|
|
386
|
+
generated_at: z.ZodString;
|
|
387
|
+
/** SHA-256 hash of the compiled policy (AIR) */
|
|
388
|
+
policy_hash: z.ZodString;
|
|
389
|
+
/** Name of this policy lock */
|
|
390
|
+
name: z.ZodOptional<z.ZodString>;
|
|
391
|
+
/** Description of this lock file */
|
|
392
|
+
description: z.ZodOptional<z.ZodString>;
|
|
393
|
+
/** Policy sources that contributed to this lock */
|
|
394
|
+
policy_sources: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
395
|
+
/** Unique identifier for this source */
|
|
396
|
+
id: z.ZodString;
|
|
397
|
+
/** Type of source */
|
|
398
|
+
type: z.ZodEnum<["pdf", "url", "confluence", "jira", "manual"]>;
|
|
399
|
+
/** URI to the source document */
|
|
400
|
+
uri: z.ZodString;
|
|
401
|
+
/** SHA-256 hash of the source content at time of compilation */
|
|
402
|
+
content_hash: z.ZodString;
|
|
403
|
+
/** When the source was fetched */
|
|
404
|
+
fetched_at: z.ZodString;
|
|
405
|
+
/** Title of the policy document */
|
|
406
|
+
title: z.ZodOptional<z.ZodString>;
|
|
407
|
+
/** Version of the policy document */
|
|
408
|
+
version: z.ZodOptional<z.ZodString>;
|
|
409
|
+
}, "strip", z.ZodTypeAny, {
|
|
410
|
+
type: "jira" | "url" | "pdf" | "confluence" | "manual";
|
|
411
|
+
id: string;
|
|
412
|
+
uri: string;
|
|
413
|
+
content_hash: string;
|
|
414
|
+
fetched_at: string;
|
|
415
|
+
version?: string | undefined;
|
|
416
|
+
title?: string | undefined;
|
|
417
|
+
}, {
|
|
418
|
+
type: "jira" | "url" | "pdf" | "confluence" | "manual";
|
|
419
|
+
id: string;
|
|
420
|
+
uri: string;
|
|
421
|
+
content_hash: string;
|
|
422
|
+
fetched_at: string;
|
|
423
|
+
version?: string | undefined;
|
|
424
|
+
title?: string | undefined;
|
|
425
|
+
}>, "many">>;
|
|
426
|
+
/** Compiled constraints (subset of AIR) */
|
|
427
|
+
constraints: z.ZodDefault<z.ZodObject<{
|
|
428
|
+
/** Registry constraints (vendor/model/region) */
|
|
429
|
+
registry: z.ZodDefault<z.ZodObject<{
|
|
430
|
+
/** List of approved vendor IDs */
|
|
431
|
+
allowed_vendor_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
432
|
+
/** List of blocked vendor IDs */
|
|
433
|
+
blocked_vendor_ids: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
434
|
+
/** List of approved region codes */
|
|
435
|
+
allowed_region_codes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
436
|
+
/** List of blocked region codes */
|
|
437
|
+
blocked_region_codes: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
438
|
+
/** List of approved model patterns */
|
|
439
|
+
allowed_model_patterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
440
|
+
/** List of blocked model patterns */
|
|
441
|
+
blocked_model_patterns: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
442
|
+
/** Maximum model parameters allowed */
|
|
443
|
+
max_model_parameters: z.ZodOptional<z.ZodNumber>;
|
|
444
|
+
}, "strip", z.ZodTypeAny, {
|
|
445
|
+
allowed_vendor_ids: string[];
|
|
446
|
+
blocked_vendor_ids: string[];
|
|
447
|
+
allowed_region_codes: string[];
|
|
448
|
+
blocked_region_codes: string[];
|
|
449
|
+
allowed_model_patterns: string[];
|
|
450
|
+
blocked_model_patterns: string[];
|
|
451
|
+
max_model_parameters?: number | undefined;
|
|
452
|
+
}, {
|
|
453
|
+
max_model_parameters?: number | undefined;
|
|
454
|
+
allowed_vendor_ids?: string[] | undefined;
|
|
455
|
+
blocked_vendor_ids?: string[] | undefined;
|
|
456
|
+
allowed_region_codes?: string[] | undefined;
|
|
457
|
+
blocked_region_codes?: string[] | undefined;
|
|
458
|
+
allowed_model_patterns?: string[] | undefined;
|
|
459
|
+
blocked_model_patterns?: string[] | undefined;
|
|
460
|
+
}>>;
|
|
461
|
+
/** Runtime constraints */
|
|
462
|
+
runtime: z.ZodDefault<z.ZodObject<{
|
|
463
|
+
/** Whether PII filtering is required */
|
|
464
|
+
pii_filter_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
465
|
+
/** PII filter action */
|
|
466
|
+
pii_filter_action: z.ZodOptional<z.ZodEnum<["redact", "block", "warn", "audit"]>>;
|
|
467
|
+
/** Whether toxicity filtering is required */
|
|
468
|
+
toxicity_filter_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
469
|
+
/** Toxicity threshold */
|
|
470
|
+
toxicity_threshold: z.ZodOptional<z.ZodNumber>;
|
|
471
|
+
/** Data retention period in days */
|
|
472
|
+
data_retention_days: z.ZodDefault<z.ZodNumber>;
|
|
473
|
+
/** Whether watermarking is required */
|
|
474
|
+
watermark_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
475
|
+
/** Logging level */
|
|
476
|
+
logging_level: z.ZodDefault<z.ZodEnum<["none", "errors", "all"]>>;
|
|
477
|
+
/** Maximum tokens per request */
|
|
478
|
+
max_tokens_per_request: z.ZodOptional<z.ZodNumber>;
|
|
479
|
+
/** Maximum cost per day in USD */
|
|
480
|
+
max_cost_per_day_usd: z.ZodOptional<z.ZodNumber>;
|
|
481
|
+
/** Kill switch enabled */
|
|
482
|
+
kill_switch_enabled: z.ZodDefault<z.ZodBoolean>;
|
|
483
|
+
}, "strip", z.ZodTypeAny, {
|
|
484
|
+
data_retention_days: number;
|
|
485
|
+
watermark_enabled: boolean;
|
|
486
|
+
logging_level: "errors" | "none" | "all";
|
|
487
|
+
pii_filter_enabled: boolean;
|
|
488
|
+
toxicity_filter_enabled: boolean;
|
|
489
|
+
kill_switch_enabled: boolean;
|
|
490
|
+
max_tokens_per_request?: number | undefined;
|
|
491
|
+
max_cost_per_day_usd?: number | undefined;
|
|
492
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
493
|
+
toxicity_threshold?: number | undefined;
|
|
494
|
+
}, {
|
|
495
|
+
data_retention_days?: number | undefined;
|
|
496
|
+
watermark_enabled?: boolean | undefined;
|
|
497
|
+
logging_level?: "errors" | "none" | "all" | undefined;
|
|
498
|
+
max_tokens_per_request?: number | undefined;
|
|
499
|
+
max_cost_per_day_usd?: number | undefined;
|
|
500
|
+
pii_filter_enabled?: boolean | undefined;
|
|
501
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
502
|
+
toxicity_filter_enabled?: boolean | undefined;
|
|
503
|
+
toxicity_threshold?: number | undefined;
|
|
504
|
+
kill_switch_enabled?: boolean | undefined;
|
|
505
|
+
}>>;
|
|
506
|
+
/** Build constraints */
|
|
507
|
+
build: z.ZodDefault<z.ZodObject<{
|
|
508
|
+
/** Require Golden Thread linkage */
|
|
509
|
+
require_golden_thread: z.ZodDefault<z.ZodBoolean>;
|
|
510
|
+
/** Require asset card */
|
|
511
|
+
require_asset_card: z.ZodDefault<z.ZodBoolean>;
|
|
512
|
+
/** Require risk classification */
|
|
513
|
+
require_risk_classification: z.ZodDefault<z.ZodBoolean>;
|
|
514
|
+
/** Require model card */
|
|
515
|
+
require_model_card: z.ZodDefault<z.ZodBoolean>;
|
|
516
|
+
/** Require security review for high risk */
|
|
517
|
+
require_security_review: z.ZodDefault<z.ZodBoolean>;
|
|
518
|
+
/** Block merge on validation failure */
|
|
519
|
+
block_on_failure: z.ZodDefault<z.ZodBoolean>;
|
|
520
|
+
/** Generate SARIF report */
|
|
521
|
+
generate_sarif: z.ZodDefault<z.ZodBoolean>;
|
|
522
|
+
/** Allowed environments */
|
|
523
|
+
allowed_environments: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
524
|
+
}, "strip", z.ZodTypeAny, {
|
|
525
|
+
require_golden_thread: boolean;
|
|
526
|
+
require_asset_card: boolean;
|
|
527
|
+
require_risk_classification: boolean;
|
|
528
|
+
require_model_card: boolean;
|
|
529
|
+
require_security_review: boolean;
|
|
530
|
+
block_on_failure: boolean;
|
|
531
|
+
generate_sarif: boolean;
|
|
532
|
+
allowed_environments: string[];
|
|
533
|
+
}, {
|
|
534
|
+
require_golden_thread?: boolean | undefined;
|
|
535
|
+
require_asset_card?: boolean | undefined;
|
|
536
|
+
require_risk_classification?: boolean | undefined;
|
|
537
|
+
require_model_card?: boolean | undefined;
|
|
538
|
+
require_security_review?: boolean | undefined;
|
|
539
|
+
block_on_failure?: boolean | undefined;
|
|
540
|
+
generate_sarif?: boolean | undefined;
|
|
541
|
+
allowed_environments?: string[] | undefined;
|
|
542
|
+
}>>;
|
|
543
|
+
}, "strip", z.ZodTypeAny, {
|
|
544
|
+
runtime: {
|
|
545
|
+
data_retention_days: number;
|
|
546
|
+
watermark_enabled: boolean;
|
|
547
|
+
logging_level: "errors" | "none" | "all";
|
|
548
|
+
pii_filter_enabled: boolean;
|
|
549
|
+
toxicity_filter_enabled: boolean;
|
|
550
|
+
kill_switch_enabled: boolean;
|
|
551
|
+
max_tokens_per_request?: number | undefined;
|
|
552
|
+
max_cost_per_day_usd?: number | undefined;
|
|
553
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
554
|
+
toxicity_threshold?: number | undefined;
|
|
555
|
+
};
|
|
556
|
+
build: {
|
|
557
|
+
require_golden_thread: boolean;
|
|
558
|
+
require_asset_card: boolean;
|
|
559
|
+
require_risk_classification: boolean;
|
|
560
|
+
require_model_card: boolean;
|
|
561
|
+
require_security_review: boolean;
|
|
562
|
+
block_on_failure: boolean;
|
|
563
|
+
generate_sarif: boolean;
|
|
564
|
+
allowed_environments: string[];
|
|
565
|
+
};
|
|
566
|
+
registry: {
|
|
567
|
+
allowed_vendor_ids: string[];
|
|
568
|
+
blocked_vendor_ids: string[];
|
|
569
|
+
allowed_region_codes: string[];
|
|
570
|
+
blocked_region_codes: string[];
|
|
571
|
+
allowed_model_patterns: string[];
|
|
572
|
+
blocked_model_patterns: string[];
|
|
573
|
+
max_model_parameters?: number | undefined;
|
|
574
|
+
};
|
|
575
|
+
}, {
|
|
576
|
+
runtime?: {
|
|
577
|
+
data_retention_days?: number | undefined;
|
|
578
|
+
watermark_enabled?: boolean | undefined;
|
|
579
|
+
logging_level?: "errors" | "none" | "all" | undefined;
|
|
580
|
+
max_tokens_per_request?: number | undefined;
|
|
581
|
+
max_cost_per_day_usd?: number | undefined;
|
|
582
|
+
pii_filter_enabled?: boolean | undefined;
|
|
583
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
584
|
+
toxicity_filter_enabled?: boolean | undefined;
|
|
585
|
+
toxicity_threshold?: number | undefined;
|
|
586
|
+
kill_switch_enabled?: boolean | undefined;
|
|
587
|
+
} | undefined;
|
|
588
|
+
build?: {
|
|
589
|
+
require_golden_thread?: boolean | undefined;
|
|
590
|
+
require_asset_card?: boolean | undefined;
|
|
591
|
+
require_risk_classification?: boolean | undefined;
|
|
592
|
+
require_model_card?: boolean | undefined;
|
|
593
|
+
require_security_review?: boolean | undefined;
|
|
594
|
+
block_on_failure?: boolean | undefined;
|
|
595
|
+
generate_sarif?: boolean | undefined;
|
|
596
|
+
allowed_environments?: string[] | undefined;
|
|
597
|
+
} | undefined;
|
|
598
|
+
registry?: {
|
|
599
|
+
max_model_parameters?: number | undefined;
|
|
600
|
+
allowed_vendor_ids?: string[] | undefined;
|
|
601
|
+
blocked_vendor_ids?: string[] | undefined;
|
|
602
|
+
allowed_region_codes?: string[] | undefined;
|
|
603
|
+
blocked_region_codes?: string[] | undefined;
|
|
604
|
+
allowed_model_patterns?: string[] | undefined;
|
|
605
|
+
blocked_model_patterns?: string[] | undefined;
|
|
606
|
+
} | undefined;
|
|
607
|
+
}>>;
|
|
608
|
+
/** Digital signatures from policy owners */
|
|
609
|
+
signatures: z.ZodDefault<z.ZodArray<z.ZodObject<{
|
|
610
|
+
/** Signer identity (email or system ID) */
|
|
611
|
+
signer: z.ZodString;
|
|
612
|
+
/** Role of the signer (e.g., "CISO", "PolicyOwner", "SecurityLead") */
|
|
613
|
+
role: z.ZodOptional<z.ZodString>;
|
|
614
|
+
/** Algorithm used: RS256 (RSA-SHA256) or ES256 (ECDSA-P256) */
|
|
615
|
+
algorithm: z.ZodEnum<["RS256", "ES256"]>;
|
|
616
|
+
/** Base64-encoded signature */
|
|
617
|
+
signature: z.ZodString;
|
|
618
|
+
/** When the signature was created */
|
|
619
|
+
signed_at: z.ZodString;
|
|
620
|
+
/** Key ID for key rotation support */
|
|
621
|
+
key_id: z.ZodOptional<z.ZodString>;
|
|
622
|
+
/** Expiration of this signature (optional, separate from lock expiration) */
|
|
623
|
+
expires_at: z.ZodOptional<z.ZodString>;
|
|
624
|
+
/** Certificate chain for verification (optional) */
|
|
625
|
+
certificate_chain: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
626
|
+
}, "strip", z.ZodTypeAny, {
|
|
627
|
+
signature: string;
|
|
628
|
+
algorithm: "RS256" | "ES256";
|
|
629
|
+
signer: string;
|
|
630
|
+
signed_at: string;
|
|
631
|
+
role?: string | undefined;
|
|
632
|
+
expires_at?: string | undefined;
|
|
633
|
+
key_id?: string | undefined;
|
|
634
|
+
certificate_chain?: string[] | undefined;
|
|
635
|
+
}, {
|
|
636
|
+
signature: string;
|
|
637
|
+
algorithm: "RS256" | "ES256";
|
|
638
|
+
signer: string;
|
|
639
|
+
signed_at: string;
|
|
640
|
+
role?: string | undefined;
|
|
641
|
+
expires_at?: string | undefined;
|
|
642
|
+
key_id?: string | undefined;
|
|
643
|
+
certificate_chain?: string[] | undefined;
|
|
644
|
+
}>, "many">>;
|
|
645
|
+
/** When this lock file expires (forces re-compilation) */
|
|
646
|
+
expires_at: z.ZodString;
|
|
647
|
+
/** Tool/system that generated this lock */
|
|
648
|
+
generated_by: z.ZodDefault<z.ZodString>;
|
|
649
|
+
/** Version of the generator */
|
|
650
|
+
generator_version: z.ZodDefault<z.ZodString>;
|
|
651
|
+
/** Organization this lock belongs to */
|
|
652
|
+
organization: z.ZodOptional<z.ZodString>;
|
|
653
|
+
/** Environment this lock is for */
|
|
654
|
+
environment: z.ZodOptional<z.ZodString>;
|
|
655
|
+
/** Reference to the full AIR document (optional) */
|
|
656
|
+
air_reference: z.ZodOptional<z.ZodObject<{
|
|
657
|
+
/** AIR document ID */
|
|
658
|
+
id: z.ZodString;
|
|
659
|
+
/** AIR document location (URI) */
|
|
660
|
+
location: z.ZodOptional<z.ZodString>;
|
|
661
|
+
/** AIR document hash */
|
|
662
|
+
hash: z.ZodString;
|
|
663
|
+
}, "strip", z.ZodTypeAny, {
|
|
664
|
+
hash: string;
|
|
665
|
+
id: string;
|
|
666
|
+
location?: string | undefined;
|
|
667
|
+
}, {
|
|
668
|
+
hash: string;
|
|
669
|
+
id: string;
|
|
670
|
+
location?: string | undefined;
|
|
671
|
+
}>>;
|
|
672
|
+
/** Custom metadata fields */
|
|
673
|
+
metadata: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
674
|
+
}, "strip", z.ZodTypeAny, {
|
|
675
|
+
version: "1.0";
|
|
676
|
+
constraints: {
|
|
677
|
+
runtime: {
|
|
678
|
+
data_retention_days: number;
|
|
679
|
+
watermark_enabled: boolean;
|
|
680
|
+
logging_level: "errors" | "none" | "all";
|
|
681
|
+
pii_filter_enabled: boolean;
|
|
682
|
+
toxicity_filter_enabled: boolean;
|
|
683
|
+
kill_switch_enabled: boolean;
|
|
684
|
+
max_tokens_per_request?: number | undefined;
|
|
685
|
+
max_cost_per_day_usd?: number | undefined;
|
|
686
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
687
|
+
toxicity_threshold?: number | undefined;
|
|
688
|
+
};
|
|
689
|
+
build: {
|
|
690
|
+
require_golden_thread: boolean;
|
|
691
|
+
require_asset_card: boolean;
|
|
692
|
+
require_risk_classification: boolean;
|
|
693
|
+
require_model_card: boolean;
|
|
694
|
+
require_security_review: boolean;
|
|
695
|
+
block_on_failure: boolean;
|
|
696
|
+
generate_sarif: boolean;
|
|
697
|
+
allowed_environments: string[];
|
|
698
|
+
};
|
|
699
|
+
registry: {
|
|
700
|
+
allowed_vendor_ids: string[];
|
|
701
|
+
blocked_vendor_ids: string[];
|
|
702
|
+
allowed_region_codes: string[];
|
|
703
|
+
blocked_region_codes: string[];
|
|
704
|
+
allowed_model_patterns: string[];
|
|
705
|
+
blocked_model_patterns: string[];
|
|
706
|
+
max_model_parameters?: number | undefined;
|
|
707
|
+
};
|
|
708
|
+
};
|
|
709
|
+
expires_at: string;
|
|
710
|
+
generated_at: string;
|
|
711
|
+
generated_by: string;
|
|
712
|
+
policy_sources: {
|
|
713
|
+
type: "jira" | "url" | "pdf" | "confluence" | "manual";
|
|
714
|
+
id: string;
|
|
715
|
+
uri: string;
|
|
716
|
+
content_hash: string;
|
|
717
|
+
fetched_at: string;
|
|
718
|
+
version?: string | undefined;
|
|
719
|
+
title?: string | undefined;
|
|
720
|
+
}[];
|
|
721
|
+
signatures: {
|
|
722
|
+
signature: string;
|
|
723
|
+
algorithm: "RS256" | "ES256";
|
|
724
|
+
signer: string;
|
|
725
|
+
signed_at: string;
|
|
726
|
+
role?: string | undefined;
|
|
727
|
+
expires_at?: string | undefined;
|
|
728
|
+
key_id?: string | undefined;
|
|
729
|
+
certificate_chain?: string[] | undefined;
|
|
730
|
+
}[];
|
|
731
|
+
policy_hash: string;
|
|
732
|
+
generator_version: string;
|
|
733
|
+
name?: string | undefined;
|
|
734
|
+
organization?: string | undefined;
|
|
735
|
+
description?: string | undefined;
|
|
736
|
+
metadata?: Record<string, unknown> | undefined;
|
|
737
|
+
environment?: string | undefined;
|
|
738
|
+
air_reference?: {
|
|
739
|
+
hash: string;
|
|
740
|
+
id: string;
|
|
741
|
+
location?: string | undefined;
|
|
742
|
+
} | undefined;
|
|
743
|
+
}, {
|
|
744
|
+
version: "1.0";
|
|
745
|
+
expires_at: string;
|
|
746
|
+
generated_at: string;
|
|
747
|
+
policy_hash: string;
|
|
748
|
+
name?: string | undefined;
|
|
749
|
+
organization?: string | undefined;
|
|
750
|
+
description?: string | undefined;
|
|
751
|
+
metadata?: Record<string, unknown> | undefined;
|
|
752
|
+
constraints?: {
|
|
753
|
+
runtime?: {
|
|
754
|
+
data_retention_days?: number | undefined;
|
|
755
|
+
watermark_enabled?: boolean | undefined;
|
|
756
|
+
logging_level?: "errors" | "none" | "all" | undefined;
|
|
757
|
+
max_tokens_per_request?: number | undefined;
|
|
758
|
+
max_cost_per_day_usd?: number | undefined;
|
|
759
|
+
pii_filter_enabled?: boolean | undefined;
|
|
760
|
+
pii_filter_action?: "audit" | "block" | "redact" | "warn" | undefined;
|
|
761
|
+
toxicity_filter_enabled?: boolean | undefined;
|
|
762
|
+
toxicity_threshold?: number | undefined;
|
|
763
|
+
kill_switch_enabled?: boolean | undefined;
|
|
764
|
+
} | undefined;
|
|
765
|
+
build?: {
|
|
766
|
+
require_golden_thread?: boolean | undefined;
|
|
767
|
+
require_asset_card?: boolean | undefined;
|
|
768
|
+
require_risk_classification?: boolean | undefined;
|
|
769
|
+
require_model_card?: boolean | undefined;
|
|
770
|
+
require_security_review?: boolean | undefined;
|
|
771
|
+
block_on_failure?: boolean | undefined;
|
|
772
|
+
generate_sarif?: boolean | undefined;
|
|
773
|
+
allowed_environments?: string[] | undefined;
|
|
774
|
+
} | undefined;
|
|
775
|
+
registry?: {
|
|
776
|
+
max_model_parameters?: number | undefined;
|
|
777
|
+
allowed_vendor_ids?: string[] | undefined;
|
|
778
|
+
blocked_vendor_ids?: string[] | undefined;
|
|
779
|
+
allowed_region_codes?: string[] | undefined;
|
|
780
|
+
blocked_region_codes?: string[] | undefined;
|
|
781
|
+
allowed_model_patterns?: string[] | undefined;
|
|
782
|
+
blocked_model_patterns?: string[] | undefined;
|
|
783
|
+
} | undefined;
|
|
784
|
+
} | undefined;
|
|
785
|
+
generated_by?: string | undefined;
|
|
786
|
+
environment?: string | undefined;
|
|
787
|
+
policy_sources?: {
|
|
788
|
+
type: "jira" | "url" | "pdf" | "confluence" | "manual";
|
|
789
|
+
id: string;
|
|
790
|
+
uri: string;
|
|
791
|
+
content_hash: string;
|
|
792
|
+
fetched_at: string;
|
|
793
|
+
version?: string | undefined;
|
|
794
|
+
title?: string | undefined;
|
|
795
|
+
}[] | undefined;
|
|
796
|
+
signatures?: {
|
|
797
|
+
signature: string;
|
|
798
|
+
algorithm: "RS256" | "ES256";
|
|
799
|
+
signer: string;
|
|
800
|
+
signed_at: string;
|
|
801
|
+
role?: string | undefined;
|
|
802
|
+
expires_at?: string | undefined;
|
|
803
|
+
key_id?: string | undefined;
|
|
804
|
+
certificate_chain?: string[] | undefined;
|
|
805
|
+
}[] | undefined;
|
|
806
|
+
generator_version?: string | undefined;
|
|
807
|
+
air_reference?: {
|
|
808
|
+
hash: string;
|
|
809
|
+
id: string;
|
|
810
|
+
location?: string | undefined;
|
|
811
|
+
} | undefined;
|
|
812
|
+
}>;
|
|
813
|
+
type GovernanceLock = z.infer<typeof GovernanceLockSchema>;
|
|
814
|
+
interface GovernanceLockValidationResult {
|
|
815
|
+
/** Whether the lock file is valid */
|
|
816
|
+
valid: boolean;
|
|
817
|
+
/** Validation errors */
|
|
818
|
+
errors: string[];
|
|
819
|
+
/** Validation warnings */
|
|
820
|
+
warnings: string[];
|
|
821
|
+
/** Whether the lock file has expired */
|
|
822
|
+
expired: boolean;
|
|
823
|
+
/** Days until expiration (negative if expired) */
|
|
824
|
+
daysUntilExpiration: number;
|
|
825
|
+
/** Whether signatures are present */
|
|
826
|
+
signed: boolean;
|
|
827
|
+
/** Number of valid signatures */
|
|
828
|
+
validSignatureCount: number;
|
|
829
|
+
/** Whether policy hash is valid */
|
|
830
|
+
policyHashValid: boolean;
|
|
831
|
+
}
|
|
832
|
+
/**
|
|
833
|
+
* Computes SHA-256 hash of a string
|
|
834
|
+
*/
|
|
835
|
+
declare function computeHash(data: string): Promise<string>;
|
|
836
|
+
/**
|
|
837
|
+
* Creates a governance.lock from an AIR document
|
|
838
|
+
*/
|
|
839
|
+
declare function createGovernanceLock(air: AIR, options?: {
|
|
840
|
+
expiresInDays?: number;
|
|
841
|
+
name?: string;
|
|
842
|
+
description?: string;
|
|
843
|
+
organization?: string;
|
|
844
|
+
environment?: string;
|
|
845
|
+
}): Promise<GovernanceLock>;
|
|
846
|
+
/**
|
|
847
|
+
* Validates a governance.lock file
|
|
848
|
+
*/
|
|
849
|
+
declare function validateGovernanceLock(lock: unknown, options?: {
|
|
850
|
+
/** Whether to check expiration */
|
|
851
|
+
checkExpiration?: boolean;
|
|
852
|
+
/** Whether to require signatures */
|
|
853
|
+
requireSignatures?: boolean;
|
|
854
|
+
/** Expected policy hash (for integrity check) */
|
|
855
|
+
expectedPolicyHash?: string;
|
|
856
|
+
}): GovernanceLockValidationResult;
|
|
857
|
+
/**
|
|
858
|
+
* Parses a governance.lock file from YAML string
|
|
859
|
+
*/
|
|
860
|
+
declare function parseGovernanceLockYAML(content: string): GovernanceLock;
|
|
861
|
+
/**
|
|
862
|
+
* Parses a governance.lock file from JSON string
|
|
863
|
+
*/
|
|
864
|
+
declare function parseGovernanceLockJSON(content: string): GovernanceLock;
|
|
865
|
+
/**
|
|
866
|
+
* Serializes a governance.lock to YAML
|
|
867
|
+
*/
|
|
868
|
+
declare function serializeGovernanceLockYAML(lock: GovernanceLock): string;
|
|
869
|
+
/**
|
|
870
|
+
* Serializes a governance.lock to JSON
|
|
871
|
+
*/
|
|
872
|
+
declare function serializeGovernanceLockJSON(lock: GovernanceLock, pretty?: boolean): string;
|
|
873
|
+
/**
|
|
874
|
+
* Checks if a governance.lock file is expired
|
|
875
|
+
*/
|
|
876
|
+
declare function isGovernanceLockExpired(lock: GovernanceLock): boolean;
|
|
877
|
+
/**
|
|
878
|
+
* Gets the number of days until a governance.lock expires
|
|
879
|
+
*/
|
|
880
|
+
declare function getDaysUntilExpiration(lock: GovernanceLock): number;
|
|
881
|
+
/**
|
|
882
|
+
* Checks if a vendor is allowed by the governance.lock
|
|
883
|
+
*/
|
|
884
|
+
declare function isVendorAllowedByLock(vendorId: string, lock: GovernanceLock): boolean;
|
|
885
|
+
/**
|
|
886
|
+
* Checks if a model is allowed by the governance.lock
|
|
887
|
+
*/
|
|
888
|
+
declare function isModelAllowedByLock(modelId: string, lock: GovernanceLock): boolean;
|
|
889
|
+
/**
|
|
890
|
+
* Checks if a region is allowed by the governance.lock
|
|
891
|
+
*/
|
|
892
|
+
declare function isRegionAllowedByLock(regionCode: string, lock: GovernanceLock): boolean;
|
|
893
|
+
/**
|
|
894
|
+
* Creates a canonical string for signing
|
|
895
|
+
*/
|
|
896
|
+
declare function createSigningPayload(lock: GovernanceLock): string;
|
|
897
|
+
/**
|
|
898
|
+
* Adds a signature to a governance.lock
|
|
899
|
+
* Note: Actual cryptographic signing is delegated to external libraries
|
|
900
|
+
*/
|
|
901
|
+
declare function addSignature(lock: GovernanceLock, signature: GovernanceLockSignature): GovernanceLock;
|
|
902
|
+
|
|
903
|
+
export { type GovernanceLock, type GovernanceLockBuildConstraints, GovernanceLockBuildConstraintsSchema, type GovernanceLockConstraints, GovernanceLockConstraintsSchema, type GovernanceLockPolicySource, GovernanceLockPolicySourceSchema, type GovernanceLockRegistryConstraints, GovernanceLockRegistryConstraintsSchema, type GovernanceLockRuntimeConstraints, GovernanceLockRuntimeConstraintsSchema, GovernanceLockSchema, type GovernanceLockSignature, GovernanceLockSignatureSchema, type GovernanceLockValidationResult, addSignature, computeHash, createGovernanceLock, createSigningPayload, getDaysUntilExpiration, isGovernanceLockExpired, isModelAllowedByLock, isRegionAllowedByLock, isVendorAllowedByLock, parseGovernanceLockJSON, parseGovernanceLockYAML, serializeGovernanceLockJSON, serializeGovernanceLockYAML, validateGovernanceLock };
|