Skip to content

docs(network-policy): fix incorrect CLI usage for presets and dynamic policy updates#1036

Open
vl43den wants to merge 4 commits intoNVIDIA:mainfrom
vl43den:docs/fix-policy-cli-usage
Open

docs(network-policy): fix incorrect CLI usage for presets and dynamic policy updates#1036
vl43den wants to merge 4 commits intoNVIDIA:mainfrom
vl43den:docs/fix-policy-cli-usage

Conversation

@vl43den
Copy link
Copy Markdown

@vl43den vl43den commented Mar 28, 2026

Summary

The preset application instructions in docs/network-policy/customize-network-policy.md show incorrect CLI commands for applying dynamic policy updates and presets.
Following the current instructions produces parse errors from the OpenShell CLI.
This PR corrects the command syntax, adds the missing version field requirement for custom policies, and replaces the broken preset workflow with the correct nemoclaw <name> policy-add command.

Changes

  • Fix openshell policy set -> openshell policy set --policy <policy-file> <name> (missing flag and positional argument).
  • Add note that custom policy YAML files must include the mandatory version field (e.g., version: 1).
  • Replace broken openshell policy set <preset.yaml> instructions with nemoclaw <name> policy-add <preset>.
  • Add concrete example: nemoclaw my-assistant policy-add pypi.
  • Add nemoclaw policy-list usage.
  • Add admonition explaining why openshell policy set rejects preset files (the preset: metadata block is NemoClaw-specific, not part of the OpenShell policy schema).

Type of Change

  • Code change for a new feature, bug fix, or refactor.
  • Code change with doc updates.
  • Doc only. Prose changes without code sample modifications.
  • Doc only. Includes code sample changes.

Testing

  • npx prek run --all-files passes (or equivalently make check).
  • npm test passes.
  • make docs builds without warnings. (for doc-only changes)

Reproduced on a live NemoClaw sandbox (Ubuntu 24.04, DigitalOcean s-4vcpu-8gb)

image

Checklist

General

Code Changes

  • Formatters applied — npx prek run --all-files auto-fixes formatting (or make format for targeted runs).
  • Tests added or updated for new or changed behavior.
  • No secrets, API keys, or credentials committed.
  • Doc pages updated for any user-facing behavior changes (new commands, changed defaults, new features, bug fixes that contradict existing docs).

Doc Changes

  • Follows the style guide. Try running the update-docs agent skill to draft changes while complying with the style guide. For example, prompt your agent with "/update-docs catch up the docs for the new changes I made in this PR."
  • New pages include SPDX license header and frontmatter, if creating a new page.
  • Cross-references and links verified.

Summary by CodeRabbit

  • Documentation
    • Require a top-level version field in dynamic YAML policy files.
    • Update OpenShell CLI syntax to use openshell policy set --policy <file> <name>, adding an explicit sandbox/name parameter.
    • Replace applying preset YAML directly with NemoClaw preset subcommands: nemoclaw <name> policy-add <preset> and nemoclaw <name> policy-list.
    • Clarify that preset YAMLs containing preset: must be applied via NemoClaw commands (example: pypi).

vl43den added 2 commits March 28, 2026 00:58
… policy updates

Clarify commands for applying network policies and presets.
Clarified commands for applying policies and presets, added examples for better understanding.
@vl43den vl43den changed the title Docs/fix policy cli usage docs(network-policy): fix incorrect CLI usage for presets and dynamic policy updates Mar 28, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 28, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: cfbc7ce8-e031-439c-9105-b254bdc8d844

📥 Commits

Reviewing files that changed from the base of the PR and between 2b7eb0e and 6883867.

📒 Files selected for processing (1)
  • docs/network-policy/customize-network-policy.md
🚧 Files skipped from review as they are similar to previous changes (1)
  • docs/network-policy/customize-network-policy.md

📝 Walkthrough

Walkthrough

Documentation updates: dynamic policy YAMLs must include a top-level version; OpenShell CLI usage changes to openshell policy set --policy <policy-file> <name>; NemoClaw adds nemoclaw <name> policy-add and nemoclaw <name> policy-list for presets; note that preset YAMLs with preset: metadata must be applied via NemoClaw, not OpenShell.

