Skip to content

fix(sdk): leave inference destination checks to OpenShell - #13260

Merged
cv merged 1 commit into
v1from
feat/openshell-destinations
Oct 15, 2026
Merged

cv merged 1 commit into
v1from
feat/openshell-destinations

Conversation

@cv

@cv cv commented Oct 15, 2026

Copy link
Copy Markdown
Collaborator

Closes #13232. Part of #13131.

Failure

NemoClaw applied its own address rule to every inference endpoint it handed to OpenShell: plain HTTP only to a literal loopback or private IP, no link-local, unspecified, or multicast address, and no metadata host. OpenShell already validates destinations when sandboxes connect, against the address each one resolves to. NemoClaw's rule duplicated that, and contradicted it by rejecting destinations OpenShell supports by design: its gateway-host alias host.openshell.internal, exactly declared private hosts, and container-network names.

One gap is real: as far as I can tell, OpenShell substitutes credentials into plain-HTTP requests without checking the scheme or whether the destination is public (openshell-supervisor-network, proxy.rs, at the pinned revision). Following the decision on #13232, NemoClaw doesn't add validation OpenShell doesn't perform, so this PR doesn't keep a narrower rule for that case.

Decision

  • Shape check. nemoclaw_backend::validate_endpoint_url checks only an endpoint's shape: a parseable HTTP or HTTPS URL with a host; no credentials, query, or fragment, which keeps secrets out of state; and no characters OpenTofu would interpolate.
  • Handed-off endpoints use it: inference profiles in nemoclaw-openshell, external providers in YAML, managed services' published endpoints, the Ollama proxy's published endpoint, and onboarding's endpoint answer.
  • NemoClaw's own connections keep validate_endpoint, which is the shape check plus the existing policy: the gateway endpoint, catalog discovery from the user's machine, and the Ollama proxy's upstream.
  • Docs and example. The configuration reference (regenerated), docs/provider.md, and the travel example say OpenShell checks inference destinations. The example now defaults its sandbox endpoint to http://host.openshell.internal:11434/v1.

Validation

  • New tests failed before the change:
    • a profile accepts http://host.openshell.internal:11434/v1, http://ollama:11434/v1, and http://inference.example.com/v1 without pinning IPs;
    • validate_endpoint_url accepts them while validate_endpoint still rejects them, and both reject credentials, queries, file: URLs, and interpolation;
    • an external provider in YAML compiles each of them unchanged.
  • Plain cargo ci passes locally: 1540 unit tests and 144 lifecycle tests.

NemoClaw validated the addresses of inference endpoints it hands to
OpenShell, duplicating OpenShell's destination checks and rejecting
destinations it supports, such as host.openshell.internal. Those
endpoints now get only URL shape checks (validate_endpoint_url); the
gateway, catalog discovery, and the Ollama proxy's upstream, which
NemoClaw connects to itself, keep the full policy. The travel example
defaults its sandbox endpoint to host.openshell.internal.
@cv
cv enabled auto-merge (squash) October 15, 2026 11:33
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 1adeb72 into v1 Oct 15, 2026
@cv
cv deleted the feat/openshell-destinations branch October 15, 2026 11:49
@wscurran wscurran added area: providers Inference provider integrations and provider behavior area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression labels Oct 15, 2026
cv added a commit that referenced this pull request Oct 15, 2026
Closes #13236. Part of #13131.

## Failure

When an inference server's certificate came from a CA the control host
doesn't trust, such as an organization's internal CA, catalog checks
reported "inference endpoint could not be reached from the control
host". That pointed operators at the network instead of the certificate,
and nothing said how to fix it. This affects plan's catalog reads,
onboarding suggestions, and `openshell_external_inference_server`.

## Decision

Keep trust where it already lives, and say so clearly:

- **Inference traffic:** the OpenShell gateway and sandboxes carry it,
and at the pinned revision OpenShell has no per-provider CA setting; its
images' trust stores decide. A NemoClaw-side CA setting would let
NemoClaw's checks pass while OpenShell's traffic fails, so this adds
none.
- **NemoClaw's own checks** already use the control host's system trust
store, which honors `SSL_CERT_FILE`.
- **A specific error:** the catalog reader now recognizes a rejected
certificate in the request's error chain. It reports "the inference
server's certificate is not trusted by the control host; add its CA to
the system trust store or set SSL_CERT_FILE to a bundle that includes
it". The check walks nested I/O errors, whose `source()` skips the error
each one wraps. Every caller of the catalog reader gets the new message.
- **Docs:** `docs/inference.md` gains "Trust a Custom Certificate
Authority", covering both places that need the CA. Two lines in
`docs/inference.md` and `docs/usage.md` still stated NemoClaw's old
address rule for uncredentialed HTTP endpoints, which #13260 removed;
they now say OpenShell decides which destinations a sandbox can reach.

## Validation

- New test `an_untrusted_certificate_names_how_to_trust_it` serves a
self-signed certificate. It failed before the change with the generic
unreachable reason.
- `cargo ci` passes locally: 1529 unit tests, 145 lifecycle tests.
- `fern check`: 0 errors, and the same single warning as before.
@wscurran wscurran added the v1 NemoClaw v1 branch label Oct 28, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: providers Inference provider integrations and provider behavior area: security Security controls, permissions, secrets, or hardening bug-fix PR fixes a bug or regression v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants