@clawbureau/clawverify-core 0.1.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/LICENSE +21 -0
- package/README.md +40 -0
- package/dist/crypto.d.ts +27 -0
- package/dist/crypto.d.ts.map +1 -0
- package/dist/crypto.js +124 -0
- package/dist/crypto.js.map +1 -0
- package/dist/index.d.ts +27 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/jcs.d.ts +13 -0
- package/dist/jcs.d.ts.map +1 -0
- package/dist/jcs.js +43 -0
- package/dist/jcs.js.map +1 -0
- package/dist/model-identity.d.ts +46 -0
- package/dist/model-identity.d.ts.map +1 -0
- package/dist/model-identity.js +233 -0
- package/dist/model-identity.js.map +1 -0
- package/dist/schema-registry.d.ts +99 -0
- package/dist/schema-registry.d.ts.map +1 -0
- package/dist/schema-registry.js +259 -0
- package/dist/schema-registry.js.map +1 -0
- package/dist/schema-validation.d.ts +35 -0
- package/dist/schema-validation.d.ts.map +1 -0
- package/dist/schema-validation.js +156 -0
- package/dist/schema-validation.js.map +1 -0
- package/dist/schema-validators.generated.d.ts +158 -0
- package/dist/schema-validators.generated.d.ts.map +1 -0
- package/dist/schema-validators.generated.js +19186 -0
- package/dist/schema-validators.generated.js.map +1 -0
- package/dist/types.d.ts +910 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +33 -0
- package/dist/types.js.map +1 -0
- package/dist/verify-audit-result-attestation.d.ts +32 -0
- package/dist/verify-audit-result-attestation.d.ts.map +1 -0
- package/dist/verify-audit-result-attestation.js +396 -0
- package/dist/verify-audit-result-attestation.js.map +1 -0
- package/dist/verify-derivation-attestation.d.ts +30 -0
- package/dist/verify-derivation-attestation.d.ts.map +1 -0
- package/dist/verify-derivation-attestation.js +371 -0
- package/dist/verify-derivation-attestation.js.map +1 -0
- package/dist/verify-execution-attestation.d.ts +32 -0
- package/dist/verify-execution-attestation.d.ts.map +1 -0
- package/dist/verify-execution-attestation.js +578 -0
- package/dist/verify-execution-attestation.js.map +1 -0
- package/dist/verify-export-bundle.d.ts +14 -0
- package/dist/verify-export-bundle.d.ts.map +1 -0
- package/dist/verify-export-bundle.js +307 -0
- package/dist/verify-export-bundle.js.map +1 -0
- package/dist/verify-log-inclusion-proof.d.ts +16 -0
- package/dist/verify-log-inclusion-proof.d.ts.map +1 -0
- package/dist/verify-log-inclusion-proof.js +216 -0
- package/dist/verify-log-inclusion-proof.js.map +1 -0
- package/dist/verify-proof-bundle.d.ts +48 -0
- package/dist/verify-proof-bundle.d.ts.map +1 -0
- package/dist/verify-proof-bundle.js +1708 -0
- package/dist/verify-proof-bundle.js.map +1 -0
- package/dist/verify-receipt.d.ts +30 -0
- package/dist/verify-receipt.d.ts.map +1 -0
- package/dist/verify-receipt.js +408 -0
- package/dist/verify-receipt.js.map +1 -0
- package/dist/verify-web-receipt.d.ts +21 -0
- package/dist/verify-web-receipt.d.ts.map +1 -0
- package/dist/verify-web-receipt.js +341 -0
- package/dist/verify-web-receipt.js.map +1 -0
- package/package.json +54 -0
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,910 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Clawverify Types
|
|
3
|
+
* Core types for the verification API
|
|
4
|
+
*/
|
|
5
|
+
export declare const ENVELOPE_VERSIONS: readonly ["1"];
|
|
6
|
+
export type EnvelopeVersion = (typeof ENVELOPE_VERSIONS)[number];
|
|
7
|
+
export declare const ENVELOPE_TYPES: readonly ["artifact_signature", "message_signature", "gateway_receipt", "web_receipt", "proof_bundle", "event_chain", "owner_attestation", "commit_proof", "execution_attestation", "derivation_attestation", "audit_result_attestation", "export_bundle", "scoped_token"];
|
|
8
|
+
export type EnvelopeType = (typeof ENVELOPE_TYPES)[number];
|
|
9
|
+
/**
|
|
10
|
+
* CVF-US-012: One-call agent verification
|
|
11
|
+
*/
|
|
12
|
+
export interface VerifyAgentRequest {
|
|
13
|
+
agent_did: string;
|
|
14
|
+
owner_attestation_envelope?: SignedEnvelope<OwnerAttestationPayload>;
|
|
15
|
+
proof_bundle_envelope?: SignedEnvelope<ProofBundlePayload>;
|
|
16
|
+
/** Optional materialized URM document for the provided proof_bundle_envelope (POH-US-015). */
|
|
17
|
+
urm?: URMDocument;
|
|
18
|
+
/** Optional execution attestations (CEA-US-010). */
|
|
19
|
+
execution_attestations?: SignedEnvelope<ExecutionAttestationPayload>[];
|
|
20
|
+
/**
|
|
21
|
+
* Optional DID rotation certificates.
|
|
22
|
+
*
|
|
23
|
+
* When present, clawverify may accept proof components (owner attestations / bundles)
|
|
24
|
+
* whose subject DID is an *older* DID that rotates forward to agent_did.
|
|
25
|
+
*
|
|
26
|
+
* Fail-closed rule: if any certificate is provided, it MUST verify.
|
|
27
|
+
*/
|
|
28
|
+
did_rotation_certificates?: DidRotationCertificate[];
|
|
29
|
+
/** Optional Work Policy Contract hash. If provided, receipts must match this policy hash. */
|
|
30
|
+
policy_hash?: string;
|
|
31
|
+
}
|
|
32
|
+
export interface PolicyComplianceResult {
|
|
33
|
+
policy_hash: string;
|
|
34
|
+
compliant: boolean;
|
|
35
|
+
reason: string;
|
|
36
|
+
}
|
|
37
|
+
export interface VerifyAgentResponse {
|
|
38
|
+
result: VerificationResult;
|
|
39
|
+
agent_did: string;
|
|
40
|
+
did_valid: boolean;
|
|
41
|
+
owner_status: OwnerAttestationStatus;
|
|
42
|
+
trust_tier: TrustTier;
|
|
43
|
+
proof_tier: ProofTier;
|
|
44
|
+
poh_tier: number;
|
|
45
|
+
model_identity_tier?: ModelIdentityTier;
|
|
46
|
+
policy_compliance?: PolicyComplianceResult;
|
|
47
|
+
risk_flags?: string[];
|
|
48
|
+
components?: {
|
|
49
|
+
owner_attestation?: {
|
|
50
|
+
result: VerificationResult;
|
|
51
|
+
owner_status?: OwnerAttestationStatus;
|
|
52
|
+
error?: VerificationError;
|
|
53
|
+
};
|
|
54
|
+
proof_bundle?: {
|
|
55
|
+
status: VerificationStatus;
|
|
56
|
+
reason: string;
|
|
57
|
+
trust_tier?: TrustTier;
|
|
58
|
+
proof_tier?: ProofTier;
|
|
59
|
+
model_identity_tier?: ModelIdentityTier;
|
|
60
|
+
error?: VerificationError;
|
|
61
|
+
};
|
|
62
|
+
execution_attestation?: {
|
|
63
|
+
status: VerificationStatus;
|
|
64
|
+
reason: string;
|
|
65
|
+
verified_count?: number;
|
|
66
|
+
proof_tier?: ProofTier;
|
|
67
|
+
error?: VerificationError;
|
|
68
|
+
};
|
|
69
|
+
};
|
|
70
|
+
error?: VerificationError;
|
|
71
|
+
}
|
|
72
|
+
export declare const ALGORITHMS: readonly ["Ed25519"];
|
|
73
|
+
export type Algorithm = (typeof ALGORITHMS)[number];
|
|
74
|
+
export declare const HASH_ALGORITHMS: readonly ["SHA-256", "BLAKE3"];
|
|
75
|
+
export type HashAlgorithm = (typeof HASH_ALGORITHMS)[number];
|
|
76
|
+
/**
|
|
77
|
+
* Signed envelope wrapper - common structure for all signed payloads
|
|
78
|
+
*/
|
|
79
|
+
export interface SignedEnvelope<T = unknown> {
|
|
80
|
+
envelope_version: EnvelopeVersion;
|
|
81
|
+
envelope_type: EnvelopeType;
|
|
82
|
+
payload: T;
|
|
83
|
+
payload_hash_b64u: string;
|
|
84
|
+
hash_algorithm: HashAlgorithm;
|
|
85
|
+
signature_b64u: string;
|
|
86
|
+
algorithm: Algorithm;
|
|
87
|
+
signer_did: string;
|
|
88
|
+
issued_at: string;
|
|
89
|
+
}
|
|
90
|
+
/**
|
|
91
|
+
* Artifact payload - represents a signed work artifact
|
|
92
|
+
*/
|
|
93
|
+
export interface ArtifactPayload {
|
|
94
|
+
artifact_version: '1';
|
|
95
|
+
artifact_id: string;
|
|
96
|
+
artifact_type: string;
|
|
97
|
+
content_hash_b64u: string;
|
|
98
|
+
content_type: string;
|
|
99
|
+
content_size_bytes: number;
|
|
100
|
+
metadata?: Record<string, unknown>;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Message payload - represents a signed message for DID binding
|
|
104
|
+
* Used to cryptographically bind a DID to an account or prove ownership
|
|
105
|
+
*/
|
|
106
|
+
export interface MessagePayload {
|
|
107
|
+
message_version: '1';
|
|
108
|
+
message_type: 'account_binding' | 'ownership_proof' | 'challenge_response';
|
|
109
|
+
message: string;
|
|
110
|
+
nonce: string;
|
|
111
|
+
audience?: string;
|
|
112
|
+
expires_at?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Receipt binding fields — tie a gateway receipt to a specific run, event, and idempotency scope.
|
|
116
|
+
* Mirrors the receipt_binding.v1.json schema.
|
|
117
|
+
* Harnesses attach these via HTTP headers when routing LLM calls through clawproxy:
|
|
118
|
+
* X-Run-Id, X-Event-Hash, X-Idempotency-Key
|
|
119
|
+
*/
|
|
120
|
+
export interface ReceiptBinding {
|
|
121
|
+
/** Run ID correlating this receipt to an agent run (from X-Run-Id header) */
|
|
122
|
+
run_id?: string;
|
|
123
|
+
/** Event hash linking this receipt to an event chain entry (from X-Event-Hash header) */
|
|
124
|
+
event_hash_b64u?: string;
|
|
125
|
+
/** Idempotency nonce preventing duplicate receipt issuance (from X-Idempotency-Key header) */
|
|
126
|
+
nonce?: string;
|
|
127
|
+
/** Work Policy Contract hash injected by the proxy */
|
|
128
|
+
policy_hash?: string;
|
|
129
|
+
/** CST token scope hash injected by the proxy */
|
|
130
|
+
token_scope_hash_b64u?: string;
|
|
131
|
+
}
|
|
132
|
+
/**
|
|
133
|
+
* Harness metadata identifying the runtime that produced a proof bundle or receipt.
|
|
134
|
+
* Matches the harness object in urm.v1.json and proof_bundle.v1.json metadata.
|
|
135
|
+
*/
|
|
136
|
+
export interface HarnessMetadata {
|
|
137
|
+
/** Harness identifier (e.g. openclaw, pi, claude-code, codex, opencode, factory-droid, script) */
|
|
138
|
+
id: string;
|
|
139
|
+
/** Harness version string */
|
|
140
|
+
version: string;
|
|
141
|
+
/** Execution environment (host, docker, clawea, tee) */
|
|
142
|
+
runtime?: string;
|
|
143
|
+
/** SHA-256 hash of the harness config inputs (base64url, no padding) */
|
|
144
|
+
config_hash_b64u?: string;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Gateway receipt payload - represents a proxy receipt for proof-of-harness
|
|
148
|
+
* Used by marketplaces to validate that requests were routed through a trusted gateway
|
|
149
|
+
*/
|
|
150
|
+
export interface GatewayReceiptPayload {
|
|
151
|
+
receipt_version: '1';
|
|
152
|
+
receipt_id: string;
|
|
153
|
+
gateway_id: string;
|
|
154
|
+
provider: string;
|
|
155
|
+
model: string;
|
|
156
|
+
request_hash_b64u: string;
|
|
157
|
+
response_hash_b64u: string;
|
|
158
|
+
tokens_input: number;
|
|
159
|
+
tokens_output: number;
|
|
160
|
+
latency_ms: number;
|
|
161
|
+
timestamp: string;
|
|
162
|
+
/** Binding fields tying this receipt to a run/event (set by clawproxy from headers) */
|
|
163
|
+
binding?: ReceiptBinding;
|
|
164
|
+
metadata?: Record<string, unknown>;
|
|
165
|
+
}
|
|
166
|
+
/**
|
|
167
|
+
* Verification result
|
|
168
|
+
*/
|
|
169
|
+
export type VerificationStatus = 'VALID' | 'INVALID';
|
|
170
|
+
export interface VerificationResult {
|
|
171
|
+
status: VerificationStatus;
|
|
172
|
+
reason: string;
|
|
173
|
+
envelope_type?: EnvelopeType;
|
|
174
|
+
signer_did?: string;
|
|
175
|
+
verified_at: string;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Verification error codes for fail-closed behavior
|
|
179
|
+
*/
|
|
180
|
+
export type VerificationErrorCode = 'UNKNOWN_ENVELOPE_VERSION' | 'UNKNOWN_ENVELOPE_TYPE' | 'UNKNOWN_ALGORITHM' | 'UNKNOWN_HASH_ALGORITHM' | 'HASH_MISMATCH' | 'URM_MISSING' | 'URM_MISMATCH' | 'PROMPT_COMMITMENT_MISMATCH' | 'SIGNATURE_INVALID' | 'MALFORMED_ENVELOPE' | 'SCHEMA_VALIDATION_FAILED' | 'MISSING_REQUIRED_FIELD' | 'INVALID_DID_FORMAT' | 'EXPIRED' | 'CLAIM_NOT_FOUND' | 'DEPENDENCY_NOT_CONFIGURED' | 'PARSE_ERROR' | 'INCLUSION_PROOF_INVALID' | 'REVOKED' | 'CONTROL_CHAIN_NOT_FOUND' | 'CONTROL_CHAIN_CONTEXT_MISMATCH' | 'TOKEN_CONTROL_SCOPE_HASH_MISMATCH' | 'TOKEN_CONTROL_AUDIENCE_MISMATCH' | 'TOKEN_CONTROL_SCOPE_MISSING' | 'TOKEN_CONTROL_TRANSITION_FORBIDDEN' | 'TOKEN_CONTROL_CHAIN_MISSING' | 'TOKEN_CONTROL_SUBJECT_MISMATCH' | 'TOKEN_CONTROL_KEY_UNKNOWN' | 'TOKEN_CONTROL_KEY_EXPIRED' | 'TOKEN_CONTROL_TRANSPARENCY_STALE' | 'TOKEN_CONTROL_TRANSPARENCY_KID_UNKNOWN' | 'TOKEN_CONTROL_TRANSPARENCY_KID_EXPIRED' | 'UNKNOWN_VERSION' | 'PROOF_BUNDLE_AGENT_MISMATCH';
|
|
181
|
+
/**
|
|
182
|
+
* Structured error for verification failures
|
|
183
|
+
*/
|
|
184
|
+
export interface VerificationError {
|
|
185
|
+
code: VerificationErrorCode;
|
|
186
|
+
message: string;
|
|
187
|
+
field?: string;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* API request/response types
|
|
191
|
+
*/
|
|
192
|
+
export interface VerifyArtifactRequest {
|
|
193
|
+
envelope: SignedEnvelope<ArtifactPayload>;
|
|
194
|
+
}
|
|
195
|
+
export interface VerifyArtifactResponse {
|
|
196
|
+
result: VerificationResult;
|
|
197
|
+
error?: VerificationError;
|
|
198
|
+
}
|
|
199
|
+
export interface VerifyMessageRequest {
|
|
200
|
+
envelope: SignedEnvelope<MessagePayload>;
|
|
201
|
+
}
|
|
202
|
+
export interface VerifyMessageResponse {
|
|
203
|
+
result: VerificationResult;
|
|
204
|
+
signer_did?: string;
|
|
205
|
+
error?: VerificationError;
|
|
206
|
+
}
|
|
207
|
+
export interface VerifyReceiptRequest {
|
|
208
|
+
envelope: SignedEnvelope<GatewayReceiptPayload>;
|
|
209
|
+
}
|
|
210
|
+
export interface VerifyReceiptResponse {
|
|
211
|
+
result: VerificationResult;
|
|
212
|
+
provider?: string;
|
|
213
|
+
model?: string;
|
|
214
|
+
gateway_id?: string;
|
|
215
|
+
model_identity_tier?: ModelIdentityTier;
|
|
216
|
+
risk_flags?: string[];
|
|
217
|
+
error?: VerificationError;
|
|
218
|
+
}
|
|
219
|
+
/**
|
|
220
|
+
* Witnessed web receipt types
|
|
221
|
+
* POH-US-018: Verify witnessed-web receipts (distinct from gateway API receipts)
|
|
222
|
+
*/
|
|
223
|
+
export interface WebReceiptPayload {
|
|
224
|
+
receipt_version: '1';
|
|
225
|
+
receipt_id: string;
|
|
226
|
+
witness_id: string;
|
|
227
|
+
source: 'chatgpt_web' | 'claude_web' | 'gemini_web' | 'other';
|
|
228
|
+
request_hash_b64u: string;
|
|
229
|
+
response_hash_b64u: string;
|
|
230
|
+
session_hash_b64u?: string;
|
|
231
|
+
timestamp: string;
|
|
232
|
+
binding?: ReceiptBinding;
|
|
233
|
+
metadata?: Record<string, unknown>;
|
|
234
|
+
}
|
|
235
|
+
export interface VerifyWebReceiptRequest {
|
|
236
|
+
envelope: SignedEnvelope<WebReceiptPayload>;
|
|
237
|
+
}
|
|
238
|
+
export interface VerifyWebReceiptResponse {
|
|
239
|
+
result: VerificationResult;
|
|
240
|
+
witness_id?: string;
|
|
241
|
+
source?: WebReceiptPayload['source'];
|
|
242
|
+
proof_tier?: ProofTier;
|
|
243
|
+
equivalent_to_gateway?: boolean;
|
|
244
|
+
error?: VerificationError;
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Derivation Attestation types
|
|
248
|
+
* CVF-US-017: Verify derivation attestations
|
|
249
|
+
*/
|
|
250
|
+
export interface DerivationAttestationPayload {
|
|
251
|
+
derivation_version: '1';
|
|
252
|
+
derivation_id: string;
|
|
253
|
+
issued_at: string;
|
|
254
|
+
input_model: unknown;
|
|
255
|
+
output_model: unknown;
|
|
256
|
+
transform: {
|
|
257
|
+
kind: string;
|
|
258
|
+
code_hash_b64u?: string;
|
|
259
|
+
params_hash_b64u?: string;
|
|
260
|
+
build_steps?: string[];
|
|
261
|
+
};
|
|
262
|
+
artifacts?: unknown[];
|
|
263
|
+
execution?: Record<string, unknown>;
|
|
264
|
+
clawlogs?: Record<string, unknown>;
|
|
265
|
+
metadata?: Record<string, unknown>;
|
|
266
|
+
}
|
|
267
|
+
export interface VerifyDerivationAttestationRequest {
|
|
268
|
+
envelope: SignedEnvelope<DerivationAttestationPayload>;
|
|
269
|
+
}
|
|
270
|
+
export interface VerifyDerivationAttestationResponse {
|
|
271
|
+
result: VerificationResult;
|
|
272
|
+
derivation_id?: string;
|
|
273
|
+
transform_kind?: string;
|
|
274
|
+
input_model?: {
|
|
275
|
+
provider?: string;
|
|
276
|
+
name?: string;
|
|
277
|
+
tier?: ModelIdentityTier;
|
|
278
|
+
};
|
|
279
|
+
output_model?: {
|
|
280
|
+
provider?: string;
|
|
281
|
+
name?: string;
|
|
282
|
+
tier?: ModelIdentityTier;
|
|
283
|
+
};
|
|
284
|
+
clawlogs_inclusion_proof_validated?: boolean;
|
|
285
|
+
error?: VerificationError;
|
|
286
|
+
}
|
|
287
|
+
/**
|
|
288
|
+
* Audit Result Attestation types
|
|
289
|
+
* CVF-US-018: Verify audit result attestations
|
|
290
|
+
*/
|
|
291
|
+
export interface AuditResultAttestationPayload {
|
|
292
|
+
audit_version: '1';
|
|
293
|
+
audit_id: string;
|
|
294
|
+
issued_at: string;
|
|
295
|
+
expires_at?: string;
|
|
296
|
+
audit_pack?: {
|
|
297
|
+
pack_id?: string;
|
|
298
|
+
pack_version?: string;
|
|
299
|
+
pack_hash_b64u: string;
|
|
300
|
+
};
|
|
301
|
+
model: unknown;
|
|
302
|
+
derivation_attestation_hash_b64u?: string;
|
|
303
|
+
audit_code: {
|
|
304
|
+
repo_uri?: string;
|
|
305
|
+
commit_sha?: string;
|
|
306
|
+
code_hash_b64u: string;
|
|
307
|
+
uri?: string;
|
|
308
|
+
};
|
|
309
|
+
dataset: {
|
|
310
|
+
dataset_id: string;
|
|
311
|
+
dataset_hash_b64u: string;
|
|
312
|
+
access: 'public' | 'confidential';
|
|
313
|
+
uri?: string;
|
|
314
|
+
};
|
|
315
|
+
protocol: {
|
|
316
|
+
name: string;
|
|
317
|
+
config_hash_b64u: string;
|
|
318
|
+
seed?: number;
|
|
319
|
+
};
|
|
320
|
+
result: {
|
|
321
|
+
status: 'pass' | 'fail' | 'warn';
|
|
322
|
+
results_hash_b64u: string;
|
|
323
|
+
summary?: Record<string, unknown>;
|
|
324
|
+
};
|
|
325
|
+
execution?: Record<string, unknown>;
|
|
326
|
+
clawlogs?: Record<string, unknown>;
|
|
327
|
+
metadata?: Record<string, unknown>;
|
|
328
|
+
}
|
|
329
|
+
export interface VerifyAuditResultAttestationRequest {
|
|
330
|
+
envelope: SignedEnvelope<AuditResultAttestationPayload>;
|
|
331
|
+
}
|
|
332
|
+
export interface VerifyAuditResultAttestationResponse {
|
|
333
|
+
result: VerificationResult;
|
|
334
|
+
audit_id?: string;
|
|
335
|
+
audit_pack_hash_b64u?: string;
|
|
336
|
+
model?: {
|
|
337
|
+
provider?: string;
|
|
338
|
+
name?: string;
|
|
339
|
+
tier?: ModelIdentityTier;
|
|
340
|
+
};
|
|
341
|
+
audit_code_hash_b64u?: string;
|
|
342
|
+
dataset_id?: string;
|
|
343
|
+
dataset_hash_b64u?: string;
|
|
344
|
+
protocol_name?: string;
|
|
345
|
+
protocol_config_hash_b64u?: string;
|
|
346
|
+
result_status?: string;
|
|
347
|
+
results_hash_b64u?: string;
|
|
348
|
+
clawlogs_inclusion_proof_validated?: boolean;
|
|
349
|
+
error?: VerificationError;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Owner Attestation types
|
|
353
|
+
* CVF-US-010: Verify owner attestations
|
|
354
|
+
*/
|
|
355
|
+
export interface OwnerAttestationPayload {
|
|
356
|
+
attestation_version: '1';
|
|
357
|
+
attestation_id: string;
|
|
358
|
+
subject_did: string;
|
|
359
|
+
provider_ref?: string;
|
|
360
|
+
expires_at?: string;
|
|
361
|
+
}
|
|
362
|
+
export type OwnerAttestationStatus = 'verified' | 'expired' | 'unknown';
|
|
363
|
+
export interface VerifyOwnerAttestationRequest {
|
|
364
|
+
envelope: SignedEnvelope<OwnerAttestationPayload>;
|
|
365
|
+
}
|
|
366
|
+
export interface VerifyOwnerAttestationResponse {
|
|
367
|
+
result: VerificationResult;
|
|
368
|
+
owner_status?: OwnerAttestationStatus;
|
|
369
|
+
attestation_id?: string;
|
|
370
|
+
subject_did?: string;
|
|
371
|
+
provider_ref?: string;
|
|
372
|
+
expires_at?: string;
|
|
373
|
+
error?: VerificationError;
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Execution Attestation types
|
|
377
|
+
* CEA-US-010: Sandbox execution attestation verification
|
|
378
|
+
*/
|
|
379
|
+
export interface ExecutionAttestationPayload {
|
|
380
|
+
attestation_version: '1';
|
|
381
|
+
attestation_id: string;
|
|
382
|
+
execution_type: 'sandbox_execution' | 'tee_execution';
|
|
383
|
+
agent_did: string;
|
|
384
|
+
attester_did: string;
|
|
385
|
+
run_id?: string;
|
|
386
|
+
proof_bundle_hash_b64u?: string;
|
|
387
|
+
harness?: {
|
|
388
|
+
id?: string;
|
|
389
|
+
version?: string;
|
|
390
|
+
runtime?: string;
|
|
391
|
+
config_hash_b64u?: string;
|
|
392
|
+
};
|
|
393
|
+
runtime_metadata?: {
|
|
394
|
+
tee?: {
|
|
395
|
+
attestation_type: 'sgx_quote' | 'tdx_quote' | 'sev_snp_report' | 'nitro_attestation_doc' | 'generic_tee';
|
|
396
|
+
root_id: string;
|
|
397
|
+
tcb_version: string;
|
|
398
|
+
evidence_ref: {
|
|
399
|
+
resource_type: string;
|
|
400
|
+
resource_hash_b64u: string;
|
|
401
|
+
uri?: string;
|
|
402
|
+
};
|
|
403
|
+
measurements: {
|
|
404
|
+
measurement_hash_b64u: string;
|
|
405
|
+
runtime_digest_b64u?: string;
|
|
406
|
+
kernel_digest_b64u?: string;
|
|
407
|
+
};
|
|
408
|
+
tcb?: {
|
|
409
|
+
status?: 'up_to_date' | 'out_of_date' | 'configuration_needed' | 'revoked' | 'unknown';
|
|
410
|
+
advisory_ids?: string[];
|
|
411
|
+
};
|
|
412
|
+
metadata?: Record<string, unknown>;
|
|
413
|
+
};
|
|
414
|
+
[key: string]: unknown;
|
|
415
|
+
};
|
|
416
|
+
issued_at: string;
|
|
417
|
+
expires_at?: string;
|
|
418
|
+
metadata?: Record<string, unknown>;
|
|
419
|
+
}
|
|
420
|
+
export interface VerifyExecutionAttestationRequest {
|
|
421
|
+
envelope: SignedEnvelope<ExecutionAttestationPayload>;
|
|
422
|
+
}
|
|
423
|
+
export interface VerifyExecutionAttestationResponse {
|
|
424
|
+
result: VerificationResult;
|
|
425
|
+
attestation_id?: string;
|
|
426
|
+
execution_type?: ExecutionAttestationPayload['execution_type'];
|
|
427
|
+
agent_did?: string;
|
|
428
|
+
attester_did?: string;
|
|
429
|
+
run_id?: string;
|
|
430
|
+
proof_bundle_hash_b64u?: string;
|
|
431
|
+
signer_did?: string;
|
|
432
|
+
allowlisted?: boolean;
|
|
433
|
+
tee_root_id?: string;
|
|
434
|
+
tee_tcb_version?: string;
|
|
435
|
+
error?: VerificationError;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* DID Rotation Certificate types
|
|
439
|
+
* CVF-US-016: Verify DID rotation certificates
|
|
440
|
+
*/
|
|
441
|
+
export interface DidRotationCertificate {
|
|
442
|
+
rotation_version: '1';
|
|
443
|
+
rotation_id: string;
|
|
444
|
+
old_did: string;
|
|
445
|
+
new_did: string;
|
|
446
|
+
issued_at: string;
|
|
447
|
+
reason: string;
|
|
448
|
+
signature_old_b64u: string;
|
|
449
|
+
signature_new_b64u: string;
|
|
450
|
+
metadata?: Record<string, unknown>;
|
|
451
|
+
}
|
|
452
|
+
export interface VerifyDidRotationRequest {
|
|
453
|
+
certificate: DidRotationCertificate;
|
|
454
|
+
}
|
|
455
|
+
export interface VerifyDidRotationResponse {
|
|
456
|
+
result: VerificationResult;
|
|
457
|
+
rotation_id?: string;
|
|
458
|
+
old_did?: string;
|
|
459
|
+
new_did?: string;
|
|
460
|
+
issued_at?: string;
|
|
461
|
+
reason?: string;
|
|
462
|
+
error?: VerificationError;
|
|
463
|
+
}
|
|
464
|
+
/**
|
|
465
|
+
* Commit Proof types
|
|
466
|
+
* CVF-US-011: Verify commit proofs
|
|
467
|
+
*/
|
|
468
|
+
export interface CommitProofPayload {
|
|
469
|
+
proof_version: '1';
|
|
470
|
+
repo_claim_id: string;
|
|
471
|
+
commit_sha: string;
|
|
472
|
+
repository: string;
|
|
473
|
+
branch?: string;
|
|
474
|
+
}
|
|
475
|
+
export interface VerifyCommitProofRequest {
|
|
476
|
+
envelope: SignedEnvelope<CommitProofPayload>;
|
|
477
|
+
}
|
|
478
|
+
export interface VerifyCommitProofResponse {
|
|
479
|
+
result: VerificationResult;
|
|
480
|
+
repository?: string;
|
|
481
|
+
commit_sha?: string;
|
|
482
|
+
signer_did?: string;
|
|
483
|
+
repo_claim_id?: string;
|
|
484
|
+
error?: VerificationError;
|
|
485
|
+
}
|
|
486
|
+
/**
|
|
487
|
+
* Scoped Token types
|
|
488
|
+
* CVF-US-013: Scoped token introspection
|
|
489
|
+
*/
|
|
490
|
+
export interface ScopedTokenPayload {
|
|
491
|
+
token_version: '1';
|
|
492
|
+
token_id: string;
|
|
493
|
+
scope: string[];
|
|
494
|
+
audience: string;
|
|
495
|
+
owner_ref?: string;
|
|
496
|
+
expires_at: string;
|
|
497
|
+
}
|
|
498
|
+
export interface IntrospectScopedTokenRequest {
|
|
499
|
+
envelope: SignedEnvelope<ScopedTokenPayload>;
|
|
500
|
+
}
|
|
501
|
+
export interface IntrospectScopedTokenResponse {
|
|
502
|
+
result: VerificationResult;
|
|
503
|
+
token_id?: string;
|
|
504
|
+
token_hash_b64u?: string;
|
|
505
|
+
scope?: string[];
|
|
506
|
+
audience?: string;
|
|
507
|
+
owner_ref?: string;
|
|
508
|
+
expires_at?: string;
|
|
509
|
+
error?: VerificationError;
|
|
510
|
+
}
|
|
511
|
+
/**
|
|
512
|
+
* Identity control-plane verification hints
|
|
513
|
+
* CVF-US-018: deterministic remediation guidance
|
|
514
|
+
*/
|
|
515
|
+
export type RemediationHintCode = 'REGISTER_OWNER_BINDING' | 'REGISTER_CONTROLLER' | 'REGISTER_AGENT_UNDER_CONTROLLER' | 'UPDATE_SENSITIVE_POLICY' | 'USE_CANONICAL_CST_LANE' | 'REQUEST_REQUIRED_SCOPE' | 'REQUEST_REQUIRED_AUDIENCE' | 'REISSUE_TOKEN' | 'ROTATE_KEYS_WITH_OVERLAP' | 'SYNC_REVOCATION_STREAM' | 'CHECK_CONTROL_CHAIN_CONFIG';
|
|
516
|
+
export interface RemediationHint {
|
|
517
|
+
code: RemediationHintCode;
|
|
518
|
+
message: string;
|
|
519
|
+
action: string;
|
|
520
|
+
}
|
|
521
|
+
export interface VerifyControlChainRequest {
|
|
522
|
+
owner_did: string;
|
|
523
|
+
controller_did: string;
|
|
524
|
+
agent_did: string;
|
|
525
|
+
}
|
|
526
|
+
export interface VerifyControlChainResponse {
|
|
527
|
+
result: VerificationResult;
|
|
528
|
+
owner_did: string;
|
|
529
|
+
controller_did: string;
|
|
530
|
+
agent_did: string;
|
|
531
|
+
chain_active: boolean;
|
|
532
|
+
policy_hash_b64u?: string;
|
|
533
|
+
remediation_hints?: RemediationHint[];
|
|
534
|
+
error?: VerificationError;
|
|
535
|
+
}
|
|
536
|
+
export interface VerifyTokenControlRequest {
|
|
537
|
+
token: string;
|
|
538
|
+
expected_owner_did?: string;
|
|
539
|
+
expected_controller_did?: string;
|
|
540
|
+
expected_agent_did?: string;
|
|
541
|
+
required_audience?: string | string[];
|
|
542
|
+
required_scope?: string[];
|
|
543
|
+
required_transitions?: string[];
|
|
544
|
+
}
|
|
545
|
+
export interface VerifyTokenControlResponse {
|
|
546
|
+
result: VerificationResult;
|
|
547
|
+
token_hash?: string;
|
|
548
|
+
active?: boolean;
|
|
549
|
+
revoked?: boolean;
|
|
550
|
+
token_lane?: 'legacy' | 'canonical';
|
|
551
|
+
owner_did?: string;
|
|
552
|
+
controller_did?: string;
|
|
553
|
+
agent_did?: string;
|
|
554
|
+
aud?: string | string[];
|
|
555
|
+
scope?: string[];
|
|
556
|
+
token_scope_hash_b64u?: string;
|
|
557
|
+
transition_matrix?: Record<string, {
|
|
558
|
+
allowed: boolean;
|
|
559
|
+
reason_code: string;
|
|
560
|
+
reason: string;
|
|
561
|
+
}>;
|
|
562
|
+
transparency_snapshot?: {
|
|
563
|
+
snapshot_id?: string;
|
|
564
|
+
generated_at?: number;
|
|
565
|
+
generated_at_iso?: string;
|
|
566
|
+
active_kid?: string;
|
|
567
|
+
accepted_kids?: string[];
|
|
568
|
+
kid_observed?: string;
|
|
569
|
+
};
|
|
570
|
+
remediation_hints?: RemediationHint[];
|
|
571
|
+
error?: VerificationError;
|
|
572
|
+
}
|
|
573
|
+
/**
|
|
574
|
+
* Batch verification types
|
|
575
|
+
* CVF-US-004: Batch verification for scale verification
|
|
576
|
+
*/
|
|
577
|
+
/** Maximum number of envelopes allowed in a single batch request */
|
|
578
|
+
export declare const BATCH_SIZE_LIMIT = 100;
|
|
579
|
+
/** Individual batch item - envelope type is detected automatically */
|
|
580
|
+
export interface BatchItem {
|
|
581
|
+
envelope: SignedEnvelope;
|
|
582
|
+
/** Optional client-provided ID for correlation */
|
|
583
|
+
id?: string;
|
|
584
|
+
}
|
|
585
|
+
/** Result for a single batch item */
|
|
586
|
+
export interface BatchItemResult {
|
|
587
|
+
/** Client-provided ID (if any) or index in the batch */
|
|
588
|
+
id: string;
|
|
589
|
+
/** Detected envelope type */
|
|
590
|
+
envelope_type?: EnvelopeType;
|
|
591
|
+
/** Verification result */
|
|
592
|
+
result: VerificationResult;
|
|
593
|
+
/** Error details (if verification failed) */
|
|
594
|
+
error?: VerificationError;
|
|
595
|
+
/** Additional fields returned based on envelope type */
|
|
596
|
+
signer_did?: string;
|
|
597
|
+
provider?: string;
|
|
598
|
+
model?: string;
|
|
599
|
+
gateway_id?: string;
|
|
600
|
+
model_identity_tier?: ModelIdentityTier;
|
|
601
|
+
risk_flags?: string[];
|
|
602
|
+
}
|
|
603
|
+
/** Batch verification request */
|
|
604
|
+
export interface VerifyBatchRequest {
|
|
605
|
+
items: BatchItem[];
|
|
606
|
+
}
|
|
607
|
+
/** Batch verification response */
|
|
608
|
+
export interface VerifyBatchResponse {
|
|
609
|
+
/** Total number of items in the batch */
|
|
610
|
+
total: number;
|
|
611
|
+
/** Number of valid items */
|
|
612
|
+
valid_count: number;
|
|
613
|
+
/** Number of invalid items */
|
|
614
|
+
invalid_count: number;
|
|
615
|
+
/** Per-item results in same order as input */
|
|
616
|
+
results: BatchItemResult[];
|
|
617
|
+
/** Timestamp when verification completed */
|
|
618
|
+
verified_at: string;
|
|
619
|
+
}
|
|
620
|
+
/**
|
|
621
|
+
* Audit log types for verification provenance
|
|
622
|
+
* CVF-US-005: Verification provenance for compliance traceability
|
|
623
|
+
*/
|
|
624
|
+
/** Audit log entry stored in D1 */
|
|
625
|
+
export interface AuditLogEntry {
|
|
626
|
+
/** Unique identifier for this audit entry (receipt_id) */
|
|
627
|
+
receipt_id: string;
|
|
628
|
+
/** Hash of the verification request */
|
|
629
|
+
request_hash_b64u: string;
|
|
630
|
+
/** Type of envelope that was verified */
|
|
631
|
+
envelope_type: EnvelopeType;
|
|
632
|
+
/** Verification result status */
|
|
633
|
+
status: VerificationStatus;
|
|
634
|
+
/** Signer DID from the envelope */
|
|
635
|
+
signer_did: string;
|
|
636
|
+
/** Timestamp of verification */
|
|
637
|
+
verified_at: string;
|
|
638
|
+
/** Hash of the previous entry in the chain (null for first entry) */
|
|
639
|
+
prev_hash_b64u: string | null;
|
|
640
|
+
/** Hash of this entry (computed from all fields + prev_hash) */
|
|
641
|
+
entry_hash_b64u: string;
|
|
642
|
+
}
|
|
643
|
+
/** Response when creating an audit log entry */
|
|
644
|
+
export interface AuditLogReceipt {
|
|
645
|
+
receipt_id: string;
|
|
646
|
+
entry_hash_b64u: string;
|
|
647
|
+
prev_hash_b64u: string | null;
|
|
648
|
+
verified_at: string;
|
|
649
|
+
}
|
|
650
|
+
/** Response when retrieving provenance by receipt ID */
|
|
651
|
+
export interface ProvenanceResponse {
|
|
652
|
+
found: boolean;
|
|
653
|
+
entry?: AuditLogEntry;
|
|
654
|
+
chain_valid?: boolean;
|
|
655
|
+
}
|
|
656
|
+
/**
|
|
657
|
+
* Proof Bundle types
|
|
658
|
+
* CVF-US-007: Verify proof bundles for trust tier computation
|
|
659
|
+
*/
|
|
660
|
+
/** Universal Resource Manifest (URM) reference embedded in a proof bundle. */
|
|
661
|
+
export interface URMReference {
|
|
662
|
+
urm_version: '1';
|
|
663
|
+
urm_id: string;
|
|
664
|
+
resource_type: string;
|
|
665
|
+
resource_hash_b64u: string;
|
|
666
|
+
metadata?: Record<string, unknown>;
|
|
667
|
+
}
|
|
668
|
+
/** Resource item in a URM (inputs/outputs). */
|
|
669
|
+
export interface URMResourceItem {
|
|
670
|
+
type: string;
|
|
671
|
+
hash_b64u: string;
|
|
672
|
+
content_type?: string;
|
|
673
|
+
uri?: string;
|
|
674
|
+
path?: string;
|
|
675
|
+
size_bytes?: number;
|
|
676
|
+
metadata?: Record<string, unknown>;
|
|
677
|
+
}
|
|
678
|
+
/** Harness descriptor embedded in a URM. */
|
|
679
|
+
export interface URMHarness {
|
|
680
|
+
id: string;
|
|
681
|
+
version: string;
|
|
682
|
+
runtime?: string;
|
|
683
|
+
config_hash_b64u?: string;
|
|
684
|
+
metadata?: Record<string, unknown>;
|
|
685
|
+
}
|
|
686
|
+
/** Universal Run Manifest (URM) document (materialized bytes). */
|
|
687
|
+
export interface URMDocument {
|
|
688
|
+
urm_version: '1';
|
|
689
|
+
urm_id: string;
|
|
690
|
+
run_id: string;
|
|
691
|
+
agent_did: string;
|
|
692
|
+
issued_at: string;
|
|
693
|
+
harness: URMHarness;
|
|
694
|
+
inputs: URMResourceItem[];
|
|
695
|
+
outputs: URMResourceItem[];
|
|
696
|
+
event_chain_root_hash_b64u?: string;
|
|
697
|
+
receipts_root_hash_b64u?: string;
|
|
698
|
+
proof_bundle_hash_b64u?: string;
|
|
699
|
+
metadata?: Record<string, unknown>;
|
|
700
|
+
}
|
|
701
|
+
/** Event chain entry for hash-linked event logs */
|
|
702
|
+
export interface EventChainEntry {
|
|
703
|
+
event_id: string;
|
|
704
|
+
run_id: string;
|
|
705
|
+
event_type: string;
|
|
706
|
+
timestamp: string;
|
|
707
|
+
payload_hash_b64u: string;
|
|
708
|
+
prev_hash_b64u: string | null;
|
|
709
|
+
event_hash_b64u: string;
|
|
710
|
+
}
|
|
711
|
+
/** Attestation reference in proof bundles */
|
|
712
|
+
export interface AttestationReference {
|
|
713
|
+
attestation_id: string;
|
|
714
|
+
attestation_type: 'owner' | 'third_party';
|
|
715
|
+
attester_did: string;
|
|
716
|
+
subject_did: string;
|
|
717
|
+
expires_at?: string;
|
|
718
|
+
signature_b64u: string;
|
|
719
|
+
}
|
|
720
|
+
/** Proof bundle metadata with optional harness information */
|
|
721
|
+
export interface ProofBundleMetadata {
|
|
722
|
+
/** Harness metadata identifying the runtime that produced this bundle */
|
|
723
|
+
harness?: HarnessMetadata;
|
|
724
|
+
/** Additional metadata (non-normative) */
|
|
725
|
+
[key: string]: unknown;
|
|
726
|
+
}
|
|
727
|
+
/** Proof bundle payload structure */
|
|
728
|
+
export interface ProofBundlePayload {
|
|
729
|
+
bundle_version: '1';
|
|
730
|
+
bundle_id: string;
|
|
731
|
+
agent_did: string;
|
|
732
|
+
urm?: URMReference;
|
|
733
|
+
event_chain?: EventChainEntry[];
|
|
734
|
+
receipts?: SignedEnvelope<GatewayReceiptPayload>[];
|
|
735
|
+
attestations?: AttestationReference[];
|
|
736
|
+
metadata?: ProofBundleMetadata;
|
|
737
|
+
}
|
|
738
|
+
/** Trust tiers computed from proof bundle contents (verifier-internal). */
|
|
739
|
+
export type TrustTier = 'unknown' | 'basic' | 'verified' | 'attested' | 'full';
|
|
740
|
+
/**
|
|
741
|
+
* Canonical proof tiers (marketplace-facing) derived from verified components.
|
|
742
|
+
*
|
|
743
|
+
* Ordering (low → high):
|
|
744
|
+
* - unknown: no verified evidence
|
|
745
|
+
* - self: agent-signed evidence only
|
|
746
|
+
* - gateway: includes at least one valid gateway receipt bound to the bundle event chain
|
|
747
|
+
* - sandbox: includes at least one valid sandbox/execution attestation (allowlisted + signature verified)
|
|
748
|
+
* - tee: reserved (future)
|
|
749
|
+
* - witnessed_web: reserved (future; subscription/web auth only counts when witnessed)
|
|
750
|
+
*/
|
|
751
|
+
export type ProofTier = 'unknown' | 'self' | 'gateway' | 'sandbox' | 'tee' | 'witnessed_web';
|
|
752
|
+
/**
|
|
753
|
+
* PoH vNext: model identity tier (orthogonal to PoH proof tiers).
|
|
754
|
+
*
|
|
755
|
+
* Semantics:
|
|
756
|
+
* - `proof_tier` answers: "how was it executed?" (self/gateway/sandbox)
|
|
757
|
+
* - `model_identity_tier` answers: "what can we honestly claim about the underlying model identity?"
|
|
758
|
+
*/
|
|
759
|
+
export type ModelIdentityTier = 'unknown' | 'closed_opaque' | 'closed_provider_manifest' | 'openweights_hashable' | 'tee_measured';
|
|
760
|
+
/** Proof bundle verification result */
|
|
761
|
+
export interface ProofBundleVerificationResult {
|
|
762
|
+
status: VerificationStatus;
|
|
763
|
+
reason: string;
|
|
764
|
+
verified_at: string;
|
|
765
|
+
bundle_id?: string;
|
|
766
|
+
agent_did?: string;
|
|
767
|
+
trust_tier?: TrustTier;
|
|
768
|
+
proof_tier?: ProofTier;
|
|
769
|
+
model_identity_tier?: ModelIdentityTier;
|
|
770
|
+
/** Optional deterministic risk flags (non-normative). */
|
|
771
|
+
risk_flags?: string[];
|
|
772
|
+
component_results?: {
|
|
773
|
+
envelope_valid: boolean;
|
|
774
|
+
urm_valid?: boolean;
|
|
775
|
+
event_chain_valid?: boolean;
|
|
776
|
+
/** Root hash of the event chain (first event's hash) */
|
|
777
|
+
chain_root_hash?: string;
|
|
778
|
+
prompt_pack_valid?: boolean;
|
|
779
|
+
system_prompt_report_valid?: boolean;
|
|
780
|
+
receipts_valid?: boolean;
|
|
781
|
+
attestations_valid?: boolean;
|
|
782
|
+
receipts_count?: number;
|
|
783
|
+
/** Number of receipts that passed cryptographic verification AND binding checks (when enforced). */
|
|
784
|
+
receipts_verified_count?: number;
|
|
785
|
+
/** Number of receipts that passed cryptographic signature+hash verification (regardless of binding). */
|
|
786
|
+
receipts_signature_verified_count?: number;
|
|
787
|
+
attestations_count?: number;
|
|
788
|
+
/** Number of attestations that passed cryptographic signature verification (regardless of allowlist/subject binding). */
|
|
789
|
+
attestations_signature_verified_count?: number;
|
|
790
|
+
/** Number of attestations that counted for tier uplift (signature + allowlist + subject binding). */
|
|
791
|
+
attestations_verified_count?: number;
|
|
792
|
+
/** CPL-US-006: tool receipt validation results. */
|
|
793
|
+
tool_receipts_valid?: boolean;
|
|
794
|
+
tool_receipts_count?: number;
|
|
795
|
+
/** CPL-US-007: side-effect receipt validation results. */
|
|
796
|
+
side_effect_receipts_valid?: boolean;
|
|
797
|
+
side_effect_receipts_count?: number;
|
|
798
|
+
/** CPL-US-008: human approval receipt validation results. */
|
|
799
|
+
human_approval_receipts_valid?: boolean;
|
|
800
|
+
human_approval_receipts_count?: number;
|
|
801
|
+
/** CEA-US-010: optional execution attestation evidence (outside the proof bundle). */
|
|
802
|
+
execution_attestations_valid?: boolean;
|
|
803
|
+
execution_attestations_count?: number;
|
|
804
|
+
execution_attestations_verified_count?: number;
|
|
805
|
+
};
|
|
806
|
+
}
|
|
807
|
+
/** Verify bundle request */
|
|
808
|
+
export interface VerifyBundleRequest {
|
|
809
|
+
envelope: SignedEnvelope<ProofBundlePayload>;
|
|
810
|
+
/** Optional materialized URM document bytes (JSON object). */
|
|
811
|
+
urm?: URMDocument;
|
|
812
|
+
/** Optional execution attestations (CEA-US-010). */
|
|
813
|
+
execution_attestations?: SignedEnvelope<ExecutionAttestationPayload>[];
|
|
814
|
+
}
|
|
815
|
+
/** Verify bundle response */
|
|
816
|
+
export interface VerifyBundleResponse {
|
|
817
|
+
result: ProofBundleVerificationResult;
|
|
818
|
+
trust_tier?: TrustTier;
|
|
819
|
+
proof_tier?: ProofTier;
|
|
820
|
+
model_identity_tier?: ModelIdentityTier;
|
|
821
|
+
risk_flags?: string[];
|
|
822
|
+
error?: VerificationError;
|
|
823
|
+
}
|
|
824
|
+
/**
|
|
825
|
+
* Export Bundle verification (POHVN-US-007)
|
|
826
|
+
*/
|
|
827
|
+
export interface ExportBundleManifestEntry {
|
|
828
|
+
path: string;
|
|
829
|
+
sha256_b64u: string;
|
|
830
|
+
content_type: string;
|
|
831
|
+
size_bytes: number;
|
|
832
|
+
}
|
|
833
|
+
export interface ExportBundleManifest {
|
|
834
|
+
manifest_version: '1';
|
|
835
|
+
generated_at: string;
|
|
836
|
+
entries: ExportBundleManifestEntry[];
|
|
837
|
+
}
|
|
838
|
+
export interface ExportBundleArtifacts {
|
|
839
|
+
proof_bundle_envelope: SignedEnvelope<ProofBundlePayload>;
|
|
840
|
+
execution_attestation_envelopes?: SignedEnvelope<ExecutionAttestationPayload>[];
|
|
841
|
+
derivation_attestation_envelopes?: SignedEnvelope<DerivationAttestationPayload>[];
|
|
842
|
+
audit_result_attestation_envelopes?: SignedEnvelope<AuditResultAttestationPayload>[];
|
|
843
|
+
}
|
|
844
|
+
export interface ExportBundlePayload {
|
|
845
|
+
export_version: '1';
|
|
846
|
+
export_id: string;
|
|
847
|
+
created_at: string;
|
|
848
|
+
issuer_did: string;
|
|
849
|
+
manifest: ExportBundleManifest;
|
|
850
|
+
artifacts: ExportBundleArtifacts;
|
|
851
|
+
bundle_hash_b64u: string;
|
|
852
|
+
hash_algorithm: 'SHA-256';
|
|
853
|
+
signature_b64u: string;
|
|
854
|
+
algorithm: 'Ed25519';
|
|
855
|
+
issued_at: string;
|
|
856
|
+
metadata?: Record<string, unknown>;
|
|
857
|
+
}
|
|
858
|
+
export interface VerifyExportBundleRequest {
|
|
859
|
+
bundle: ExportBundlePayload;
|
|
860
|
+
}
|
|
861
|
+
export interface VerifyExportBundleResponse {
|
|
862
|
+
result: VerificationResult;
|
|
863
|
+
export_id?: string;
|
|
864
|
+
bundle_hash_b64u?: string;
|
|
865
|
+
manifest_entries_verified?: number;
|
|
866
|
+
verified_components?: {
|
|
867
|
+
proof_bundle_valid: boolean;
|
|
868
|
+
execution_attestations_verified: number;
|
|
869
|
+
derivation_attestations_verified: number;
|
|
870
|
+
audit_result_attestations_verified: number;
|
|
871
|
+
};
|
|
872
|
+
proof_tier?: ProofTier;
|
|
873
|
+
model_identity_tier?: ModelIdentityTier;
|
|
874
|
+
error?: VerificationError;
|
|
875
|
+
}
|
|
876
|
+
/**
|
|
877
|
+
* Event Chain Verification types
|
|
878
|
+
* CVF-US-008: Verify event chains for tamper-evident logs
|
|
879
|
+
*/
|
|
880
|
+
/** Event chain payload for standalone event chain verification */
|
|
881
|
+
export interface EventChainPayload {
|
|
882
|
+
chain_version: '1';
|
|
883
|
+
chain_id: string;
|
|
884
|
+
run_id: string;
|
|
885
|
+
events: EventChainEntry[];
|
|
886
|
+
metadata?: Record<string, unknown>;
|
|
887
|
+
}
|
|
888
|
+
/** Event chain verification result */
|
|
889
|
+
export interface EventChainVerificationResult {
|
|
890
|
+
status: VerificationStatus;
|
|
891
|
+
reason: string;
|
|
892
|
+
verified_at: string;
|
|
893
|
+
chain_id?: string;
|
|
894
|
+
run_id?: string;
|
|
895
|
+
chain_root_hash?: string;
|
|
896
|
+
events_count?: number;
|
|
897
|
+
signer_did?: string;
|
|
898
|
+
}
|
|
899
|
+
/** Verify event chain request */
|
|
900
|
+
export interface VerifyEventChainRequest {
|
|
901
|
+
envelope: SignedEnvelope<EventChainPayload>;
|
|
902
|
+
}
|
|
903
|
+
/** Verify event chain response */
|
|
904
|
+
export interface VerifyEventChainResponse {
|
|
905
|
+
result: EventChainVerificationResult;
|
|
906
|
+
chain_root_hash?: string;
|
|
907
|
+
run_id?: string;
|
|
908
|
+
error?: VerificationError;
|
|
909
|
+
}
|
|
910
|
+
//# sourceMappingURL=types.d.ts.map
|