Repository navigation
Expand file tree
/
Copy pathisolation_backend.proto
More file actions
144 lines (128 loc) · 7.16 KB
/
Copy pathisolation_backend.proto
File metadata and controls
144 lines (128 loc) · 7.16 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
// SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0
syntax = "proto3";
package openshell.sandbox.backend.v1;
import "extension.proto";
import "options.proto";
// EXPERIMENTAL: This protocol is under active development. Its API and wire
// format may change incompatibly before stabilization.
//
// Isolation Backend control contract. The supervisor uses this service on a
// trusted, authenticated endpoint selected by operator configuration or compute
// driver provisioning. Workload control, network mediation, and byte streams
// remain on the Sandbox Protocol.
// Before serving a launch, the trusted compute driver provisions the backend
// with gateway_id and verification_keys from the gateway-created
// launch_authentication in compute_driver.proto. These public keys verify the
// supervisor's sandbox bearer; the driver delivers supervisor bearer credentials
// only to the supervisor, never to workload code. The gateway identity and key
// set remain fixed for that runtime generation. Bearers may be renewed within
// the generation using the provisioned keys; changing the gateway identity or
// key set requires a fresh launch and generation. These RPCs do not provision
// or update verification keys.
// Describe exchanges PeerMetadata to negotiate the base contract and optional
// suspend/resume support.
// Version 1.0 requires openshell.sandbox.protocol on both peers and includes
// boundary routing. Optional state retention support advertises
// openshell.sandbox.suspend-resume. Add optional capabilities
// or fields with compatible minor versions; incompatible semantics require a
// major bump. Peers ignore unknown protobuf fields and must satisfy both peers'
// required capabilities before use.
service IsolationBackend {
// Describe the backend and negotiate before opening a boundary. This call
// conveys no sandbox credentials or driver descriptor.
rpc Describe(DescribeIsolationBackendRequest) returns (DescribeIsolationBackendResponse);
// Bind a driver-provisioned resource to the authenticated sandbox and generation
// using the launch in OpenBoundaryRequest. Follow SandboxProtocol admission.
// A resource that already is the boundary may only validate and reserve its
// binding, then return a handle.
// Reopening the same session and generation returns the same result. The
// descriptor must bind to the same provisioned resource; a different resource
// binding fails.
// A trusted driver may prepare retained state through its native backend
// integration. In that case OpenBoundary selects RESTORED, or
// COLD_START_FALLBACK only when the driver explicitly permitted it. The
// backend enforces this choice; reference handoff is private to the driver
// and backend and does not require supervisor bootstrap fields.
// Driver deletion invalidates all handles and retained-state references,
// including abandoned launches and suspended boundaries.
rpc OpenBoundary(OpenBoundaryRequest) returns (OpenBoundaryResponse);
// Freeze the workload, retain its state, and fence the old generation before
// returning. The caller credential must match the active boundary. The
// compute driver owns storage and handoff of the reference bytes; the backend
// owns placement and retention of the state itself. Fenced means old-generation
// calls and streams are rejected and the old workload cannot make progress.
rpc SuspendBoundary(SuspendBoundaryRequest) returns (SuspendBoundaryResponse);
// Prepare a suspended boundary using the fresh launch in ResumeBoundaryRequest.
// Validate the reference and reserve its binding without executing workload
// instructions. The backend may defer actual restoration until StartAgent,
// after Attach and Confirm have admitted the new generation's policy.
// Restore failures discovered then fail StartAgent; preparing a boundary does
// not guarantee that restoration will succeed. An eagerly restored workload
// must remain frozen until StartAgent. Unsupported optional suspend/resume
// RPCs return UNIMPLEMENTED without advancing lifecycle state.
rpc ResumeBoundary(ResumeBoundaryRequest) returns (OpenBoundaryResponse);
}
message DescribeIsolationBackendRequest {
openshell.extension.v1.PeerMetadata supervisor = 1;
}
message DescribeIsolationBackendResponse {
openshell.extension.v1.PeerMetadata backend = 1;
}
// Launch identity is issued by the gateway: session and generation are fresh
// for each launch and unchanged on retries. Sandbox and generation identity
// come from the verified sandbox bearer; backends must bind that identity to
// their own provisioned state.
message OpenBoundaryRequest {
string session_id = 2;
// Must match trusted admission and the configured endpoint registration.
string backend_name = 4;
// Opaque descriptor from the trusted compute driver. The backend validates
// its resource binding; workload-controlled input must not select it.
bytes driver_descriptor = 5 [(openshell.options.v1.secret) = true];
}
message OpenBoundaryResponse {
// Opaque handle scoped to this sandbox and runtime generation. The supervisor
// presents it when opening Sandbox Protocol streams.
string boundary_id = 1;
enum LaunchOutcome {
LAUNCH_OUTCOME_UNSPECIFIED = 0;
LAUNCH_OUTCOME_FRESH = 1;
LAUNCH_OUTCOME_RESTORED = 2;
LAUNCH_OUTCOME_COLD_START_FALLBACK = 3;
}
// Required. Selects the launch path; it is not proof of completed restoration.
// RESTORED may select a restore deferred until StartAgent. That call must
// either complete this path or fail. The selected path is immutable on replay;
// it must not silently change to a cold start if deferred restoration fails.
// COLD_START_FALLBACK may be selected only when explicitly permitted.
// Admission follows SandboxProtocol for every path.
LaunchOutcome outcome = 2;
}
message SuspendBoundaryRequest {
// Retries for this session and generation return the same reference or a
// terminal error.
string boundary_id = 1;
string session_id = 2;
string generation_id = 3;
}
message SuspendBoundaryResponse {
// Opaque protected state reference. It may be used only with an authorized
// ResumeBoundary request for the same sandbox and a fresh generation.
// A backend may invalidate superseded references; resuming one then fails
// terminally with FAILED_PRECONDITION rather than restoring a different state.
bytes restore_reference = 1 [(openshell.options.v1.secret) = true];
}
message ResumeBoundaryRequest {
// New launch identity and trusted driver descriptor, as defined by
// OpenBoundaryRequest; replays reuse this launch request.
OpenBoundaryRequest launch = 1;
// Reference returned by SuspendBoundary for this sandbox. It carries no
// authority without the new authenticated launch credential.
bytes restore_reference = 2 [(openshell.options.v1.secret) = true];
// If false, fail when the memory image cannot be restored. If true, a clean
// boot from the image and persistent volumes is permitted and reported as
// LAUNCH_OUTCOME_COLD_START_FALLBACK. This never permits unauthorized or
// superseded references to select a new launch.
bool restart_if_restore_fails = 3;
}