Changes

Cohort / File(s) Summary
Policy Documentation Updates
\.agents/skills/nemoclaw-manage-policy/SKILL.md, docs/network-policy/customize-network-policy.md
Require top-level version in dynamic policy YAMLs. Change OpenShell invocation to openshell policy set --policy <policy-file> <name> (adds --policy flag and explicit sandbox/name). Replace applying preset YAMLs via OpenShell with NemoClaw subcommands: nemoclaw <name> policy-add <preset> and nemoclaw <name> policy-list. Clarify that OpenShell’s --policy cannot accept preset YAMLs containing a preset: metadata block.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐇 I nibble at docs, a tidy little mission,
Add a version, tweak the CLI’s position.
NemoClaw hops in to add presets with pride,
Policies lined up, neat by my side.
Hooray — the docs now take a joyful stride! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main changes: fixing incorrect CLI usage for presets and dynamic policy updates in network policy documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In @.agents/skills/nemoclaw-manage-policy/SKILL.md:
- Around line 157-164: The docs incorrectly show "nemoclaw <name> policy-add
<preset>" as if a preset can be passed positionally; update the SKILL.md usage
for the policy-add command to reflect the actual behavior of the policy-add
handler (the interactive prompt ignores extra positional args). Either remove
"<preset>" from the usage string and show "nemoclaw <name> policy-add" or
explicitly document that the command is interactive and that any positional
arguments are ignored; reference the "policy-add" command in the doc text so
readers know which command's behavior was changed.

In `@docs/network-policy/customize-network-policy.md`:
- Around line 118-125: The documented `policy-add` usage incorrectly shows a
positional `<preset>` argument; update the example and syntax to reflect the
actual interactive CLI behavior by changing `nemoclaw <name> policy-add
<preset>` to `nemoclaw <name> policy-add` and add a short note that preset
selection is interactive (as implemented in the policy-add command in
bin/nemoclaw.js and its interactive prompt handlers). If non-interactive preset
selection is later added, update the docs to document the new flag or argument
and an example invocation; for now remove the misleading positional argument and
keep the example showing `nemoclaw my-assistant policy-add` as an interactive
command.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: febb5dbb-fed1-4339-ac1a-3ad581bc1228

📥 Commits

Reviewing files that changed from the base of the PR and between 5f692e5 and 99154aa.

📒 Files selected for processing (2)
  • .agents/skills/nemoclaw-manage-policy/SKILL.md
  • docs/network-policy/customize-network-policy.md

Comment on lines +118 to +125
$ nemoclaw <name> policy-add <preset>
```

For example, to add PyPI access to a running sandbox:

```console
$ nemoclaw my-assistant policy-add pypi
```
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

policy-add syntax is documented with an unsupported positional argument.

The docs state nemoclaw <name> policy-add <preset>, but the CLI implementation for policy-add is interactive and does not consume <preset> as an argument (bin/nemoclaw.js:651-684, bin/nemoclaw.js:762-815). This can mislead users into thinking non-interactive preset selection is supported.

Suggested doc fix
-$ nemoclaw <name> policy-add <preset>
+$ nemoclaw <name> policy-add
-For example, to add PyPI access to a running sandbox:
+For example, to add PyPI access to a running sandbox, run the command and select `pypi` at the prompt:
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@docs/network-policy/customize-network-policy.md` around lines 118 - 125, The
documented `policy-add` usage incorrectly shows a positional `<preset>`
argument; update the example and syntax to reflect the actual interactive CLI
behavior by changing `nemoclaw <name> policy-add <preset>` to `nemoclaw <name>
policy-add` and add a short note that preset selection is interactive (as
implemented in the policy-add command in bin/nemoclaw.js and its interactive
prompt handlers). If non-interactive preset selection is later added, update the
docs to document the new flag or argument and an example invocation; for now
remove the misleading positional argument and keep the example showing `nemoclaw
my-assistant policy-add` as an interactive command.

vl43den and others added 2 commits March 28, 2026 01:15
remove unsupported positional arg from policy-add in skill

Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
updated command syntax for adding a policy preset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant