NemoClaw icon indicating copy to clipboard operation
NemoClaw copied to clipboard

[Feature]: Add `nemoclaw policy add <preset>` command for incremental policy management

Open nv-ddave opened this issue 7 months ago • 3 comments

Description

When deploying features that need new network access (e.g., Slack bot), the sandbox network policy needs updating. The expected workflow would be:

nemoclaw policy add slack

But the NemoClaw CLI has no policy subcommand — policy management must go through openshell directly, which replaces the entire policy on every set.

Current Workflow

  1. Manually inspect the 200+ line existing policy YAML
  2. Manually merge the new preset (e.g., presets/slack.yaml) into the existing policy
  3. Apply the complete merged file: openshell policy set --policy merged.yaml --wait my-assistant

Missing any existing policy in the merge means silently losing that network access.

Proposed Workflow

nemoclaw policy add slack        # adds Slack preset to current policy
nemoclaw policy add nvidia_forum # adds forum preset
nemoclaw policy list             # shows active policies
nemoclaw policy remove discord   # removes Discord preset

The presets already exist at nemoclaw-blueprint/policies/presets/ — they just need a CLI command to apply them incrementally.

nv-ddave avatar Apr 06 '26 15:04 nv-ddave

Additionally it would be nice to provide more presets while onboarding. Currently i apply the following hack to add this to the install script.

      sed -i '/^run_onboard() {$/a\
        mkdir -p "$HOME/.nemoclaw/source/nemoclaw-blueprint/policies/presets"\
        cp -a /run/scripts/presets/. "$HOME/.nemoclaw/source/nemoclaw-blueprint/policies/presets/"' \
        /tmp/nemoclaw-install.sh
      bash /tmp/nemoclaw-install.sh

But an Env Var to load a custom folder would keep the presets seperate and a path for custom policies with nemoclaw policy so they dont need to be added to /nemoclaw-blueprint/policies/presets

snapydziuba avatar Apr 07 '26 16:04 snapydziuba

@nv-ddave , These commands already exist. Does that align with your proposed commands?

    nemoclaw <name> policy-add       Add a network or filesystem policy preset
    nemoclaw <name> policy-list      List presets (● = applied)

zyang-dev avatar Apr 07 '26 16:04 zyang-dev

Closing this since the requested commands already exist.

zyang-dev avatar Jun 24 '26 18:06 zyang-dev