Repository navigation
feat(openshell-provider): grant sandboxes verified cluster Service addresses - #13128
Merged
Merged
Conversation
…dresses A cluster model is reached by a <name>.svc.cluster.local host, so a sandbox policy could not grant its ClusterIP, and nothing checked which Service owned the address. The Services hook gains validate_cluster_source and cluster_addresses; DockerServices rejects both, so the bundled providers reject every cluster source until a cluster implementation is injected. - openshell_provider_profile gains an optional, bound cluster_source. Its profile accepts only an http://<host>.svc.cluster.local:<port>/v1 endpoint and grants only unicast Service addresses the hook returns; refresh re-reads the addresses and rejects a profile whose grant no longer matches. - The sandbox policy gains cluster_grants: managed rules whose allowed_ips come from the deployment's own verified cluster profile. Create and refresh check each grant; removal checks only the recorded policy. Split from #13060, with unit tests for the cluster profile and grant checks. Co-authored-by: Hai Nguyen <haingu@nvidia.com>
Contributor
|
v1 documentation preview: https://nvidia-preview-nemoclaw-v1-pr-13128.docs.buildwithfern.com/nemoclaw |
gaveezy
added a commit
that referenced
this pull request
Oct 14, 2026
PR-6 and PR-7 merged v1 after #13060 was closed in favor of #13125, #13126, #13127, and #13128. This merge brings v1's versions of that code into PR-8; git merged it without conflicts. #13128 added SDK-free cluster tests to the `tests` module of `crates/openshell-provider/src/profile.rs`, next to PR-8's tests built from the SDK. Four names are now defined twice there, so that module does not compile at this commit. The next commit resolves them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
gaveezy
added a commit
that referenced
this pull request
Oct 14, 2026
## Why Merging PR-7 brought in the SDK-free cluster tests that #13128 added to the `tests` module of `crates/openshell-provider/src/profile.rs`. PR-8 defines `cluster_case` and three tests with the same names in that module, so its library tests did not compile: E0428 for the 4 names, and E0061 at the 6 zero-argument `cluster_case()` calls. ## Change - Remove `owned_cluster_profiles_reject_non_service_addresses`. Its three addresses are among those that #13128's `owned_cluster_profiles_grant_exact_observed_addresses_and_reject_others` rejects, through the same `service_address_allowed` check in `cluster_definition`. It asserts nothing about the rows the SDK compiles. - Rename PR-8's `cluster_case(example)` to `sdk_cluster_case`, and add an `sdk_` prefix to the three tests whose names #13128 also uses: `profile_removal_validates_recorded_grants_when_the_service_is_absent`, `cluster_sandbox_grants_require_the_matching_owned_profile_and_exact_host_addresses`, and `sandbox_refresh_verifies_current_grants_but_removal_uses_recorded_policy`. They run on the rows the SDK compiles from `examples/kubernetes/local-vllm.yaml` and `local-ollama.yaml` and assert that the provider accepts them. #13128's fixture rows cannot check that, so the tests stay. Production code is unchanged. ## Validation - Without this commit, `cargo test -p openshell-provider --lib` failed to compile with the 10 errors above. With it, the 51 `openshell-provider` library tests pass, and `cargo fmt --check` and `cargo clippy -p openshell-provider --tests -- -D warnings` pass. - Allowing broadcast or IPv4-mapped addresses in `service_address_allowed`, or skipping the address check in `cluster_definition`, failed the removed test and #13128's test alike. - Not recording sandbox cluster grants in the SDK's `policy_input` failed `sdk_cluster_sandbox_grants_...`, `sdk_sandbox_refresh_...`, and `cluster_sandbox_create_request_is_accepted_beside_its_provider_profile`. Not emitting `cluster_source` in the SDK's `inference_targets` also failed `sdk_profile_removal_...`. #13128's tests and the removed test passed under both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Oct 14, 2026
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.
An OpenShell provider profile can now carry a verified cluster source, and a sandbox policy can grant that cluster Service's verified addresses. The bundled providers use
DockerServices, which rejects every cluster source, so Docker and Podman deployments are unchanged until a clusterServicesimplementation is injected (#13063).Why
#12736 routes sandboxes to vLLM and Ollama Pods that the deployment runs in its cluster. A cluster model is reached by a
<name>.svc.cluster.localhost, so an inference profile, which grants only the literal IP in its endpoint URL, could not grant the Service's ClusterIP, and nothing checked which Service owned the address.What changes
Serviceshook: addsvalidate_cluster_sourceandcluster_addressesto the trait from refactor(openshell-provider): inject credential services into the OpenShell and Fabric providers #13127.DockerServicesreturnsBindingMismatchfrom both.openshell_provider_profilegains an optional, computedcluster_source.nemoclaw_openshell::profile::cluster_definitionaccepts only anhttp://<host>.svc.cluster.local:<port>/v1endpoint without credentials, query, or fragment, and grants only the addressesServices::cluster_addressesreturns.service_address_allowedrejects unspecified, loopback, multicast, link-local, broadcast, and IPv4-mapped addresses.nemoclaw.nvidia.com/cluster-sourceandcluster-addressesannotations. Refresh re-reads the addresses and rejects a profile whose endpoints no longer match them.PolicyInput.cluster_grantsnames managed rules whoseallowed_ipscome from verified cluster profiles (RuntimeBinding::granted_policy: one or two unique/32or/128addresses per rule). Sandbox create (create_sandbox_request) and refresh (checked_sandbox_row_with) check each grant against the deployment's own profile: same owner, listed among the sandbox's providers, and the same endpoint apart fromallowed_ips. Removal checks only the recorded policy, so it works when the Service is gone. The field is omitted from serialized policy when empty.image_runtime::policy_inputsetscluster_grants: Default::default().Breaking or user-visible changes
openshell_provider_profilegainscluster_source, and theopenshell_sandboxpolicyblock gainscluster_grants. With the bundledDockerServices, a profile withcluster_sourceor a sandbox withcluster_grantsfails on create and read (docker_services_reject_cluster_profiles).cluster_grantsis not serialized when empty, and a profile without a cluster source writes no new annotations.nemoclaw_openshell::runtime::PolicyInputgains the publiccluster_grantsfield, so struct literals need it. The crates arepublish = false.Validation
cargo cipassed on this tree (linux_amd64): 1462 tests and 136 lifecycle tests.New tests:
nemoclaw-providerrefresh::profile_refresh_preserves_the_bound_cluster_sourcev1before this PR: state becomessubstituted-service.refresh::changing_from_cluster_to_external_inference_replaces_the_owned_profilev1before this PR: plannedcluster_sourcestaysowned-cluster-storage.nemoclaw-openshellprofile::tests::cluster_profiles_accept_only_plain_service_endpoints_and_unicast_addressesopenshell-providerprofile::tests::docker_services_reject_cluster_profilesowned_cluster_profiles_grant_exact_observed_addresses_and_reject_others/32and/128grants; no broader observed grant.cluster_grants_resolve_the_endpoint_ambiguity_with_the_provider_profileprofile_removal_validates_recorded_grants_when_the_service_is_absentcluster_sandbox_grants_require_the_matching_owned_profile_and_exact_host_addressessandbox_refresh_verifies_current_grants_but_removal_uses_recorded_policyfabric-providerconfigured_provider_observes_cluster_grants_through_its_injected_servicesFabricProvider::with_serviceskeeps the cluster methods.Each production check was mutated once, and a new test failed each time: the
granted_policyaddress filter,cluster_grantendpoint equality, the sandbox refresh grant comparison, the profile refresh endpoint comparison, the.svc.cluster.localhost check, and thevalidate_cluster_sourcecall.The openshell-provider tests build the cluster case from the
fabric-openclawcontract fixture, so they need no SDK types. #13063 can keep or replace them with its SDK-built cases.Split from #13060 (Hai Nguyen's work; co-authored). Follows #13125, #13126, and #13127.