-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathadmin-api.openapi.yaml
More file actions
2587 lines (2482 loc) · 102 KB
/
Copy pathadmin-api.openapi.yaml
File metadata and controls
2587 lines (2482 loc) · 102 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
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.1.0
info:
title: agentic-sandbox Admin/Fleet API
version: 2.0.0
summary: Operator-facing fleet-management API for an agentic-sandbox host (Surface 1 of ADR-022)
description: |
Admin/Fleet HTTP API for operating an agentic-sandbox host: provisioning
instances, managing their lifecycle, browsing the agentshare storage tree,
enumerating container images and loadout manifests, polling async
operations, and streaming logs and events.
This is **Surface 1** in the three-surface model defined by
[ADR-022](https://github.com/jmagly/agentic-sandbox/blob/main/.aiwg/architecture/adr/ADR-022-three-surface-architecture.md).
It is the *operator* surface — distinct from and **NOT part of A2A**.
The Agent-to-Agent protocol (Surface 2) is exposed *per-instance* under
`/agents/{instance_id}/...` with its own AgentCard, securitySchemes, and
bindings; this admin spec deliberately does not model agent operations.
### Surfaces (for orientation)
| Surface | Path prefix | Audience | Spec |
|---|---|---|---|
| 1. Admin / Fleet (this doc) | `/api/v2/admin/...` | operators, fleet controllers, sandboxctl | this OpenAPI 3.1 file |
| 2. Per-instance A2A | `/agents/{instance_id}/...` | orchestrators (AIWG, third parties) | A2A core spec + agentic-sandbox extensions |
| 3. Observability | `/healthz`, `/readyz`, `/metrics`, plus log/event SSE under `/api/v2/admin/...` | Prometheus, on-call | k8s probes + Prometheus exposition |
Log/event SSE endpoints are routed under the admin prefix for
operational convenience but are observability-semantic (operator
surfaces, not agent surfaces).
### Authentication
Three auth mechanisms are supported; deployments enable one or more.
All operations on this API accept any of them unless otherwise noted.
- **Bearer token** (`Authorization: Bearer <token>`) — operator credential issued out of band.
- **mTLS** — client certificate verified against the operator CA bundle.
- **UNIX socket peer-credentials** — when the server is also bound to a UNIX domain socket (e.g. `/run/agentic-sandbox/admin.sock`), requests over that socket are authenticated by `SO_PEERCRED` of the connecting process. Effective uid/gid is matched against the configured operator allow-list. No HTTP credential is required on this transport. The `unix-peer-creds` security scheme is documentary only — it tells clients that requests on the UNIX socket transport carry implicit identity from the kernel.
These credentials are independent of the per-instance A2A
`securitySchemes` declared in each instance's AgentCard.
### Async operations
Long-running operations (provision, lifecycle transitions, reprovision)
return `202 Accepted` with an `OperationStatus` body containing an
`id`. Clients poll `GET /operations/{id}` until `state` is `succeeded`,
`failed`, or `canceled`.
Mutating operations
accept an optional `Idempotency-Key`. The key is bound to the authenticated
operator identity plus the exact HTTP method, path/query, and request body
for 24 hours. Repeating the same
intent returns the original response with `Idempotency-Replayed: true`;
reusing the key for a different request returns `409 Conflict`, and a
concurrent duplicate returns `409` with `Retry-After`.
### Errors
All non-2xx responses use the
[error-envelope schema](./admin-api/error-envelope.schema.json)
(RFC 7807 Problem Details with `code`, `instance`, `trace_id`
extensions). The response media type is
`application/problem+json`.
### Streaming
`/logs` and `/events` endpoints with `follow=true` use Server-Sent
Events (`text/event-stream`). Each event uses the standard SSE
framing (`id:`, `event:`, `data:` lines). The `data:` payload is one
JSON object per event (`LogEntry` or `Event`).
contact:
name: agentic-sandbox maintainers
url: https://github.com/jmagly/agentic-sandbox
license:
name: Apache-2.0
url: https://www.apache.org/licenses/LICENSE-2.0
servers:
- url: https://{host}/api/v2/admin
description: Default deployment. `host` defaults to the loopback bind for local dev.
variables:
host:
default: localhost:8122
description: Host:port of the agentic-sandbox management server.
security:
- bearer: []
- mtls: []
- unix-peer-creds: []
tags:
- name: instances
description: Fleet membership and provisioning. List, create, inspect instances.
- name: lifecycle
description: Start/stop/destroy/restart/reprovision actions on a provisioned instance.
- name: runtimes
description: Runtime-provider discovery and provider-specific capability negotiation.
- name: secrets
description: Per-instance secret rotation.
- name: cloud-hypervisor
description: Cloud Hypervisor fast-start, fork, and warm-pool operations.
- name: operations
description: Polling endpoint for async work units returned by provision and lifecycle endpoints.
- name: storage
description: CRUD over the virtiofs-backed agentshare tree (global RO, inbox/outbox RW).
- name: container-images
description: Curated container image catalog used by provisioning.
- name: loadouts
description: YAML-defined provisioning manifests describing instance shapes.
- name: bootstrap
description: Client-safe CA/bootstrap readiness and enrollment error taxonomy.
- name: mcp
description: Machine-readable discovery for the optional MCP management adapter.
- name: streaming
description: SSE endpoints for live log and event consumption.
paths:
/bootstrap/readiness:
get:
tags: [bootstrap]
operationId: getBootstrapReadiness
summary: Inspect sanitized CA/bootstrap readiness
description: |
Returns client-safe readiness metadata for gRPC mTLS bootstrap. The
response reports the public management WebSocket endpoint, CA backend status, trust-domain/freshness metadata,
bootstrap token-store counts, and stable enrollment error codes. It
never returns PEM bodies, token hashes, bearer values, CSRs, private
keys, or filesystem paths.
responses:
'200':
description: CA/bootstrap readiness posture.
content:
application/json:
schema: { $ref: '#/components/schemas/BootstrapReadinessResponse' }
examples:
secure:
value:
status: secure
management_websocket:
endpoint: ws://{host}:8121/
source: server_advertised
protocol_version: '1.0'
ca_provider:
configured: true
status: secure
backend: local
trust_domain: sandbox.agentic.local
root_key_store: file
trust_bundle: { present: true, freshness: fresh, revision: null, expires_at_unix_ms: 1780000000000 }
reason: null
bootstrap:
token_store_configured: true
status: ready
enrollment_endpoint: /api/v1/bootstrap-enrollment/consume
auth: one_time_bootstrap_token_bound_to_spiffe_id
token_counts: { active: 1, consumed: 4, revoked: 0, expired: 0 }
origin_posture:
path: /api/v1/bootstrap-enrollment/consume
tls_required_by_contract: true
listener_state: not_reported
reason: listener bind address and TLS private material are intentionally not exposed through this admin response
reason: null
error_taxonomy:
- http_status: 503
code: bootstrap.ca_unavailable
message: Bootstrap CA unavailable
recovery: configure a local or remote gRPC CA backend before requiring mTLS bootstrap
notes:
- response omits token hashes, PEM bodies, CSRs, private keys, bearer values, and filesystem paths
disabled:
value:
status: disabled
management_websocket:
endpoint: ws://{host}:8121/
source: server_advertised
protocol_version: '1.0'
ca_provider:
configured: false
status: disabled
backend: null
trust_domain: null
root_key_store: null
trust_bundle: { present: false, freshness: unknown, revision: null, expires_at_unix_ms: null }
reason: gRPC CA backend is not configured
bootstrap:
token_store_configured: false
status: disabled
enrollment_endpoint: /api/v1/bootstrap-enrollment/consume
auth: one_time_bootstrap_token_bound_to_spiffe_id
token_counts: null
origin_posture:
path: /api/v1/bootstrap-enrollment/consume
tls_required_by_contract: true
listener_state: not_reported
reason: listener bind address and TLS private material are intentionally not exposed through this admin response
reason: bootstrap token store and CA signing are not configured
error_taxonomy: []
notes: []
default:
$ref: '#/components/responses/Internal'
/mcp/discovery:
get:
tags: [mcp]
operationId: getMcpDiscovery
summary: Discover the optional MCP management adapter contract
description: |
Returns client-safe metadata for the separately authenticated `POST /mcp`
Streamable HTTP adapter. This admin response reports enabled/disabled
state, configured client IDs and scopes, supported protocol versions,
stateless transport behavior, allowed tool/resource shapes, and stable
error cases. It never returns bearer tokens or token hashes.
responses:
'200':
description: MCP discovery document.
content:
application/json:
schema: { $ref: '#/components/schemas/McpDiscoveryResponse' }
examples:
enabled:
value:
enabled: true
status: enabled
reason_code: null
endpoint:
path: /mcp
methods: [POST]
transport: streamable-http
stateless: true
get_behavior: 405_method_not_allowed
mcp_session_id: false
protocol:
latest: '2025-11-25'
supported: ['2025-03-26', '2025-06-18', '2025-11-25']
auth:
scheme: bearer
required: true
principal_config: mcp-principals.toml
principals:
- client_id: codex-local
scopes: [fleet.read, session.read, output.read]
scopes: [fleet.read, output.read, session.read]
capabilities:
tools: { listChanged: false }
resources: { subscribe: false, listChanged: false }
tools:
- name: list_sandboxes
title: List sandboxes
description: List the canonical management fleet inventory.
resources:
- uri: sandbox://fleet
name: fleet
description: Current sandbox fleet inventory
mimeType: application/json
resource_templates:
- uriTemplate: sandbox://instances/{instance_id}
name: sandbox-instance
description: One sandbox instance from the canonical fleet inventory
mimeType: application/json
errors:
- http_status: 401
code: mcp.unauthorized
message: missing or invalid MCP bearer token
notes:
- GET /mcp is not a session endpoint.
disabled:
value:
enabled: false
status: disabled
reason_code: mcp.principals_absent_or_disabled
endpoint:
path: /mcp
methods: [POST]
transport: streamable-http
stateless: true
get_behavior: 405_method_not_allowed
mcp_session_id: false
protocol:
latest: '2025-11-25'
supported: ['2025-03-26', '2025-06-18', '2025-11-25']
auth:
scheme: bearer
required: true
principal_config: mcp-principals.toml
principals: []
scopes: []
capabilities:
tools: { listChanged: false }
resources: { subscribe: false, listChanged: false }
tools: []
resources: []
resource_templates: []
errors: []
notes:
- GET /mcp is not a session endpoint.
default:
description: RFC 7807 error envelope.
content:
application/problem+json:
schema: { $ref: '#/components/schemas/ErrorEnvelope' }
/runtime/providers:
get:
tags: [runtimes]
operationId: listRuntimeProviders
summary: Discover runtime kinds, VM providers, and capabilities
description: |
Returns additive host, Docker, and QEMU runtime availability while
preserving the effective default VM provider and provider list used by
older clients. Runtime, provider, and capability identifiers are open
strings; clients MUST preserve unknown values and MAY render them opaquely.
Conditional exclusions, including VFIO incompatibilities, are reported
as constraints rather than inferred from provider names.
responses:
'200':
description: Runtime-provider discovery document.
content:
application/json:
schema: { $ref: '#/components/schemas/RuntimeProvidersResponse' }
examples:
local-host:
value:
default_vm_provider: cloud-hypervisor
runtimes:
- id: host
available: false
isolation_tier: full-host-access
architecture: x86_64
capabilities: [task.exec, session.pty, workspace.bind]
unavailable_code: host.supervisor_unconfigured
unavailable_reason: Host runtime supervisor is not configured
- id: docker
available: true
isolation_tier: shared-kernel
architecture: amd64
capabilities: [task.exec, session.pty, workspace.bind, image.oci]
- id: qemu
available: true
isolation_tier: hardware-virtualized
architecture: x86_64
capabilities: [instance.start, instance.stop, instance.checkpoint]
providers:
- id: libvirt
runtime: vm
available: true
is_default: false
capabilities: [instance.start, instance.stop, instance.restart, instance.destroy, instance.reprovision, instance.checkpoint, instance.restore, warm_pool.manage]
- id: cloud-hypervisor
runtime: vm
available: true
is_default: true
capabilities: [instance.start, instance.stop, instance.restart, instance.destroy, instance.reprovision, instance.snapshot, instance.restore, instance.fork, warm_pool.manage, device.vfio]
constraints:
- condition: device.vfio
excludes: [instance.snapshot, instance.restore, instance.fork, warm_pool.manage]
reason: Generic VFIO devices do not provide migratable device state; GPU VMs require cold hand-out and reset-gated teardown.
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'500': { $ref: '#/components/responses/Internal' }
/instances:
get:
tags: [instances]
operationId: listInstances
summary: List fleet instances
description: |
Returns a summary of every registered instance on this host. Use to
discover ids for further admin operations and to obtain each
instance's per-instance A2A AgentCard URL.
parameters:
- name: state
in: query
required: false
schema:
$ref: '#/components/schemas/InstanceState'
description: Filter by lifecycle state.
- name: runtime
in: query
required: false
schema:
$ref: '#/components/schemas/InstanceRuntime'
description: Filter by broad runtime kind.
- name: provider
in: query
required: false
schema:
$ref: '#/components/schemas/RuntimeProvider'
description: Filter by concrete VM provider. Unknown provider identifiers are matched opaquely.
responses:
'200':
description: Fleet snapshot.
content:
application/json:
schema:
type: object
required: [items]
properties:
items:
type: array
items:
$ref: '#/components/schemas/Instance'
degraded_providers:
type: array
description: Provider health degradations that did not prevent returning known inventory. Clients should keep rendering existing instances while using this field to disable affected lifecycle/provision controls.
items:
$ref: '#/components/schemas/DegradedProvider'
examples:
two-instances:
value:
items:
- id: 8a3f8b94-1c4e-4d2b-9c1a-1ad44e6b0dfe
name: agent-01
runtime: qemu
provider: cloud-hypervisor
capabilities: [instance.start, instance.stop, instance.restart, instance.destroy, instance.reprovision, instance.snapshot, instance.restore, instance.fork, warm_pool.manage, device.vfio]
state: running
agent_card_url: https://localhost:8122/agents/8a3f8b94-1c4e-4d2b-9c1a-1ad44e6b0dfe/.well-known/agent-card.json
loadout: profiles/claude-only.yaml
created_at: '2026-05-01T12:00:00Z'
- id: 1f3c9e2a-7b21-4f88-aa00-9d0b27cb1234
name: agent-02
runtime: docker
state: stopped
agent_card_url: https://localhost:8122/agents/1f3c9e2a-7b21-4f88-aa00-9d0b27cb1234/.well-known/agent-card.json
loadout: profiles/dual-review.yaml
created_at: '2026-05-02T09:30:00Z'
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'500': { $ref: '#/components/responses/Internal' }
post:
tags: [instances]
operationId: provisionInstance
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Provision a new instance (async)
description: |
Kicks off async provisioning. Returns `202` with an
`OperationStatus` describing the work unit. Poll
`GET /operations/{id}` for terminal state. The created instance's
id is reported in the operation `result.instance_id` once
provisioning succeeds. For `runtime: qemu`, `runtime_options` may
carry provider-neutral cold, restore, fork, or warm-pool launch
intent; non-cold modes delegate to the matching fast-start operation
and still return the same async operation envelope.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/InstanceProvisionRequest'
examples:
qemu-claude-only:
value:
name: agent-03
runtime: qemu
provider: cloud-hypervisor
loadout: profiles/claude-only.yaml
agentshare: true
start: true
qemu-restore:
value:
name: agent-restore-01
runtime: qemu
runtime_options:
kind: vm
provider: cloud-hypervisor
launch_strategy:
mode: restore
asset_ref: ch-snapshot-agentic-dev
restore_mode: ondemand
responses:
'202':
description: Provisioning accepted.
headers:
Location:
description: URL of the operation status resource.
schema: { type: string, format: uri-reference }
Idempotency-Replayed:
description: Present with value `true` when this response was recovered from a completed keyed request.
schema: { type: string, enum: ['true'] }
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
examples:
accepted:
value:
id: op_01HZK4XQ5G8XGE
kind: instance.provision
state: pending
target: agent-dev-01
created_at: '2026-05-09T14:01:00Z'
progress: { percent: 0 }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'422': { $ref: '#/components/responses/Validation' }
'503': { $ref: '#/components/responses/ServiceUnavailable' }
'500': { $ref: '#/components/responses/Internal' }
/instances/{id}:
parameters:
- $ref: '#/components/parameters/InstanceId'
get:
tags: [instances]
operationId: getInstance
summary: Get a single instance
description: Returns the full `Instance` record including the per-instance A2A AgentCard URL.
responses:
'200':
description: Instance found.
content:
application/json:
schema: { $ref: '#/components/schemas/Instance' }
examples:
running-qemu:
value:
id: 8a3f8b94-1c4e-4d2b-9c1a-1ad44e6b0dfe
name: agent-01
runtime: qemu
provider: libvirt
capabilities: [instance.start, instance.stop, instance.restart, instance.destroy, instance.reprovision, instance.checkpoint, instance.restore, warm_pool.manage]
state: running
agent_card_url: https://localhost:8122/agents/8a3f8b94-1c4e-4d2b-9c1a-1ad44e6b0dfe/.well-known/agent-card.json
loadout: profiles/claude-only.yaml
created_at: '2026-05-01T12:00:00Z'
network:
ip: 192.168.122.201
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'500': { $ref: '#/components/responses/Internal' }
/instances/{id}/start:
parameters: [{ $ref: '#/components/parameters/InstanceId' }]
post:
tags: [lifecycle]
operationId: startInstance
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Start a stopped instance (async)
description: Transitions a stopped instance to `running`. Returns `202` with an `OperationStatus`. Idempotent for instances already running.
responses:
'202': { $ref: '#/components/responses/OperationAccepted' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/instances/{id}/stop:
parameters: [{ $ref: '#/components/parameters/InstanceId' }]
post:
tags: [lifecycle]
operationId: stopInstance
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Stop a running instance (async)
description: Graceful shutdown. QEMU instances use libvirt shutdown; host instances are routed to the configured host supervisor and marked unready in the executor registry. Returns `202` with an `OperationStatus`. Idempotent for instances already stopped.
responses:
'202': { $ref: '#/components/responses/OperationAccepted' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/instances/{id}/destroy:
parameters: [{ $ref: '#/components/parameters/InstanceId' }]
post:
tags: [lifecycle]
operationId: destroyInstance
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Destroy an instance (async, irreversible)
description: Hard teardown. QEMU instances are destroyed/undefined through libvirt; host instances are routed to the configured host supervisor, then removed from the executor registry and signing-key state. Returns `202` with an `OperationStatus`. Cannot be reversed; the instance id is retired.
responses:
'202': { $ref: '#/components/responses/OperationAccepted' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/instances/{id}/restart:
parameters: [{ $ref: '#/components/parameters/InstanceId' }]
post:
tags: [lifecycle]
operationId: restartInstance
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Restart an instance (async)
description: Stop-then-start cycle preserving instance id, configuration, and persistent state. Returns `202` with an `OperationStatus`.
responses:
'202': { $ref: '#/components/responses/OperationAccepted' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/instances/{id}/reprovision:
parameters: [{ $ref: '#/components/parameters/InstanceId' }]
post:
tags: [lifecycle]
operationId: reprovisionInstance
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Reprovision an instance in place (async)
description: |
Re-runs the provisioning pipeline against the existing instance id,
applying the supplied loadout (or the current one if omitted).
Persistent inbox/outbox storage is preserved; the runtime image
and global cache are rebuilt. Returns `202` with an
`OperationStatus`.
requestBody:
required: false
content:
application/json:
schema:
type: object
properties:
loadout:
type: string
description: Loadout name or path. Omit to reuse the current loadout.
examples: [profiles/dual-review.yaml]
responses:
'202': { $ref: '#/components/responses/OperationAccepted' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/instances/{id}/rotate-secret:
parameters: [{ $ref: '#/components/parameters/InstanceId' }]
post:
tags: [secrets]
operationId: rotateInstanceSecret
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Retired legacy shared-secret rotation endpoint
description: |
Retired in #412 with the legacy agent shared-secret path. Agents now
authenticate with transport identity credentials.
responses:
'410':
description: Legacy shared-secret rotation is gone.
content:
application/json:
schema:
type: object
properties:
type: { type: string }
title: { type: string }
status: { type: integer, example: 410 }
code: { type: string, example: legacy_agent_secret.retired }
detail: { type: string }
examples:
retired:
value:
type: about:blank
title: Legacy agent shared-secret retired
status: 410
code: legacy_agent_secret.retired
detail: legacy agent shared-secret rotation was retired; use transport identity credentials
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/libvirt/checkpoints:
post:
tags: [libvirt]
operationId: createLibvirtCheckpoint
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Capture a pre-enrollment QEMU/libvirt checkpoint
description: |
Quiesces and detaches virtiofs, captures RAM/device state with
`virsh save`, and persists NVRAM plus restore metadata. The management
path rejects secret-bearing checkpoints.
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/LibvirtCheckpointRequest' }
responses:
'202':
description: Checkpoint operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/libvirt/checkpoints/{checkpoint_id}/restore:
parameters:
- name: checkpoint_id
in: path
required: true
schema: { type: string }
post:
tags: [libvirt]
operationId: restoreLibvirtCheckpoint
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Restore and enroll a fresh tenant in the saved libvirt domain
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/LibvirtRestoreRequest' }
responses:
'202':
description: Restore operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/libvirt/warm-pools:
post:
tags: [libvirt]
operationId: initializeLibvirtWarmPool
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Reserve N distinct pre-booted libvirt checkpoint slots
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/LibvirtWarmPoolInitRequest' }
responses:
'202':
description: Warm-pool operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/libvirt/warm-pools/{pool}/handoff:
parameters:
- name: pool
in: path
required: true
schema: { type: string }
post:
tags: [libvirt]
operationId: handoffLibvirtWarmPool
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Atomically claim, restore, and enroll one libvirt warm slot
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/LibvirtWarmPoolHandoffRequest' }
responses:
'202':
description: Handoff operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/cloud-hypervisor/snapshots:
post:
tags: [cloud-hypervisor]
operationId: createCloudHypervisorSnapshot
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Capture a Cloud Hypervisor clean-base snapshot
description: |
Captures a CH snapshot through `ch-faststart.sh snapshot`. Clean-base
snapshots must be pre-enrollment and signed; secret-bearing snapshots
require a seal key and are encrypted at rest.
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChSnapshotRequest' }
responses:
'202':
description: Snapshot operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/cloud-hypervisor/snapshots/{snapshot_id}/restore:
parameters:
- name: snapshot_id
in: path
required: true
schema: { type: string }
post:
tags: [cloud-hypervisor]
operationId: restoreCloudHypervisorSnapshot
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Restore a CH child from a verified clean-base snapshot
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChRestoreRequest' }
responses:
'202':
description: Restore operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/cloud-hypervisor/snapshots/{snapshot_id}/fork:
parameters:
- name: snapshot_id
in: path
required: true
schema: { type: string }
post:
tags: [cloud-hypervisor]
operationId: forkCloudHypervisorSnapshot
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Fork N CH children from one verified warm-base snapshot
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChForkRequest' }
responses:
'202':
description: Fork operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/cloud-hypervisor/warm-pools:
post:
tags: [cloud-hypervisor]
operationId: initializeCloudHypervisorWarmPool
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Initialize CH warm-pool accounting for a clean-base snapshot
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChWarmPoolInitRequest' }
responses:
'202':
description: Warm-pool operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/cloud-hypervisor/warm-pools/{pool}/handoff:
parameters:
- name: pool
in: path
required: true
schema: { type: string }
post:
tags: [cloud-hypervisor]
operationId: handoffCloudHypervisorWarmPool
parameters:
- $ref: '#/components/parameters/IdempotencyKey'
summary: Restore and hand out one CH child from a warm pool
requestBody:
required: true
content:
application/json:
schema: { $ref: '#/components/schemas/ChWarmPoolHandoffRequest' }
responses:
'202':
description: Handoff operation accepted.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
'400': { $ref: '#/components/responses/BadRequest' }
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'409': { $ref: '#/components/responses/Conflict' }
'500': { $ref: '#/components/responses/Internal' }
/operations/{id}:
parameters:
- name: id
in: path
required: true
schema: { type: string }
description: Operation id returned by an async endpoint.
example: op_01HZK4XQ5G8XGE
get:
tags: [operations]
operationId: getOperation
summary: Poll an async operation's status
description: |
Returns the current state of an async operation. State machine:
`pending` → `running` → (`succeeded` | `failed` | `canceled`).
Terminal records are retained per the server's retention policy
(default 24 h).
responses:
'200':
description: Operation found.
content:
application/json:
schema: { $ref: '#/components/schemas/OperationStatus' }
examples:
succeeded:
value:
id: op_01HZK4XQ5G8XGE
kind: instance.provision
state: succeeded
target: agent-dev-01
created_at: '2026-05-09T14:01:00Z'
completed_at: '2026-05-09T14:02:43Z'
progress: { percent: 100 }
result:
instance_id: 8a3f8b94-1c4e-4d2b-9c1a-1ad44e6b0dfe
'401': { $ref: '#/components/responses/Unauthorized' }
'403': { $ref: '#/components/responses/Forbidden' }
'404': { $ref: '#/components/responses/NotFound' }
'500': { $ref: '#/components/responses/Internal' }
/storage/{scope}/{path}:
parameters:
- name: scope
in: path
required: true
schema: { $ref: '#/components/schemas/StorageScope' }
description: |
Storage scope. `global` is read-only shared resources; `inbox`
is per-agent inbound (RW); `outbox` is per-agent outbound
artifacts (RW). `inbox`/`outbox` paths begin with the
instance id.
- name: path
in: path
required: true
schema: { type: string }
description: |
Object path within the scope. Slashes within the path are
permitted and conveyed as-is. For example:
`inbox/8a3f.../missions/m-001.json`.
example: 8a3f8b94-1c4e-4d2b-9c1a-1ad44e6b0dfe/missions/m-001.json
get:
tags: [storage]
operationId: getStorageObject
summary: Browse a storage directory or read a bounded object's metadata and contents
description: |
Directories return a metadata-only listing capped at 500 entries.
Objects larger than 1 MiB are rejected with `413` so this management
surface cannot materialize unbounded content. Otherwise returns the
object's metadata and contents.
When the `Accept` header is `application/json` (default), returns
the `StorageObject` envelope with `content_base64` for binary or
`content` for text. When `Accept` is the object's media type
(e.g. `application/octet-stream`), returns the raw bytes.
responses:
'200':
description: Object found.
content:
application/json:
schema:
oneOf:
- { $ref: '#/components/schemas/StorageObject' }