Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
482 lines (482 loc) · 58.6 KB
/
Copy pathopenapi.yaml
File metadata and controls
482 lines (482 loc) · 58.6 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
openapi: 3.0.3
info:
title: OpenGuardrail API
version: 0.1.0-alpha.0
description: Standalone Scene and Policy management requires no account or Project key. Runs retain scoped Submission credentials. Trusted-operator access is API-only and checks direct or inherited resource administrator grants. Workspace-scoped resources accept /workspaces/{workspaceId} after /api/v1alpha1 or /runtime/v1alpha1. Use the projectId query parameter on these paths to select a project. Unscoped resource paths use the default workspace and project.
paths:
/api/v1alpha1/workspaces:
get:
operationId: listWorkspaces
description: Lists registered workspaces and all projects associated with each workspace.
responses:
'200':
description: Registered workspaces
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/json:
schema:
type: array
items:
type: object
required: [workspaceId, displayName, projects]
properties:
workspaceId: {type: string}
displayName: {type: string}
projects:
type: array
items:
type: object
required: [projectId, displayName]
properties:
projectId: {type: string}
displayName: {type: string}
default:
$ref: '#/components/responses/SpecError'
/livez:
get:
operationId: getLiveness
responses:
'200':
description: Process is alive; this check has no database dependency
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/json:
schema:
$ref: '#/components/schemas/Health'
/readyz:
get:
operationId: getReadiness
responses:
'200':
description: Database is reachable and schema is current
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/json:
schema:
$ref: '#/components/schemas/Health'
'503':
description: Database or schema is unavailable
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/json:
schema:
$ref: '#/components/schemas/Error'
/api/v1alpha1/meta/version:
get:
operationId: getVersion
responses:
'200':
description: Server build metadata
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/json:
schema:
$ref: '#/components/schemas/Version'
/api/v1alpha1/meta/capabilities:
get:
operationId: getCapabilities
responses:
'200':
description: Public API, CLI compatibility and feature discovery
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/json:
schema:
$ref: '#/components/schemas/Capabilities'
'503':
description: Runtime capability provider returned an unsupported value
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/json:
schema: {$ref: '#/components/schemas/Error'}
/openapi.yaml:
get:
operationId: getOpenAPI
responses:
'200':
description: This OpenAPI document
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
content:
application/yaml:
schema:
type: string
/runtime/v1alpha1/runs:
get: {"operationId":"listPolicyRuns","description":"List Runs in the default project. sceneKey and businessId together select at most one Run.","parameters":[{"$ref":"#/components/parameters/RunStatusFilter"},{"$ref":"#/components/parameters/RunResultFilter"},{"$ref":"#/components/parameters/RunSceneFilter"},{"$ref":"#/components/parameters/RunCreatorFilter"},{"$ref":"#/components/parameters/RunBusinessIDFilter"},{"$ref":"#/components/parameters/RunReferenceKindFilter"},{"$ref":"#/components/parameters/RunReferenceIDFilter"},{"$ref":"#/components/parameters/RunLimit"},{"$ref":"#/components/parameters/RunCursor"}],"security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRunPage"}}}},"default":{"$ref":"#/components/responses/RunError"}}}
post: {"operationId":"createPolicyRun","security":[],"responses":{"201":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRunCreation"}}}},"default":{"$ref":"#/components/responses/RunError"},"200":{"description":"Idempotent or business ID replay; credential is not reissued","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRun"}}}}},"description":"Creates from the Scene default active Revision unless an explicit Revision or resource binding selects another Revision. Same Idempotency-Key or same businessId and content replays without reissuing the credential. A businessId remains bound to its Run after FINISHED or EXPIRED; use a new businessId for a new Run attempt.","parameters":[{"$ref":"#/components/parameters/IdempotencyKey"},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePolicyRunRequest"}}}}}
/runtime/v1alpha1/runs/{runId}:
get: {"operationId":"getPolicyRun","description":"Read a Run in the default project.","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRun"}}}},"default":{"$ref":"#/components/responses/RunError"}},"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}]}
/runtime/v1alpha1/runs/{runId}/submission-credential:rotate:
post: {"operationId":"rotatePolicySubmissionCredential","description":"Rotate this Run's submission credential and revoke the previous credential.","security":[],"responses":{"201":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunSubmissionCredential"}}}},"default":{"$ref":"#/components/responses/RunError"}},"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}]}
/runtime/v1alpha1/runs/{runId}/submissions:
post: {"operationId":"submitSnapshot","security":[{"SubmissionCredential":[]}],"responses":{"201":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnapshotSubmission"}}}},"default":{"$ref":"#/components/responses/RunError"},"200":{"description":"Idempotent replay of the accepted Submission","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnapshotSubmission"}}}}},"description":"Full Snapshot with baseSubmissionNo CAS. finishRun=false keeps the Run OPEN; finishRun=true freezes Result and Decision. Verdict is derived from Check verdicts.","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SnapshotSubmitRequest"}}}}}
/api/v1alpha1/runs:
get: {"operationId":"listManagedPolicyRuns","parameters":[{"$ref":"#/components/parameters/RunStatusFilter"},{"$ref":"#/components/parameters/RunResultFilter"},{"$ref":"#/components/parameters/RunSceneFilter"},{"$ref":"#/components/parameters/RunCreatorFilter"},{"$ref":"#/components/parameters/RunBusinessIDFilter"},{"$ref":"#/components/parameters/RunReferenceKindFilter"},{"$ref":"#/components/parameters/RunReferenceIDFilter"},{"$ref":"#/components/parameters/RunLimit"},{"$ref":"#/components/parameters/RunCursor"}],"security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRunPage"}}}},"default":{"$ref":"#/components/responses/RunError"}}}
/api/v1alpha1/runs/{runId}:
get: {"operationId":"getManagedPolicyRun","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRun"}}}},"default":{"$ref":"#/components/responses/RunError"}},"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}]}
/api/v1alpha1/runs/{runId}/submissions:
get:
operationId: listManagedRunSubmissions
description: Paginated submission metadata in the default project. Fetch evidence through the selected Submission reader.
security: []
parameters:
- {name: runId, in: path, required: true, schema: {type: string}}
- {name: limit, in: query, schema: {type: integer, minimum: 1, maximum: 50, default: 20}}
- {name: before, in: query, schema: {type: integer, format: int64, minimum: 1}}
responses:
"200":
description: Newest-first metadata without evidence payloads
headers: {X-Trace-ID: {$ref: "#/components/headers/TraceID"}}
content:
application/json:
schema: {$ref: "#/components/schemas/SubmissionPage"}
default: {$ref: "#/components/responses/RunError"}
/api/v1alpha1/runs/{runId}/submissions/{submissionId}:
get: {"operationId":"getManagedRunSubmission","description":"Read a stored Submission and its evidence within the default project and selected Run.","security":[],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"name":"submissionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Immutable stored Submission","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredSubmission"}}}},"default":{"$ref":"#/components/responses/RunError"}}}
/api/v1alpha1/scenes:
get: {"operationId":"listSceneModels","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneModelList"}}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/scenes/{key}:initialize:
post: {"operationId":"initializeScene","security":[],"responses":{"201":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitializedScene"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"description":"Atomically create Scene, default Policy, Revision 1 and activation. Retry with the same Idempotency-Key.","parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InitializeSceneRequest"}}}}}
/api/v1alpha1/scenes/{key}:
get: {"operationId":"getSceneModel","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneModel"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}]}
delete: {"operationId":"deleteScene","description":"Soft delete a Scene; its policies and Runs become invisible to management reads.","security":[],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"responses":{"204":{"description":"Scene deleted","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/SpecError"}}}
patch: {"operationId":"setSceneTTL","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneModel"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetSceneTTLRequest"}}}}}
/api/v1alpha1/scenes/{key}/policies:
get: {"operationId":"listPolicies","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyList"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}]}
post: {"operationId":"createPolicy","description":"Create a Policy with a stable generated ID. YAML metadata.name is a label that may repeat or change between Revisions. Optional resource is bound atomically; an existing resource binding causes a conflict without creating another Policy.","security":[],"responses":{"201":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePolicyRequest"}}}}}
/api/v1alpha1/scenes/{key}/bindings:
get: {"operationId":"listBindings","security":[],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"after","in":"query","schema":{"type":"string","maxLength":1366}}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BindingPage"}}},"headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/scenes/{key}/bindings/{kind}/{resourceId}:
put: {"operationId":"putBinding","security":[],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"resourceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"description":"Idempotently create or replace a resource binding within this scene. If-None-Match: * allows only an absent or already identical binding; a different existing binding conflicts. Omit policyRevisionId to follow the Policy active revision. Resource IDs containing slash must be URL-encoded.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PutBindingRequest"}}}},"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyBinding"}}},"headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/SpecError"}}}
delete: {"operationId":"deleteBinding","security":[],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"name":"kind","in":"path","required":true,"schema":{"type":"string"}},{"name":"resourceId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"responses":{"204":{"description":"Binding absent; repeated deletion also succeeds","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/scenes/{key}/default-policy:
put: {"operationId":"setDefaultPolicy","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SceneModel"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetDefaultPolicyRequest"}}}}}
/api/v1alpha1/policies/{policyId}:
get: {"operationId":"getPolicy","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}}]}
patch: {"operationId":"renamePolicy","description":"Change only the Policy display name. Published revisions and immutable identifiers are unchanged.","security":[],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RenamePolicyRequest"}}}},"responses":{"200":{"description":"Updated Policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}},"headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/policies/{policyId}/source:
put: {"operationId":"setPolicySource","description":"Replace the two caller-supplied, opaque Policy source fields. Omitted or null fields clear their stored values. No source interpretation or uniqueness check is applied.","security":[],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPolicySourceRequest"}}}},"responses":{"200":{"description":"Updated Policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}},"headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/policies/{policyId}/maintainers:
put: {"operationId":"setPolicyMaintainers","description":"Replace this Spec maintainer list; empty lists are rejected. Trusted-operator mode requires Policy or ancestor administration.","security":[],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SetPolicyMaintainersRequest"}}}},"responses":{"200":{"description":"Updated Policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}},"headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/policies/{policyId}/draft:
put: {"operationId":"savePolicyDraft","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRevision"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyDraftRequest"}}}},"description":"Save this Spec Draft. Trusted-operator mode requires Policy or ancestor administration."}
get: {"operationId":"getPolicyDraft","security":[],"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}}],"description":"Return the current DRAFT Revision, or NOT_FOUND when no draft exists.","responses":{"200":{"description":"Draft Revision","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRevision"}}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/policies/{policyId}/draft:publish:
post: {"operationId":"publishPolicyDraft","security":[],"responses":{"201":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRevision"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"description":"Publish only the exact Draft YAML reviewed by the caller. The required yaml must match the stored Draft under its lock; otherwise return RESOURCE_STATE_CONFLICT. Retry the same Idempotency-Key with the same yaml. Trusted-operator mode requires Policy or ancestor administration.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyDraftRequest"}}}}}
/api/v1alpha1/policies/{policyId}/revisions:
get: {"operationId":"listPolicyRevisions","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRevisionPage"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"name":"pageSize","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"before","in":"query","schema":{"type":"integer","format":"int64","minimum":1}}],"description":"Returns a bounded page of summaries without YAML. Fetch content by revision ID. before is the exclusive revision-number cursor; new publications do not shift older pages."}
post: {"operationId":"publishPolicyRevision","description":"Publish an immutable Revision from the supplied YAML under this Policy. Retry the same Idempotency-Key with the same content. Trusted-operator mode requires Policy or ancestor administration.","security":[],"responses":{"201":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRevision"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"},{"$ref":"#/components/parameters/IdempotencyKey"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishPolicyRevisionRequest"}}}}}
/api/v1alpha1/policies/{policyId}/active-revision:
put: {"operationId":"activatePolicyRevision","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivatePolicyRevisionRequest"}}}},"description":"Select this Policy's active immutable Revision. Trusted-operator mode requires Policy or ancestor administration."}
/api/v1alpha1/policies/{policyId}:archive:
post: {"operationId":"archivePolicy","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}]}
/api/v1alpha1/policies/{policyId}:unarchive:
post: {"operationId":"unarchivePolicy","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"policyId","in":"path","required":true,"schema":{"type":"string"}},{"$ref":"#/components/parameters/CSRF"}]}
/api/v1alpha1/policy-revisions/{revisionId}:
get: {"operationId":"getPolicyRevision","security":[],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRevision"}}}},"default":{"$ref":"#/components/responses/SpecError"}},"parameters":[{"name":"revisionId","in":"path","required":true,"schema":{"type":"string"}}]}
/runtime/v1alpha1/runs/{runId}/policy-revision:
get: {"operationId":"getRunPolicyRevision","description":"Read this Run's frozen Spec content in the default project.","security":[],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Run-scoped immutable content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyRevision"}}},"headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/RunError"}}}
/runtime/v1alpha1/runs/{runId}/submissions/{submissionId}:
get: {"operationId":"getRunSubmission","description":"Read an accepted Submission of this Run in the default project.","security":[],"parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"name":"submissionId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Run-scoped immutable content","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StoredSubmission"}}},"headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}}},"default":{"$ref":"#/components/responses/RunError"}}}
/api/v1alpha1/audit-events:
get: {"operationId":"listAuditEvents","security":[],"description":"Read one project-scoped audit page in descending event ID order. Cursors are bound to filters and scope. Unscoped historical events are excluded. Detail objects above 4096 bytes are unavailable.","parameters":[{"name":"eventType","in":"query","schema":{"type":"string","maxLength":512}},{"name":"actorId","in":"query","schema":{"type":"string","maxLength":512}},{"name":"resourceType","in":"query","schema":{"type":"string","maxLength":512}},{"name":"resourceId","in":"query","schema":{"type":"string","maxLength":512}},{"name":"cursor","in":"query","schema":{"type":"string","maxLength":2048}},{"name":"from","in":"query","description":"Unix seconds; from is inclusive and to is exclusive.","schema":{"type":"integer","format":"int64","minimum":0}},{"name":"to","in":"query","description":"Unix seconds; from is inclusive and to is exclusive.","schema":{"type":"integer","format":"int64","minimum":0}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"redacted","in":"query","description":"Return actor/resource fingerprints and omit stored detail contents for sharing.","schema":{"type":"boolean"}}],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AuditPage"}}}},"default":{"$ref":"#/components/responses/SpecError"}}}
/api/v1alpha1/runs/{runId}/report:
get: {"operationId":"getManagedRunReport","security":[],"description":"Structured diagnostic export with Revision identity, content fingerprints and up to 20 submission summaries captured at the initial Run read. Raw YAML, changeSet and free-text evidence are omitted. generatedAt is a diagnostic observation time.","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunReport"}}}},"default":{"$ref":"#/components/responses/RunError"}}}
/runtime/v1alpha1/runs/{runId}/report:
get: {"operationId":"getRunReport","security":[],"description":"Structured diagnostic export with Revision identity, content fingerprints and up to 20 submission summaries captured at the initial Run read. Raw YAML, changeSet and free-text evidence are omitted. generatedAt is a diagnostic observation time.","parameters":[{"name":"runId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success","headers":{"X-Trace-ID":{"$ref":"#/components/headers/TraceID"}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RunReport"}}}},"default":{"$ref":"#/components/responses/RunError"}}}
components:
headers:
TraceID:
description: Opaque request correlation identifier generated by the server; safe to include in support reports
required: true
schema: {type: string, pattern: '^[a-f0-9]{32}$'}
securitySchemes:
SubmissionCredential: {type: http, scheme: bearer, description: Run-scoped credential accepted only by that Run's Submission endpoint}
parameters:
SceneKey:
name: key
in: path
required: true
schema: {$ref: '#/components/schemas/SceneKey'}
IdempotencyKey:
name: Idempotency-Key
in: header
required: true
schema:
type: string
pattern: '^[a-zA-Z0-9][a-zA-Z0-9._:-]{0,127}$'
description: Stable caller operation ID; scoped to the default Project and not a credential or Run ID
RunStatusFilter:
name: status
in: query
schema: {$ref: '#/components/schemas/RunStatus'}
description: Optional effective Run status. Overdue OPEN Runs match EXPIRED rather than OPEN.
RunResultFilter:
name: result
in: query
schema: {$ref: '#/components/schemas/RunResult'}
description: Optional exact final verdict. An overdue OPEN Run matches UNKNOWN as its effective status is EXPIRED.
RunSceneFilter:
name: sceneKey
in: query
schema: {$ref: '#/components/schemas/SceneKey'}
description: Optional exact Scene key.
RunBusinessIDFilter:
name: businessId
in: query
schema: {type: string, minLength: 1, maxLength: 128}
description: Optional exact caller-owned business correlation ID, permanently bound to one Run. Combine with sceneKey for one Run.
RunCreatorFilter:
name: createdBy
in: query
schema: {type: string, minLength: 1, maxLength: 128}
description: Optional exact actor recorded when the Run was created.
RunReferenceKindFilter:
name: referenceKind
in: query
schema: {type: string, pattern: '^[a-z][a-z0-9-]{0,63}$'}
RunReferenceIDFilter:
name: referenceId
in: query
schema: {type: string, minLength: 1, maxLength: 128}
RunLimit:
name: limit
in: query
schema: {type: integer, minimum: 1, maximum: 100, default: 20}
description: Maximum number of Runs returned.
RunCursor:
name: cursor
in: query
schema: {type: string, minLength: 1, maxLength: 512}
description: Opaque cursor returned by the preceding page. Do not inspect or construct it.
CSRF:
name: X-Guardrail-CSRF
in: header
required: true
schema: {type: string, enum: ['1']}
description: >
Required for all management mutations. Browser requests must also pass exact
Origin/Host and Sec-Fetch-Site checks. No cross-origin CORS is enabled.
responses:
RunError:
description: >
400 INVALID_ARGUMENT; 401 UNAUTHENTICATED; 403 PERMISSION_DENIED; 404 NOT_FOUND;
409 SPEC_NOT_PUBLISHED, BINDING_CONFLICT, IDEMPOTENCY_CONFLICT, BUSINESS_ID_CONFLICT, RUN_FINISHED or BASE_SUBMISSION_MISMATCH; 410 RUN_EXPIRED;
422 SPEC_VALIDATION_FAILED (invalid Draft selected for a Run), INVALID_SUBMISSION, VERDICT_MISMATCH or SENSITIVE_EVIDENCE_DETECTED; 503 RUN_UNAVAILABLE.
Cross-Project reads return 404. Only Snapshot submission requires the Run Submission credential; management and runtime reads use the default project.
content:
application/json:
schema: {$ref: '#/components/schemas/Error'}
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
SpecError:
description: >
400 INVALID_ARGUMENT; 401 UNAUTHENTICATED; 403 PERMISSION_DENIED, UNTRUSTED_ORIGIN or CSRF_REQUIRED;
404 NOT_FOUND; 409 RESOURCE_STATE_CONFLICT or SCENE_ALREADY_INITIALIZED; 422 SPEC_VALIDATION_FAILED with safe validation guidance;
503 SPEC_UNAVAILABLE.
Scene mutations require X-Guardrail-CSRF and exact Host/Origin checks.
Copy unsaved edits before reloading after a conflict.
content:
application/json:
schema: {$ref: '#/components/schemas/Error'}
headers: {X-Trace-ID: {$ref: '#/components/headers/TraceID'}}
schemas:
AuditEvent: {"type":"object","additionalProperties":false,"required":["id","eventType","occurredAt"],"properties":{"id":{"type":"string"},"eventType":{"type":"string"},"actorId":{"type":"string"},"actorRef":{"type":"string"},"occurredAt":{"type":"integer","format":"int64"},"resourceType":{"type":"string"},"resourceId":{"type":"string"},"resourceRef":{"type":"string"},"details":{"type":"object","additionalProperties":true,"x-go-type":"json.RawMessage"},"detailsDigest":{"type":"string"},"detailsUnavailable":{"type":"boolean"}}}
AuditPage: {"type":"object","additionalProperties":false,"required":["items","redacted"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/AuditEvent"}},"nextCursor":{"type":"string"},"redacted":{"type":"boolean"}}}
RunReportEvidence: {"type":"object","additionalProperties":false,"required":["requirementId","observedAt","queryDigest","resultDigest"],"properties":{"requirementId":{"type":"string"},"observedAt":{"type":"string"},"queryDigest":{"type":"string"},"resultDigest":{"type":"string"},"referenceDigest":{"type":"string"}}}
RunReportCheck: {"type":"object","additionalProperties":false,"required":["checkId","verdict","evidence"],"properties":{"checkId":{"type":"string"},"verdict":{"$ref":"#/components/schemas/RunResult"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/RunReportEvidence"}}}}
RunReportSubmission: {"type":"object","additionalProperties":false,"required":["id","submissionNo","verdict","finishRun","createdAt"],"properties":{"id":{"type":"string"},"submissionNo":{"type":"integer","format":"int64"},"verdict":{"$ref":"#/components/schemas/RunResult"},"finishRun":{"type":"boolean"},"createdAt":{"type":"integer","format":"int64"},"snapshotDigest":{"type":"string"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/RunReportCheck"}}}}
RunReportRevision: {"type":"object","additionalProperties":false,"required":["id","policyId","digest","status"],"properties":{"id":{"type":"string"},"policyId":{"type":"string"},"digest":{"type":"string"},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"revisionNumber":{"type":"integer","format":"int64"},"publishedAt":{"type":"integer","format":"int64"}}}
RunReport: {"type":"object","additionalProperties":false,"required":["format","generatedAt","run","revision","reasons","submissions"],"properties":{"format":{"type":"string"},"generatedAt":{"type":"integer","format":"int64"},"run":{"$ref":"#/components/schemas/PolicyRunSummary"},"revision":{"$ref":"#/components/schemas/RunReportRevision"},"reasons":{"type":"array","items":{"type":"string"}},"submissions":{"type":"array","items":{"$ref":"#/components/schemas/RunReportSubmission"}},"nextBefore":{"type":"integer","format":"int64"},"finalSubmission":{"$ref":"#/components/schemas/RunReportSubmission"}}}
RunSelection: {"type":"object","additionalProperties":false,"required":["source"],"description":"Frozen selection details. Draft Runs retain the revision status at creation.","properties":{"source":{"type":"string","enum":["binding","revision"]},"resources":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/ResourceReference"}},"revisionMode":{"type":"string","enum":["active","pinned"]},"revisionStatus":{"type":"string","enum":["DRAFT","PUBLISHED"]}}}
BindingPage: {"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PolicyBinding"}},"nextAfter":{"type":"string"}}}
PolicyBinding: {"type":"object","additionalProperties":false,"required":["resource","policyId"],"properties":{"resource":{"$ref":"#/components/schemas/ResourceReference"},"policyId":{"type":"string"},"policyRevisionId":{"type":"string"}}}
PutBindingRequest: {"type":"object","additionalProperties":false,"required":["policyId"],"properties":{"policyId":{"type":"string"},"policyRevisionId":{"type":"string"},"allowDraft":{"type":"boolean","default":false}}}
ResourceReference: {"type":"object","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"id":{"type":"string","minLength":1,"maxLength":128}}}
RunReference: {"type":"object","description":"Immutable external-object identifier for exact Run lookup. It does not select a Policy, establish ownership, or grant access.","additionalProperties":false,"required":["kind","id"],"properties":{"kind":{"type":"string","pattern":"^[a-z][a-z0-9-]{0,63}$"},"id":{"type":"string","minLength":1,"maxLength":128}}}
PolicySelection: {"type":"object","description":"Trusted Policy/Revision selection input, not verified business ownership. revisionId requires runs:create-with-revision and is mutually exclusive with resources. Omit both to use the Scene default.","additionalProperties":false,"properties":{"revisionId":{"type":"string"},"resources":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/ResourceReference"}}}}
PluginEndpoint: {"type":"object","additionalProperties":false,"properties":{"url":{"type":"string","format":"uri","description":"Complete HTTPS endpoint for this operation, including the provider-defined path."}},"required":["url"]}
ScenePlugins: {"type":"object","additionalProperties":false,"properties":{"changeSet":{"$ref":"#/components/schemas/PluginEndpoint"},"bindingCandidates":{"$ref":"#/components/schemas/PluginEndpoint"}},"x-go-type":"resource.Plugins","x-go-type-import":{"name":"resource","path":"github.com/alibaba/open-guardrail/extension/resource"}}
SceneModel: {"type":"object","additionalProperties":false,"required":["key","name","runTtlSeconds","createdBy","createdAt","updatedBy","updatedAt"],"properties":{"key":{"$ref":"#/components/schemas/SceneKey"},"name":{"type":"string"},"runTtlSeconds":{"type":"integer","format":"int64"},"defaultPolicyId":{"type":"string"},"plugins":{"$ref":"#/components/schemas/ScenePlugins"},"createdBy":{"type":"string","nullable":true,"readOnly":true,"x-omitempty":false,"description":"Authenticated creator; null only when historical attribution is unknown."},"createdAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"x-omitempty":false,"description":"Unix seconds of Scene creation; null for historical Scenes."},"updatedBy":{"type":"string","nullable":true,"readOnly":true,"x-omitempty":false,"description":"Last Scene modifier; null for historical Scenes."},"updatedAt":{"type":"integer","format":"int64","nullable":true,"readOnly":true,"x-omitempty":false,"description":"Unix seconds of the last Scene modification; null for historical Scenes."}}}
SceneModelList: {"type":"array","items":{"$ref":"#/components/schemas/SceneModel"}}
Policy: {"type":"object","additionalProperties":false,"required":["id","sceneKey","name","lifecycleState","maintainers"],"properties":{"id":{"type":"string"},"sceneKey":{"$ref":"#/components/schemas/SceneKey"},"name":{"type":"string"},"sourceKey":{"type":"string","maxLength":64,"description":"Opaque caller-supplied Policy source."},"sourceJson":{"type":"string","maxLength":1024,"description":"Opaque caller-supplied Policy source text."},"lifecycleState":{"type":"string","enum":["ACTIVE","ARCHIVED"]},"activeRevisionId":{"type":"string"},"maintainers":{"type":"array","maxItems":100,"items":{"type":"string","maxLength":128},"description":"Direct Policy administrator IDs. The creator receives an initial direct grant. In trusted-operator mode, ancestor administrators also inherit management rights."}}}
PolicyList: {"type":"array","items":{"$ref":"#/components/schemas/Policy"}}
PolicyRevision: {"type":"object","additionalProperties":false,"required":["id","policyId","status","yaml","updatedBy","updatedAt"],"properties":{"id":{"type":"string"},"policyId":{"type":"string"},"revisionNumber":{"type":"integer","format":"int64","description":"Present only for PUBLISHED Revisions."},"yaml":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"x-go-type":"json.RawMessage","description":"Optional immutable source metadata, at most 64 KiB serialized."},"digest":{"type":"string","description":"Present only for PUBLISHED Revisions."},"publishedAt":{"type":"integer","format":"int64","description":"Present only for PUBLISHED Revisions."},"publishedBy":{"type":"string","description":"Present only for PUBLISHED Revisions."},"status":{"type":"string","enum":["DRAFT","PUBLISHED"]},"updatedBy":{"type":"string"},"updatedAt":{"type":"integer","format":"int64"}}}
InitializedScene: {"type":"object","additionalProperties":false,"required":["scene","policy","revision"],"properties":{"scene":{"$ref":"#/components/schemas/SceneModel"},"policy":{"$ref":"#/components/schemas/Policy"},"revision":{"$ref":"#/components/schemas/PolicyRevision"}}}
InitializeSceneRequest: {"type":"object","additionalProperties":false,"required":["name","defaultPolicyName","yaml"],"properties":{"name":{"type":"string"},"defaultPolicyName":{"type":"string"},"yaml":{"type":"string"},"plugins":{"$ref":"#/components/schemas/ScenePlugins"}}}
SetSceneTTLRequest: {"type":"object","additionalProperties":false,"description":"Send name alone to rename a Scene without changing its key. Do not combine name with runTtlSeconds or plugins; existing TTL and plugin updates remain supported.","properties":{"runTtlSeconds":{"type":"integer","format":"int64"},"plugins":{"$ref":"#/components/schemas/ScenePlugins"},"name":{"type":"string","minLength":1,"maxLength":100}},"minProperties":1}
CreatePolicyRequest: {"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string"},"resource":{"$ref":"#/components/schemas/ResourceReference"},"sourceKey":{"type":"string","maxLength":64},"sourceJson":{"type":"string","maxLength":1024}}}
SetPolicySourceRequest: {"type":"object","additionalProperties":false,"properties":{"sourceKey":{"type":"string","maxLength":64,"nullable":true},"sourceJson":{"type":"string","maxLength":1024,"nullable":true}}}
SetDefaultPolicyRequest: {"type":"object","additionalProperties":false,"required":["policyId","expectedDefaultPolicyId"],"properties":{"policyId":{"type":"string"},"expectedDefaultPolicyId":{"type":"string","nullable":true}}}
PolicyDraftRequest: {"type":"object","additionalProperties":false,"required":["yaml"],"properties":{"yaml":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"x-go-type":"json.RawMessage"}}}
PublishPolicyRevisionRequest: {"type":"object","additionalProperties":false,"required":["yaml"],"properties":{"yaml":{"type":"string"},"metadata":{"type":"object","additionalProperties":true,"x-go-type":"json.RawMessage"}}}
ActivatePolicyRevisionRequest: {"type":"object","additionalProperties":false,"required":["policyRevisionId","expectedActiveRevisionId"],"properties":{"policyRevisionId":{"type":"string"},"expectedActiveRevisionId":{"type":"string","nullable":true}}}
CreatePolicyRunRequest: {"type":"object","additionalProperties":false,"required":["sceneKey","changeSet"],"properties":{"sceneKey":{"$ref":"#/components/schemas/SceneKey"},"businessId":{"type":"string","minLength":1,"maxLength":128,"description":"Optional caller-owned immutable business correlation ID. Unique within the default Project and Scene and permanently bound to one Run, including after FINISHED or EXPIRED. Use a new value for a new Run attempt. Leading or trailing whitespace is rejected."},"changeSet":{"type":"object","additionalProperties":true,"x-go-type":"json.RawMessage"},"policySelection":{"$ref":"#/components/schemas/PolicySelection"},"references":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/RunReference"}}}}
PolicyRun: {"type":"object","additionalProperties":false,"required":["id","sceneKey","policyId","policyRevisionId","specDigest","status","changeSet","changeSetDigest","runTtlSeconds","deadlineAt","latestSubmissionNo","createdAt"],"properties":{"createdBy":{"type":"string","description":"Actor recorded when the Run was created."},"id":{"type":"string"},"businessId":{"type":"string"},"sceneKey":{"$ref":"#/components/schemas/SceneKey"},"policyId":{"type":"string"},"policyRevisionId":{"type":"string"},"specDigest":{"type":"string"},"status":{"type":"string","enum":["OPEN","FINISHED","EXPIRED"]},"changeSet":{"type":"object","additionalProperties":true,"x-go-type":"json.RawMessage"},"changeSetDigest":{"type":"string"},"runTtlSeconds":{"type":"integer","format":"int64"},"deadlineAt":{"type":"integer","format":"int64"},"latestSubmissionNo":{"type":"integer","format":"int64"},"finalSubmissionId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"finishedAt":{"type":"integer","format":"int64"},"expiredAt":{"type":"integer","format":"int64"},"result":{"$ref":"#/components/schemas/RunResult"},"decision":{"$ref":"#/components/schemas/Decision"},"decisionExpiresAt":{"type":"integer","format":"int64"},"selection":{"$ref":"#/components/schemas/RunSelection"},"references":{"type":"array","items":{"$ref":"#/components/schemas/RunReference"}}}}
PolicyRunSummary: {"type":"object","description":"Bounded Run list item. Read the Run detail endpoint for changeSet.","additionalProperties":false,"required":["id","sceneKey","policyId","policyRevisionId","specDigest","status","changeSetDigest","runTtlSeconds","deadlineAt","latestSubmissionNo","createdAt"],"properties":{"createdBy":{"type":"string","description":"Actor recorded when the Run was created."},"id":{"type":"string"},"businessId":{"type":"string"},"sceneKey":{"$ref":"#/components/schemas/SceneKey"},"policyId":{"type":"string"},"policyRevisionId":{"type":"string"},"specDigest":{"type":"string"},"status":{"type":"string","enum":["OPEN","FINISHED","EXPIRED"]},"changeSetDigest":{"type":"string"},"runTtlSeconds":{"type":"integer","format":"int64"},"deadlineAt":{"type":"integer","format":"int64"},"latestSubmissionNo":{"type":"integer","format":"int64"},"finalSubmissionId":{"type":"string"},"createdAt":{"type":"integer","format":"int64"},"finishedAt":{"type":"integer","format":"int64"},"expiredAt":{"type":"integer","format":"int64"},"result":{"$ref":"#/components/schemas/RunResult"},"decision":{"$ref":"#/components/schemas/Decision"},"decisionExpiresAt":{"type":"integer","format":"int64"},"references":{"type":"array","items":{"$ref":"#/components/schemas/RunReference"}}}}
SnapshotSubmitRequest: {"type":"object","additionalProperties":false,"required":["baseSubmissionNo","finishRun","verdict","summary","checks"],"properties":{"baseSubmissionNo":{"type":"integer","format":"int64"},"finishRun":{"type":"boolean"},"verdict":{"$ref":"#/components/schemas/RunResult"},"summary":{"type":"string"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/SnapshotCheck"}}}}
SnapshotCheck: {"type":"object","additionalProperties":false,"required":["checkId","verdict","summary","evidence"],"properties":{"checkId":{"type":"string"},"verdict":{"$ref":"#/components/schemas/RunResult"},"summary":{"type":"string"},"evidence":{"type":"array","items":{"$ref":"#/components/schemas/SnapshotEvidence"}}}}
SnapshotEvidence: {"type":"object","additionalProperties":false,"required":["requirementId","observedAt","querySummary","resultSummary"],"properties":{"requirementId":{"type":"string"},"observedAt":{"type":"string","format":"date-time"},"querySummary":{"type":"string"},"resultSummary":{"type":"string"},"reference":{"type":"string"}}}
StoredSubmission: {"type":"object","additionalProperties":false,"required":["id","runId","submissionNo","baseSubmissionNo","verdict","summary","finishRun","createdAt","snapshot"],"properties":{"id":{"type":"string"},"runId":{"type":"string"},"submissionNo":{"type":"integer","format":"int64"},"baseSubmissionNo":{"type":"integer","format":"int64"},"verdict":{"$ref":"#/components/schemas/RunResult"},"summary":{"type":"string"},"finishRun":{"type":"boolean"},"createdAt":{"type":"integer","format":"int64"},"snapshot":{"$ref":"#/components/schemas/SnapshotSubmitRequest"}}}
SnapshotSubmission: {"type":"object","additionalProperties":false,"required":["id","runId","submissionNo","baseSubmissionNo","verdict","summary","finishRun","createdAt"],"properties":{"id":{"type":"string"},"runId":{"type":"string"},"submissionNo":{"type":"integer","format":"int64"},"baseSubmissionNo":{"type":"integer","format":"int64"},"verdict":{"$ref":"#/components/schemas/RunResult"},"summary":{"type":"string"},"finishRun":{"type":"boolean"},"createdAt":{"type":"integer","format":"int64"}}}
PolicyRunCreation: {"type":"object","additionalProperties":false,"required":["run","submissionCredential"],"properties":{"run":{"$ref":"#/components/schemas/PolicyRun"},"submissionCredential":{"$ref":"#/components/schemas/RunSubmissionCredential"}}}
PolicyRunPage: {"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","items":{"$ref":"#/components/schemas/PolicyRunSummary"}},"nextCursor":{"type":"string"}}}
SubmissionPage:
type: object
additionalProperties: false
required: [items]
properties:
items: {type: array, maxItems: 50, items: {$ref: "#/components/schemas/SnapshotSubmission"}}
nextBefore: {type: integer, format: int64, minimum: 1}
RunSubmissionCredential:
type: object
additionalProperties: false
required: [runId, token, expiresAt]
properties:
runId: {type: string}
token: {type: string, description: Plaintext returned only on creation or rotation}
expiresAt: {type: integer, format: int64}
RunResult: {type: string, enum: [PASS, BLOCKED, UNKNOWN]}
Decision: {type: string, enum: [ALLOW, DENY]}
RunStatus: {type: string, enum: [OPEN, FINISHED, EXPIRED]}
SceneKey: {type: string, pattern: '^[a-zA-Z0-9][a-zA-Z0-9_.-]{0,63}$'}
GuardrailSpec:
type: object
additionalProperties: false
description: >
Schema for YAML content at publication. validForSeconds is an integer from 1 to 9007199254740991;
all other scalars are strings. Run timeout is not part of this YAML.
One YAML document, at most 65,535 bytes, 4096 nodes and nesting depth 16.
Duplicate keys, anchors, aliases, custom tags, unknown fields and implicit scalar coercions are rejected.
Canonicalization uses RFC 8785 rules for this fixed schema. The numeric range is
restricted to IEEE 754 safe integers; out-of-range values are rejected without rounding.
required: [apiVersion, kind, metadata, spec]
properties:
apiVersion: {type: string, enum: [guardrail.open/v1alpha1]}
kind: {type: string, enum: [GuardrailSpec]}
metadata:
type: object
additionalProperties: false
required: [name]
properties:
name: {$ref: '#/components/schemas/SpecIdentifier'}
spec:
type: object
additionalProperties: false
required: [description, instructions, checks]
properties:
description: {type: string, minLength: 1, maxLength: 1024, description: Overall purpose of this Spec; must not be whitespace-only}
instructions: {type: string, minLength: 1, maxLength: 8000, description: Overall instructions for the evaluator; must not be whitespace-only}
validForSeconds: {type: integer, format: int64, minimum: 1, maximum: 9007199254740991, default: 3600, description: Accepted result validity in seconds; omitted values use 3600. Values above the IEEE 754 safe-integer maximum are rejected without rounding}
checks:
type: array
minItems: 1
maxItems: 20
description: Check IDs must be unique within the Spec
items:
type: object
additionalProperties: false
required: [id, displayName, description, instructions, criteria, evidenceRequirements]
properties:
id: {$ref: '#/components/schemas/SpecIdentifier'}
displayName: {type: string, minLength: 1, maxLength: 128, description: Human-readable check name}
description: {type: string, minLength: 1, maxLength: 1024, description: Must not be whitespace-only}
instructions: {type: string, minLength: 1, maxLength: 8000, description: Must not be whitespace-only}
criteria:
type: object
additionalProperties: false
required: [pass, block, unknown]
description: Verdict-specific criteria
properties:
pass: {type: string, minLength: 1, maxLength: 2048}
block: {type: string, minLength: 1, maxLength: 2048}
unknown: {type: string, minLength: 1, maxLength: 2048}
evidenceRequirements:
type: array
minItems: 1
maxItems: 20
description: Evidence IDs must be unique within this check
items:
type: object
additionalProperties: false
required: [id, description, appliesToVerdicts]
properties:
id: {$ref: '#/components/schemas/SpecIdentifier'}
description: {type: string, minLength: 1, maxLength: 1024, description: Evidence purpose}
appliesToVerdicts:
type: array
description: Verdicts requiring this evidence
minItems: 1
maxItems: 3
uniqueItems: true
items: {type: string, enum: [PASS, BLOCKED, UNKNOWN]}
SpecIdentifier:
type: string
pattern: '^[a-z]([a-z0-9-]{0,126}[a-z0-9])?$'
Health:
type: object
additionalProperties: false
required: [status]
properties:
status:
type: string
enum: [alive, ready]
Version:
type: object
additionalProperties: false
required: [version]
properties:
version:
type: string
Capabilities:
type: object
additionalProperties: false
required: [apiVersions, cli, features, storage]
properties:
apiVersions:
type: array
minItems: 1
items: {type: string}
cli:
$ref: '#/components/schemas/CLICompatibility'
features:
type: array
description: Enabled HTTP features. run-final-submission-decision covers one immutable final Submission and fixed PASS/ALLOW, BLOCKED/DENY or UNKNOWN/DENY evaluation. run-expiry-decision-validity covers frozen deadlines, lazy expiration and Decision expiry timestamps. run-scoped-submission-token covers one-time Run credentials and rotation through the direct-access management API. No feature implies Claims.
items: {type: string}
storage:
$ref: '#/components/schemas/StorageCapability'
StorageCapability:
type: object
description: Non-sensitive operating envelope of the active storage adapter
additionalProperties: false
required: [supportLevel, multiInstance]
properties:
supportLevel:
type: string
enum: [official-local, official-shared]
multiInstance:
type: boolean
description: Whether this release supports multiple service instances sharing the active database
CLICompatibility:
type: object
description: CLI protocol compatibility window; independent of the running server build version
additionalProperties: false
required: [minimumVersion, maximumVersionExclusive]
properties:
minimumVersion: {type: string, description: Oldest compatible CLI version, inclusive}
maximumVersionExclusive: {type: string, description: First incompatible CLI version, exclusive}
Error:
type: object
additionalProperties: false
required: [code, message, traceId]
properties:
code:
type: string
message:
type: string
traceId:
type: string
pattern: '^[a-f0-9]{32}$'
description: Same value as the X-Trace-ID response header
RevisionSummary: {"type":"object","additionalProperties":false,"required":["id","policyId","revisionNumber","digest","publishedAt","publishedBy"],"properties":{"id":{"type":"string"},"policyId":{"type":"string"},"revisionNumber":{"type":"integer","format":"int64"},"digest":{"type":"string"},"publishedAt":{"type":"integer","format":"int64"},"publishedBy":{"type":"string"}}}
PolicyRevisionPage: {"type":"object","additionalProperties":false,"required":["items"],"properties":{"items":{"type":"array","maxItems":100,"items":{"$ref":"#/components/schemas/RevisionSummary"}},"nextBefore":{"type":"integer","format":"int64","minimum":1}}}
SetPolicyMaintainersRequest: {"type":"object","additionalProperties":false,"required":["maintainers"],"properties":{"maintainers":{"type":"array","minItems":1,"maxItems":100,"uniqueItems":true,"items":{"type":"string","minLength":1,"maxLength":128,"pattern":"^[A-Za-z0-9][A-Za-z0-9_.:@-]{0,127}$"}}}}
RenamePolicyRequest: {"type":"object","additionalProperties":false,"required":["name"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100}}}