feat(sandbox): add the Local and Kubernetes backends and the cloud bindings - #401
Open
ItamarZand88 wants to merge 1 commit into
Open
Conversation
Greptile SummaryThe PR adds executable sandbox sessions across Local, Kubernetes, AWS, Azure, and GCP, including cloud API clients, lifecycle handling, command transport, and capability-based access.
Confidence Score: 5/5The PR appears safe to merge because no blocking failure remains from the previously reported issues. No blocking failure remains.
|
| Filename | Overview |
|---|---|
| crates/alien-bindings/src/providers/sandbox/azure.rs | Implements Azure session execution and lifecycle handling, including deadline-triggered deletion and polling until confirmed absence. |
| crates/alien-azure-clients/src/azure/sandbox_data_plane.rs | Adds the Azure sandbox data-plane client with structured HTTP errors that support reliable 404 classification. |
| crates/alien-bindings/src/providers/sandbox/aws.rs | Implements Lambda MicroVM sessions with image-scoped ownership checks, endpoint-token authorization, lifecycle operations, and preview capabilities. |
| crates/alien-bindings/src/providers/sandbox/kubernetes.rs | Adds the Kubernetes application binding for broker-mediated session claims and agent access. |
| crates/alien-infra/src/sandbox/kubernetes_broker.rs | Adds broker-side Kubernetes authentication, warm-pod claiming, and session capability minting. |
| crates/alien-local/src/sandbox_manager.rs | Adds Docker-backed local sandbox creation, isolation, execution, and teardown management. |
Sequence Diagram
sequenceDiagram
participant App as Application
participant Binding as Sandbox binding
participant Backend as Local/Cloud backend
participant Agent as Sandbox agent
App->>Binding: create/get session
Binding->>Backend: allocate or claim sandbox
Backend-->>Binding: session identity
App->>Binding: run command with deadline
Binding->>Agent: authenticated command
Agent-->>Binding: output and exit status
Binding-->>App: command stream/result
App->>Binding: terminate
Binding->>Backend: delete session
Backend-->>Binding: absence confirmed
Reviews (11): Last reviewed commit: "feat(sandbox): add the Local and Kuberne..." | Re-trigger Greptile
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 18:40
231ec0c to
a212c6a
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 18:40
07f5db1 to
26ebf34
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 18:49
a212c6a to
c3c2316
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 18:49
26ebf34 to
897288c
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 19:16
897288c to
47f9964
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 19:16
c3c2316 to
0cea165
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 19:24
0cea165 to
f5a829c
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 19:24
47f9964 to
96b985f
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 19:49
f5a829c to
29e5d1f
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 19:49
96b985f to
1768f9a
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 20:08
29e5d1f to
f81e5a8
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 20:08
1768f9a to
9f7d79b
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 21:22
f81e5a8 to
64d4aeb
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
2 times, most recently
from
August 11, 2026 21:26
b55c83c to
9669ebd
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 21:26
64d4aeb to
11c5234
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 22:16
9669ebd to
c20d836
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 22:16
11c5234 to
469d8cf
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-5-backends
branch
from
August 11, 2026 22:24
469d8cf to
a7c48f5
Compare
ItamarZand88
force-pushed
the
itamar/alien-75-sandbox-4-emitters
branch
from
August 11, 2026 22:24
c20d836 to
e80b966
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the code that actually runs a sandbox session: the Local and Kubernetes backends, and the bindings an application calls on AWS, Azure and GCP. Layer 4 rendered the infrastructure; this makes a session start, run a command, and stop.
When an application asks a Kubernetes sandbox to run something:
TokenReview, takes a warm pod from the pool, and labels it with the session.What I did
Three decisions are worth pointing at, each of which came out of a review finding rather than a plan:
denywas accepted and dropped, leaving a stack reading as restricted while the code ran with open egress. Azure now publishesfalsefor both capabilities, which turns the declaration into a plan-time refusal.allowis still accepted: it asks for no restriction, so a backend that ignores it fails loudly on the first blocked connection rather than quietly under-protecting.A fourth is smaller but had the same cause: the Azure
gettreated any error whose rendered text contained404as "session gone", and the data plane formats the whole response body into that text. A throttle, or a path containing404, read as gone — which starts a second sandbox while the first keeps running. The status is carried structurally now.Files touched
crates/alien-infra/src/sandbox/— the Kubernetes controller, warm pool, session broker and its route.crates/alien-local/— the Docker-backed local manager and its loopback route.crates/alien-bindings/src/providers/sandbox/— the five backends behind one trait.crates/alien-k8s-clients/,crates/alien-aws-clients/,crates/alien-azure-clients/— the API surfaces those call.How I tested
cargo testacross the touched crates — the Kubernetes broker, warm pool, path confinement, capability minting and the five providers.true, removing the chart's ingress rule, and reverting the404classifier to substring matching. Each fix has a test that fails without it.#[ignore]d, run by hand): a real GKE Autopilot cluster for the Kubernetes backend, and Docker for the Local one.Security review of this diff, since it mints the credential that reaches inside a session:
kubernetes_route.rs).authenticated: false, so the verdict is read rather than the status code, and namespace matching is a full-prefix check.One thing this diff does not close, stated plainly rather than left to a reader: the broker authenticates the caller but does not check which sandbox it may claim from.
claimverifies a ServiceAccount in the deployment's namespace and then takes thesandboxIdfrom the request. Binding an authenticated identity to an entitled set of sandboxes needs state the broker does not have yet.