fix(policy): drop phantom /usr/bin/gh from github preset binaries (#2179)#3377
Conversation
) The `github` preset's `binaries:` list whitelisted both `/usr/bin/gh` and `/usr/bin/git`, and the preset description advertised "(git, gh)". But the sandbox base image (nemoclaw-blueprint/Dockerfile.base for OpenClaw, agents/hermes/Dockerfile.base for Hermes) only apt-installs `git`, not `gh`. Users selecting the `github` preset and running `gh api …` inside the sandbox hit `bash: gh: command not found`. This is the 4th instance of the same "phantom binary in preset whitelist" pattern (brew x2, docker x1, github x1 — see #2179 body for cross-references). Cheapest fix per the reporter's option (b): drop `/usr/bin/gh` from the preset binary list and from the description text, so the preset surface honestly reflects what's shipped. The fuller fix (apt-install gh in the sandbox base image) trades size + supply-chain surface for the added capability and is intentionally out of scope here — users who want `gh` can still install it themselves inside the sandbox. Changes: - nemoclaw-blueprint/policies/presets/github.yaml — drop /usr/bin/gh binary entry, update description from "(git, gh)" to "(git)", update the header comment to explain why gh was dropped. - agents/hermes/policy-additions.yaml — same drop in Hermes' github policy with an inline comment pointing at #2179. - docs/security/best-practices.md — two lines that mentioned `gh` as an example or available binary updated to reflect the actual preset binary set. - .agents/skills/nemoclaw-user-configure-security/references/best-practices.md regenerated via scripts/docs-to-skills.py to match. Closes #2179. Signed-off-by: Prekshi Vyas <prekshiv@nvidia.com> Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThis PR removes /usr/bin/gh from the github preset and Hermes policy, updates preset description and related documentation to advertise only /usr/bin/git, and adds tests asserting the preset/policy are git-only. ChangesGitHub Policy Preset Cleanup
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
E2E Advisor RecommendationRequired E2E: None Dispatch hint: Full advisor summaryPi Semantic E2E AdvisorBase: Required E2E
Optional E2E
New E2E recommendations
Dispatch hint
|
There was a problem hiding this comment.
🧹 Nitpick comments (2)
nemoclaw-blueprint/policies/presets/github.yaml (1)
25-37: Recommend running policy E2E before merge.Because this changes preset egress/binary constraints, run the network policy E2E job to validate behavior in sandbox flows.
As per coding guidelines "
nemoclaw-blueprint/policies/**... E2E test recommendation:network-policy-e2e."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@nemoclaw-blueprint/policies/presets/github.yaml` around lines 25 - 37, This change modifies the network_policies.github preset (network_policies -> github) by altering endpoints and binaries; before merging, run the network-policy-e2e job to validate the egress and binary constraints for the github preset (verify endpoints: github.com and api.github.com on port 443 and the binaries list including /usr/bin/git) and attach the resulting report to the PR so CI confirms sandbox flows behave as expected.agents/hermes/policy-additions.yaml (1)
69-84: Please run the Hermes E2E set for this policy-surface change.This touches Hermes onboarding/policy behavior, so a targeted E2E sweep is worth running pre-merge.
As per coding guidelines "agents/hermes/** ... E2E test recommendation:
hermes-e2e,hermes-inference-switch-e2e,hermes-discord-e2e,hermes-slack-e2e,rebuild-hermes-e2e,rebuild-hermes-stale-base-e2e."🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@agents/hermes/policy-additions.yaml` around lines 69 - 84, This change updates Hermes policy surface (agents/hermes/policy-additions.yaml) and requires running the Hermes E2E suite before merging; please trigger the full targeted E2E sweep: run hermes-e2e, hermes-inference-switch-e2e, hermes-discord-e2e, hermes-slack-e2e, rebuild-hermes-e2e and rebuild-hermes-stale-base-e2e (or the CI job group that maps to those names) and report any failures tied to the policy changes so they can be addressed before merge.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@agents/hermes/policy-additions.yaml`:
- Around line 69-84: This change updates Hermes policy surface
(agents/hermes/policy-additions.yaml) and requires running the Hermes E2E suite
before merging; please trigger the full targeted E2E sweep: run hermes-e2e,
hermes-inference-switch-e2e, hermes-discord-e2e, hermes-slack-e2e,
rebuild-hermes-e2e and rebuild-hermes-stale-base-e2e (or the CI job group that
maps to those names) and report any failures tied to the policy changes so they
can be addressed before merge.
In `@nemoclaw-blueprint/policies/presets/github.yaml`:
- Around line 25-37: This change modifies the network_policies.github preset
(network_policies -> github) by altering endpoints and binaries; before merging,
run the network-policy-e2e job to validate the egress and binary constraints for
the github preset (verify endpoints: github.com and api.github.com on port 443
and the binaries list including /usr/bin/git) and attach the resulting report to
the PR so CI confirms sandbox flows behave as expected.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: 42e9c30b-0420-43dc-833b-4f14d4698430
📒 Files selected for processing (4)
.agents/skills/nemoclaw-user-configure-security/references/best-practices.mdagents/hermes/policy-additions.yamldocs/security/best-practices.mdnemoclaw-blueprint/policies/presets/github.yaml
Selective E2E Results — ✅ All requested jobs passedRun: 25747668898
|
|
Targeted E2E validation requested by the E2E Advisor has passed. Run: https://github.com/NVIDIA/NemoClaw/actions/runs/25747668898 Passed targeted jobs: PR review can proceed with that E2E signal in mind. |
ericksoa
left a comment
There was a problem hiding this comment.
Thanks, this is the right behavioral direction for #2179: the GitHub preset and Hermes policy should not advertise or whitelist a gh binary that the shipped images do not install.
I think this needs two small follow-ups before merge:
docs/network-policy/integration-policy-examples.mdand the generated skill mirror at.agents/skills/nemoclaw-user-manage-policy/references/integration-policy-examples.mdstill say thegithubpreset is for GitHub API, Git, orghaccess. Please update those to GitHub API/Git only so the user-facing docs do not keep the phantomghclaim alive.- Please add focused regression coverage for #2179. The existing GitHub preset test only proves the preset exists and parses; it does not assert that the preset description is now
(git)or that/usr/bin/ghstays out of both the built-ingithubpreset andagents/hermes/policy-additions.yaml.
I validated a local patch for those updates with npm run build:cli, npm run typecheck:cli, npx vitest run test/validate-blueprint.test.ts test/policies.test.ts, python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user --dry-run, npm run source-shape:check, and git diff --check.
Signed-off-by: Aaron Erickson <aerickson@nvidia.com>
ericksoa
left a comment
There was a problem hiding this comment.
Reviewed policy and docs/test follow-up on current head cb55343. The PR removes the phantom gh binary from the GitHub preset/Hermes policy, keeps git access intact, and now has focused regression coverage plus aligned docs. All visible checks and CodeRabbit are green.
Summary
Fixes #2179. The
githubpolicy preset whitelisted/usr/bin/ghin itsbinaries:list (and advertised it in the(git, gh)description), but the sandbox base image only apt-installsgit, notgh. Users selecting● githuband runninggh api …hitbash: gh: command not found.This is the 4th instance of the "phantom binary in preset whitelist" pattern (brew × 2, docker × 1, github × 1 — see issue body for the bug cross-references).
Approach
Going with the reporter's recommended option (b): drop
/usr/bin/ghfrom the preset binary list and from the description text. The preset surface now honestly reflects what's actually usable in the shipped sandbox image.The fuller fix (apt-install
ghin the sandbox base image) trades size + supply-chain surface for the added capability and is intentionally out of scope. Users who wantghcan still install it themselves inside the sandbox.Changes
nemoclaw-blueprint/policies/presets/github.yaml— drop/usr/bin/ghbinary entry; update description from"(git, gh)"→"(git)"; update header comment to explain whyghwas dropped (pointer to [All Platforms][Policy] 'github' policy preset whitelists binary /usr/bin/gh but gh CLI is not installed in the sandbox image #2179).agents/hermes/policy-additions.yaml— same drop in Hermes'githubpolicy (Hermes inherits the same phantom-binary issue), with an inline comment pointing at [All Platforms][Policy] 'github' policy preset whitelists binary /usr/bin/gh but gh CLI is not installed in the sandbox image #2179.docs/security/best-practices.md— two lines that mentionedghas an example or available binary updated to reflect the actual preset binary set..agents/skills/nemoclaw-user-configure-security/references/best-practices.md— regenerated viascripts/docs-to-skills.pyto match the docs change.Verification
Empirically confirmed against v0.0.38 (current latest) on a fresh Brev box. Onboarded a sandbox, applied
● github, verified inside the sandbox:/usr/bin/ghdoes not exist (only/usr/bin/gitis present)which ghreturns nothinggh --version→bash: gh: command not foundgit(the other preset binary) works as expectedAfter this PR, the preset surface matches reality.
Test plan
● githubpreset, confirmnemoclaw <name> policy-listshows the updated description(git)andgitcontinues to work through the presetverify docs-to-skillscheck)Signed-off-by: Prekshi Vyas prekshiv@nvidia.com
Summary by CodeRabbit