Skip to content

ux(cli): rule get lists only advisor proposals and policy get omits the payload by default, so 'no network rules' misleads #4927

Open

Description

@youyouhe

User Story

I operate sandboxes and need to answer one question quickly: which network destinations may this sandbox reach right now?

I directly encountered that neither openshell rule get nor the default openshell policy get answers it. rule get returns only the advisor's proposal chunks, and policy get prints five lines of metadata with no policy body — so both look like "there are no rules" even when the sandbox carries an explicit network_policies document.

Problem Statement

Given a sandbox created with a policy that defines several network_policies entries (pypi.org, registry.npmjs.org, plus wildcard endpoints):

  1. openshell rule get <sandbox> lists only advisor/approve-workflow proposals. Static rules from the policy document are absent:
$ openshell rule get viztest | grep -cE 'pypi\.org|registry\.npmjs'
0
$ openshell rule get viztest
Network Rules:  (version 1, 1 chunk)
  Chunk: ...            # only proposals appear here
  1. openshell policy get <sandbox> prints metadata only and never the rules:
$ openshell policy get viztest
Version:      1
Hash:         ab45c42d...
Status:       Effective
Source:       sandbox
Config rev:   12382332441607749130
  1. The payload is only reachable with an extra flag, or through a different command:
$ openshell policy get viztest --full | grep -c network_policies
1
$ openshell sandbox get viztest | grep -c network_policies
1

So the information exists; two commands whose names suggest they show rules do not show the effective rules, and nothing in their default output hints that a payload was omitted.

Impact / Why This Matters

  • During incident triage, "No network rules" reads as "nothing is allowed", while a static policy may in fact be allowing traffic. That misleads the person investigating a denial and can send them looking for a policy bug that does not exist.
  • Conversely, an operator who wants to enumerate allowed destinations has to already know about --full (or that sandbox get prints the policy). There is no discoverable command for "what is allowed right now".
  • Two similar concepts share similar names — proposal/approve-workflow rules and policy-embedded endpoints — and rule get returns only the former. That namespace split is not visible from the command output.

Acceptance Criteria

  • openshell policy get <name> shows the effective policy body (including network_policies) by default, or states explicitly that the payload is omitted and names the flag that prints it.
  • openshell rule get <name> also reports endpoints that come from the policy document, or is renamed/relabelled so it is clear it lists only pending/approved proposals.
  • One documented command answers "which network destinations may this sandbox reach right now?" and its output is machine-readable with -o json.

Reproduction Steps

  1. Create a policy file that defines at least one network_policies entry, e.g. one endpoint pypi.org:443.
  2. openshell sandbox create --name viztest --policy ./policy.yaml -- sh -c 'sleep 600'.
  3. openshell rule get viztest → the static endpoint does not appear.
  4. openshell policy get viztest → metadata only (five lines).
  5. openshell policy get viztest --full and openshell sandbox get viztest → both contain network_policies.

Suggested UX

Make the default payload explicit, and keep a terse mode for scripting:

$ openshell policy get viztest            # full effective policy (current --full behaviour)
$ openshell policy get viztest --summary  # current metadata-only output

or keep the default and add a one-line footer:

Policy payload omitted (3 network rules, 1 filesystem policy); use --full to print it.

Environment

  • OpenShell 0.1.5 (CLI, gateway, supervisor, sandbox runtime all 0.1.5)
  • Gateway: local, mTLS, Docker compute driver 29.9.2 (cgroup v2), single host
  • Host OS: Windows 10 22H2 (19045.3803) with WSL 2.9.13, Ubuntu 24.04, kernel 6.18.40.1-microsoft-standard-WSL2
  • Sandbox image: Ubuntu 24.04 based

Activity

  1. youyouhe commented on Oct 26, 2026

    @youyouhe
    Author

    Additional evidence and environment

    Environment

    Same deployment as #4926:

    Item Value
    OpenShell CLI / gateway / supervisor / sandbox all 0.1.5
    Gateway local, mTLS, Status: healthy, driver docker 0.1.5
    Docker 29.9.2, cgroup=systemd/2, runc
    Host Windows 10 Pro 22H2 (19045.3803) + WSL 2.9.13
    Guest Ubuntu 24.04.3 LTS, kernel 6.18.54.1-microsoft-standard-WSL2

    Reproduction, with verbatim output

    Sandbox ev4926 was created with a policy document containing one network_policies entry (registry.npmjs.org:443, later protocol: rest).

    1. rule get reports no rules at all

    $ openshell rule get ev4926
    No network rules for sandbox 'ev4926'

    The sandbox does have a network rule; it lives in the policy document rather than in the proposal inbox. On sandboxes that also carry advisor proposals the same command switches to a Network Rules: (version N, M chunks) listing that still omits the policy-embedded endpoints:

    $ openshell rule get viztest | grep -cE 'pypi\.org|registry\.npmjs'
    0

    2. policy get default output carries no payload and no hint that a payload exists

    $ openshell policy get ev4926
    Version:      1
    Hash:         d3ec871c3b746880466c52b908752b1e7f9ecf4a15cc34d7693180645ee150e1
    Status:       Effective
    Source:       sandbox
    Config rev:   9183319447513175676
    • output length: 5 lines
    • occurrences of network_policies: 0

    3. The payload exists behind an opt-in flag, or behind a different command

    $ openshell policy get ev4926 --full | grep -c network_policies
    1
    
    $ openshell sandbox get ev4926 | grep -c network_policies
    1

    4. The flags are documented, but nothing in the default output points at them

    $ openshell policy get --help
          --rev <REV>   Show a specific stored policy revision. Default shows the current effective policy
          --full        Include the effective policy payload, including provider-composed entries
          --base        Include the base policy payload without provider-composed entries

    Why the wording matters operationally

    No network rules for sandbox 'ev4926' is the literal string an operator sees while a static policy is actively allowing traffic. In our own triage this read as "nothing is allowed", which pointed the investigation at the policy engine instead of at the destination. The inverse is equally costly: enumerating what a sandbox may reach requires already knowing about --full, because no command advertises it.

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:triage-neededOpened without agent diagnostics and needs triage

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions