You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit db42b60
Browse filesBrowse the repository at this point in the historyBrowse files
Copy file name to clipboardExpand all lines: architecture/sandbox.md
+29-10Lines changed: 29 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,7 @@
1
1
# Sandbox
2
2
3
-
A sandbox is the runtime boundary where agent code executes. It is created by a
4
-
compute runtime and managed inside the workload by `openshell-sandbox`, the
5
-
sandbox supervisor.
3
+
A sandbox is the runtime boundary where agent code executes. A compute runtime
4
+
creates it, and `openshell-sandbox` operates it as one logical supervisor.
6
5
7
6
## Runtime Model
8
7
@@ -21,18 +20,38 @@ container-granted capabilities. This is fail-closed: the supervisor retains
21
20
aborts unless the bounding set ends up empty. A `setpcap``EPERM` is tolerated
22
21
only when the set is already empty; any other outcome fails the spawn.
23
22
23
+
Separated runtimes split the same logical supervisor into two placements:
24
+
25
+
| Mode | Placement and authority |
26
+
|---|---|
27
+
|`openshell-sandbox --mode=control`| Runs outside the workload boundary. Owns gateway credentials, the admitted policy, RFC 0012 lifecycle, network-policy decisions, SSH, and gateway relays. |
28
+
|`openshell-sandbox --mode=boundary --boundary-config <path>`| Runs inside or adjacent to the workload. Owns process launch and observation, exec signaling, PTY control, loopback forwarding, egress capture, and binary identity. It has no gateway credentials or independent policy authority. |
29
+
30
+
The compute driver provisions the two protected configurations and their private
31
+
Unix-socket, authenticated TCP, or vsock transport. All configurations carry the
32
+
same boundary ID, bootstrap credential, protocol version, and immutable driver resource claims.
33
+
The shared remote backend authenticates each request and rejects a resource-claim
34
+
mismatch. Driver crates do not appear in generic supervisor lifecycle, network,
35
+
SSH, or session code.
36
+
37
+
For cross-UID Unix-socket placements, the driver-owned parent directory limits
38
+
socket reachability and the bootstrap credential authenticates every request.
39
+
Boundary mode can re-own a bind-mounted config as root-only before starting the
40
+
workload when its host ownership could otherwise coincide with the workload UID.
41
+
24
42
## Startup Flow
25
43
26
44
1. The compute runtime starts the workload with sandbox identity, callback
27
45
endpoint, TLS or secret material, image metadata, and initial command.
28
-
2.The supervisor loads policy and runtime settings from local files or the
46
+
2.Control mode loads policy and runtime settings from local files or the
29
47
gateway, depending on mode.
30
-
3. It prepares filesystem access, process restrictions, network namespace
31
-
routing, trust stores, provider credential resolution, and inference routes.
32
-
4. It launches the persisted canonical main-process argv and retains its PTY
33
-
or pipes in the main-session multiplexer.
34
-
5. It starts the policy proxy and local SSH server.
35
-
6. It opens a supervisor session back to the gateway for connect, exec, file
48
+
3. The isolation backend attaches and confirms standing enforcement. Boundary
49
+
mode prepares boundary-local filesystem, process, and egress controls.
50
+
4. Control mode starts the admitted main process through the backend. Boundary
51
+
mode applies launch-time controls before its first untrusted instruction.
52
+
5. Control mode starts the policy proxy and local SSH server. Exec and loopback
53
+
streams cross the shared boundary protocol when the modes are separated.
54
+
6. Control mode opens a supervisor session back to the gateway for connect, exec, file
0 commit comments