Skip to content

Hostless web egress conflicts with a pinned provider endpoint #4662

Open

Description

@rsliter

User Story

I use OpenShell through NemoClaw with a custom HTTPS inference provider. I need its exact IP pins and request restrictions alongside broad web access for a trusted personal sandbox.

Problem Statement

NemoClaw's Personal preset grants broad TCP egress on ports 80 and 443 to trusted personal sandboxes. OpenShell 0.1.3 rejects this hostless rule after HTTPS provider attachment when their allowed_ips lists differ (NemoClaw #13349).

OpenShell permits request-level overlaps when connection settings agree. This pair conflicts on allowed_ips.

For example, the provider pins example.com:443 to 172.66.147.243. The hostless Personal rule covers port 443 and includes 172.0.0.0/6, which contains that IP. The lists differ, so OpenShell rejects the update even though the pinned IP is within Personal's range.

Impact / Why This Matters

The agent loses Personal web access while the prior policy remains active. Matching the provider's list to Personal's would remove its exact pins.

Acceptance Criteria

  • A hostless web rule can coexist with a provider endpoint that retains its exact IP pins, REST restrictions, and credential binding.
  • Public web access works; provider requests outside its permitted IPs or paths and always-blocked destinations remain denied.
  • Invalid combinations still fail atomically with an actionable reason.

Reproduction Steps

  1. On OpenShell 0.1.3, create a sandbox and attach a REST provider for example.com:443 with allowed_ips: [172.66.147.243], a /v1/** selector, and a placeholder credential.
  2. Submit a policy with a hostless endpoint on ports 80 and 443 and allowed_ips: [172.0.0.0/6]: openshell policy set --policy <policy.yaml> <sandbox> --wait. NemoClaw's Personal preset contains that range.
  3. Observe network endpoint ambiguity validation failed on allowed_ips. The prior policy version and hash remain active. Native test details.

Environment

  • Native reproduction: OpenShell 0.1.3, macOS ARM64, Docker Desktop gateway and sandbox; disposable resources removed.
  • Latest release 0.1.4 has the same allowed_ips comparison. We have not rerun the native reproduction on 0.1.4.

Potential solutions for consideration

  1. Combine address restrictions: Require the resolved address to satisfy each matching allowed_ips list. Keep request and credential decisions separate.
    For example, example.com:443 at 172.66.147.243 passes both checks; another address in 172.0.0.0/6 fails the provider pin.

  2. Exclude provider hosts from the broad rule: Let the provider endpoint own its host while the hostless rule covers other hosts. This needs a defined exclusion mechanism and behavior when providers attach or detach.
    For example, example.com:443 uses only the provider rule, while news.example:443 uses Personal.

Which model fits OpenShell's rule composition? How should absent allowed_ips, different matching binaries, and L4 beside inspected REST rules behave? Are there other approaches we could consider?

Activity

  1. added
    state:triage-needed
    on Oct 16, 2026
  2. purp commented on Oct 17, 2026

    @purp
    Contributor

    📋 triage-agent

    Classification: validated-feature (design gap; the rejection itself is intentional)

    The User Story gives first-hand use (OpenShell through NemoClaw with a custom HTTPS inference provider). It also covers impact, the workaround's limits, acceptance criteria, and a native reproduction on 0.1.3. The code path is the same on 0.1.4 and on main at b58e24c9d: crates/openshell-policy/src/ambiguity.rs and sandbox-policy.rego have no diff between v0.1.4 and main.

    What the source confirms

    • A hostless endpoint overlaps every host (host_patterns_overlap, ambiguity.rs:399). connection_conflicts (ambiguity.rs:166-186) compares allowed_ips as exact normalized sets, without regard to containment or binaries. So [172.66.147.243] vs [172.0.0.0/6, ...] on port 443 is rejected. The tests allowed_ip_conflict_is_rejected_regardless_of_order (:900) and different_binary_lists_do_not_hide_endpoint_ambiguity (:1047) pin this behavior.
    • The check exists because the runtime takes a single config. matched_endpoint_config := _matching_endpoint_configs[0] (sandbox-policy.rego:1013) supplies the one allowed_ips list that proxy.rs:3910 uses for destination validation. Both endpoints match example.com:443, since a hostless endpoint with allowed_ips matches on port alone (rego:1070). If the validator were relaxed without changing the runtime, rule order would decide whether the provider pin or the broad range applies.
    • Dropping the provider's allowed_ips is not a workaround either. The provider endpoint still carries credential/L7 metadata, and [] vs [ranges] is still a conflict. Only identical lists pass, which removes the pin, as the report says.

    The behavior is therefore expected under the current design, and the request is a valid feature: composing a broad hostless rule with a pinned provider endpoint. Both proposed directions would need runtime changes, not just validator changes:

    1. Intersection of matching allowed_ips. Rego/proxy would have to return and evaluate every matching list. Hosted and hostless allowed_ips also mean different things: on a hosted endpoint it is an SSRF allowlist for resolved addresses, while on a hostless one it is the match criterion. That difference matters when defining "absent" lists.
    2. Provider endpoint owns its host. Precedence by host specificity, similar to the existing path-specificity rule in ambiguity.rs, would avoid an explicit exclusion list. It still needs a defined answer for binaries and for L4 beside REST.

    Related: #3856, an open request to allow any public host except a deny list, which covers the same broad-egress use case from the other direction.

    Next human decision: whether to accept this, and which composition model to pursue. The open questions in the issue (absent allowed_ips, differing binaries, L4 beside inspected REST) are design questions rather than missing evidence. A create-spike could answer them if a maintainer wants a concrete proposal first.

  3. added
    state:validated
    and removed
    state:triage-needed
    on Oct 17, 2026
  4. github-actions commented on Nov 15, 2026

    @github-actions

    This issue has had no activity for 28 days and is now marked stale. It may be closed in 14 days if there is no further activity. Comment or remove the state:stale label to keep it open.

  5. added
    state:stale
    on Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    state:stalestate:validated

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions