Skip to content

docs(security): add credential rotation guide - #6266

Merged
cv merged 7 commits into
NVIDIA:mainfrom
sauravdev:docs/credential-rotation
Jul 10, 2026
Merged

docs(security): add credential rotation guide#6266
cv merged 7 commits into
NVIDIA:mainfrom
sauravdev:docs/credential-rotation

Conversation

@sauravdev

@sauravdev sauravdev commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a dedicated Credential Rotation guide for inference keys, messaging tokens, and web search credentials.
The maintainer follow-up validates each copy-paste flow against the current CLI and documents when reuse, rebuild, or recreation is required.

The original guide and implementation are by @sauravdev.
The corrective maintainer commit preserves that work with Co-authored-by: sauravdev <saurava@nvidia.com>.

Changes

  • Adds docs/security/credential-rotation.mdx and exposes it in both agent variants.
  • Uses the authoritative credentials list output instead of invented provider names.
  • Routes messaging token rotation through channels add followed by rebuild.
  • Recreates the sandbox for web search rotation and distinguishes Brave support from Hermes Tavily support.
  • Includes the mandatory third-party software acceptance flag in every non-interactive onboarding example.
  • Separates route and reachability checks from a real authenticated request.
  • Adds a focused documentation contract test for command flags, provider names, and rebuild boundaries.

Type of Change

  • Code change (feature, bug fix, or refactor)
  • Code change with doc updates
  • Doc only (prose changes, no code sample modifications)
  • Doc only (includes code sample changes)

Quality Gates

  • Tests added or updated for changed behavior
  • Existing tests cover changed behavior — credential rotation and reset behavior remain covered by their focused integration tests.
  • Tests not applicable — justification:
  • Docs updated for user-facing behavior changes
  • Docs not applicable — justification:
  • Sensitive paths changed (security, policy, credentials, preflight, onboarding, inference, runner, sandbox, or messaging)
  • Sensitive-path review completed or maintainer-approved waiver recorded — validated examples against current credentials, onboarding, messaging, and runtime-control implementations.
  • Non-success, skipped, or missing CI check accepted by maintainer — check name, approval link, and follow-up issue:

Verification

  • PR description includes the DCO sign-off declaration and every commit appears as Verified in GitHub
  • Git hooks passed during commit and push, or npx prek run --from-ref main --to-ref HEAD passes
  • Targeted tests pass for changed behavior
  • Full npm test passes (broad runtime changes only)
  • Quality Gates section completed with required justifications or waivers
  • No secrets, API keys, or credentials committed
  • npm run docs builds without warnings (doc changes only) — passed with 0 errors and 2 existing repository warnings.
  • Doc pages follow the style guide (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Validation performed

  • npm run docs:sync-agent-variants
  • npm run docs (0 errors; 2 existing warnings)
  • npx vitest run --project integration test/credential-rotation-docs.test.ts test/credential-rotation.test.ts test/credentials-reset-outcome.test.ts (23 passed)
  • npm run test-size:check
  • npm run test:titles:check
  • Commit and push hooks

Signed-off-by: sauravdev saurava@nvidia.com

Summary by CodeRabbit

  • Documentation

    • Added a new credential rotation guide with step-by-step instructions for updating access keys, messaging tokens, and web search settings.
    • Expanded the security navigation to include the new guide for both product variants.
  • Tests

    • Added coverage to verify the guide includes the expected command examples, rebuild steps, and valid real-world usage patterns.

@copy-pr-bot

copy-pr-bot Bot commented Jul 4, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@coderabbitai

coderabbitai Bot commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR adds a new Credential Rotation guide under docs/security/, links it from both NemoClaw navigation variants, and adds tests that validate the guide’s example commands.

Changes

Credential rotation documentation

Layer / File(s) Summary
Docs navigation entries for Credential Rotation
docs/index.yml
Adds Credential Rotation entries under the Security section for both NemoClaw variants.
Credential rotation guide
docs/security/credential-rotation.mdx
Adds the page metadata, introduction, and prerequisite credential naming and registration guidance.
Credential rotation procedures
docs/security/credential-rotation.mdx
Documents rotation steps for inference API keys, messaging tokens, and web search keys, including the Hermes AgentOnly path.
Credential removal and verification
docs/security/credential-rotation.mdx
Covers remove-and-reregister commands, emergency compromise handling, CI/CD guidance, verification commands, and related links.
Documentation examples test
test/credential-rotation-docs.test.ts
Checks the guide’s onboarding, rebuild, sandbox recreation, and credential-reset examples.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and accurately summarizes the main change: adding a credential rotation guide under docs/security.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 14

🧹 Nitpick comments (4)
docs/security/credential-rotation.mdx (2)

113-136: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Unnecessary bold text in emergency rotation steps.

Each numbered step (lines 117, 118, 124, 125, 131) bolds its lead phrase, which the docs style guideline discourages.

✏️ Proposed fix
-1. **Revoke the key** at the provider dashboard (NVIDIA API Catalog, Slack, Telegram, etc.) before doing anything else.
-2. **Remove it from the gateway** immediately so the sandbox cannot use the compromised value:
+1. Revoke the key at the provider dashboard (NVIDIA API Catalog, Slack, Telegram, etc.) before doing anything else.
+2. Remove it from the gateway immediately so the sandbox cannot use the compromised value:
As per coding guidelines, "Avoid filler, hype, rhetorical questions, emoji, em-dashes, and unnecessary bold text."
🤖 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 `@docs/security/credential-rotation.mdx` around lines 113 - 136, Remove the
unnecessary bold formatting from the lead phrases in the Emergency Rotation
After Key Compromise steps so the numbered list matches the docs style guide.
Update the markdown in the credential-rotation section by editing the step text
around the emergency rotation instructions, keeping the content the same but
writing the step labels as plain text instead of bold emphasis.

Source: Coding guidelines


79-82: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

AgentOnly block content doesn't actually diverge by variant.

The block states messaging-token rotation happens "through the same onboard path" for Hermes, i.e. no different behavior/setup flow from the general instructions above it. Per coding guidelines, <AgentOnly> should only be used when content genuinely differs by behavior, setup flow, state layout, or agent-specific wording, not to restate the same flow with a Hermes label.
As per coding guidelines, "Use <AgentOnly> blocks only when content differs by behavior, setup flow, state layout, or agent-specific wording."

🤖 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 `@docs/security/credential-rotation.mdx` around lines 79 - 82, Remove the
<AgentOnly variant="hermes"> block in credential-rotation.mdx or rewrite it so
Hermes-specific content truly differs from the general flow. The current text in
the AgentOnly block mirrors the same rotation path already described above, so
locate the Hermes messaging-token section and either fold it into the shared
instructions or replace it with genuinely Hermes-only behavior using the
AgentOnly marker only when the setup or flow changes.

Source: Coding guidelines

docs/inference/custom-llm-provider.md (2)

50-50: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use code formatting instead of bold for the literal option value.

"Custom" is a literal UI value; per the style guide it should use code formatting rather than bold.
As per coding guidelines, "Use code formatting for commands, paths, flags, environment variables, file names, and literal values" and "Avoid ... unnecessary bold text."

✏️ Proposed fix
-When prompted for the endpoint, select **"Custom"** and enter your provider's base URL.
+When prompted for the endpoint, select `Custom` and enter your provider's base URL.
🤖 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 `@docs/inference/custom-llm-provider.md` at line 50, The documentation text in
the custom LLM provider guide uses bold for the literal UI option value "Custom"
instead of code formatting. Update the sentence in the affected markdown content
to use inline code formatting for the exact option value, keeping the rest of
the wording unchanged and ensuring the style follows the guide for literal
values.

Source: Coding guidelines


1-338: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add custom-llm-provider to the Inference nav.
docs/inference/custom-llm-provider.md is not listed in docs/index.yml; add it under the Inference section so the page shows up in the docs navigation.

🤖 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 `@docs/inference/custom-llm-provider.md` around lines 1 - 338, The custom LLM
provider doc exists but is missing from the docs navigation. Update the docs
index entry under the Inference section in docs/index.yml to include the
custom-llm-provider page so it appears alongside the other inference docs. Use
the page title or slug that matches the existing custom-llm-provider.md document
and keep the ordering consistent with the other Inference items.

Source: Coding guidelines

🤖 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.

Inline comments:
In `@docs/inference/custom-llm-provider.md`:
- Line 24: Remove the em dash styling from the prose in this guide and replace
it with acceptable punctuation or sentence breaks. Update the affected text in
the custom-llm-provider.md content so the opening description, the relevant
section around the linked reference, and the closing note no longer use em
dashes. Make the edits in the markdown prose and any link text that contains the
em dash, keeping the wording otherwise unchanged.
- Around line 334-338: The Related Topics links in the custom-llm-provider docs
need to be corrected. Update the markdown in the Related Topics section so the
switch-inference-providers and approve-network-requests entries use route-style
slugs without the .md extension, and replace the broken inference-profiles link
with the correct matching reference page path. Focus on the links in the Related
Topics list for custom-llm-provider.md.

In `@docs/security/credential-rotation.mdx`:
- Line 33: The Markdown/MDX text in the credential-rotation doc contains two
sentences on a single line, violating the one-sentence-per-line guideline. Split
the sentence in this section into separate lines in the same paragraph, keeping
the wording unchanged and preserving the existing content around the
sandbox/provider name pattern and the credential reset guidance.
- Around line 92-111: The step headings in the credential rotation doc use
unnecessary bold text and an em-dash in the markers. Update the section in
credential-rotation.mdx so the step labels under Remove and Re-register a
Credential use plain text with the existing numbering, and replace the em-dash
punctuation with the preferred guideline-compliant separator. Keep the
surrounding content in the same flow, including the credential reset and onboard
examples, while making the headings match the style used elsewhere in the docs.
- Line 15: The sentence in the credential-rotation MDX content uses an em-dash
and violates the docs style guide; update the text in the affected paragraph to
remove the em-dash and rewrite it with plain punctuation, and ensure the
Markdown/MDX source keeps one sentence per line in that section.
- Around line 142-148: The GitHub Actions example in credential-rotation.mdx
uses the literal CLI name instead of the shared host-variant placeholder. Update
the “Rotate inference key” `run:` example to match the other command blocks in
this file by using `$$nemoclaw` in the command, so the generated OpenClaw and
Hermes pages stay consistent.
- Around line 157-163: The docs snippet uses the internal command id form
instead of the user-facing CLI syntax. Update the credential-rotation example in
the section that references nemoclaw status and the inference command to use the
space-separated form `inference get` (consistent with the `inference get
[--json]` usage and the rest of the docs), and keep the surrounding wording
unchanged.

In `@nemoclaw-sandbox-policy.yaml`:
- Around line 26-34: The openai policy entry is missing the binaries restriction
required by the sandbox schema. Update the openai block in
nemoclaw-sandbox-policy.yaml to include a binaries field matching the other
network_policies entries, so it satisfies schemas/sandbox-policy.schema.json and
is scoped to the intended process. Use the existing openai policy entry as the
location to add the missing field.

In `@skill/nat/references/custom-tools.md`:
- Around line 11-19: The directory tree in the custom-tools reference is using a
bare fenced block, which triggers the markdownlint warning. Update the fenced
block in custom-tools.md to use the text language tag for the tree snippet so
the directory listing remains lint-clean.
- Around line 31-52: The custom tool example is incomplete because it uses
Builder and FunctionInfo without importing them, so the snippet will not run as
written. Update the example around MyCustomToolConfig, my_custom_tool_function,
and the register_function usage to either add the missing imports for Builder
and FunctionInfo or explicitly label the block as partial/illustrative so
readers know it is not copy-paste ready.
- Around line 65-68: The override example uses the wrong YAML instance name in
the path. Update the command under the custom-tools example to use the actual
function key from the surrounding config, `functions.docs_query.webpage_url`,
instead of `functions.webpage_query.webpage_url`, so the example matches the
referenced tool instance.

In `@skill/nat/references/function-groups.md`:
- Around line 19-58: The example snippet is missing required imports, making the
builder example incomplete. In the ObjectStoreConfig / build_object_store
example, add the missing references for Builder and boto3 alongside the existing
FunctionGroupBaseConfig, Field, register_function_group, and FunctionGroup
imports, or explicitly label the snippet as partial pseudocode so readers know
it is not directly runnable.

In `@skill/nat/references/install-from-source.md`:
- Around line 10-12: The install-from-source recipe is using an extra that the
project does not define, so update the `uv sync` step in this doc to remove
`--extra most` and align it with the repository’s declared metadata. While
you’re here, recheck the `uv venv --python 3.13` pin against the
`requires-python` range and adjust the install instructions if needed so they
match the supported versions and available dependency groups.

In `@skill/nat/SKILL.md`:
- Line 83: The documented agent type name is misspelled in the SKILL.md entry,
so update the `rewwo_agent` reference to `rewoo_agent` in the agent type list.
Make this correction wherever that symbol appears in the docs snippet so
copy-pasted workflow configs match the expected `rewoo_agent` identifier.

---

Nitpick comments:
In `@docs/inference/custom-llm-provider.md`:
- Line 50: The documentation text in the custom LLM provider guide uses bold for
the literal UI option value "Custom" instead of code formatting. Update the
sentence in the affected markdown content to use inline code formatting for the
exact option value, keeping the rest of the wording unchanged and ensuring the
style follows the guide for literal values.
- Around line 1-338: The custom LLM provider doc exists but is missing from the
docs navigation. Update the docs index entry under the Inference section in
docs/index.yml to include the custom-llm-provider page so it appears alongside
the other inference docs. Use the page title or slug that matches the existing
custom-llm-provider.md document and keep the ordering consistent with the other
Inference items.

In `@docs/security/credential-rotation.mdx`:
- Around line 113-136: Remove the unnecessary bold formatting from the lead
phrases in the Emergency Rotation After Key Compromise steps so the numbered
list matches the docs style guide. Update the markdown in the
credential-rotation section by editing the step text around the emergency
rotation instructions, keeping the content the same but writing the step labels
as plain text instead of bold emphasis.
- Around line 79-82: Remove the <AgentOnly variant="hermes"> block in
credential-rotation.mdx or rewrite it so Hermes-specific content truly differs
from the general flow. The current text in the AgentOnly block mirrors the same
rotation path already described above, so locate the Hermes messaging-token
section and either fold it into the shared instructions or replace it with
genuinely Hermes-only behavior using the AgentOnly marker only when the setup or
flow changes.
🪄 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: Enterprise

Run ID: ff9e3f06-f0b4-4167-ae77-36a5470241f9

📥 Commits

Reviewing files that changed from the base of the PR and between 7875bd3 and a7a7e7e.

📒 Files selected for processing (12)
  • docs/index.yml
  • docs/inference/custom-llm-provider.md
  • docs/inference/switch-to-brev-nemotron-120b.md
  • docs/inference/switch-to-nemotron-super-120b.md
  • docs/security/credential-rotation.mdx
  • nemoclaw-sandbox-policy.yaml
  • skill/nat/SKILL.md
  • skill/nat/references/a2a-server.md
  • skill/nat/references/custom-tools.md
  • skill/nat/references/examples.md
  • skill/nat/references/function-groups.md
  • skill/nat/references/install-from-source.md

Comment thread docs/inference/custom-llm-provider.md Outdated
Comment thread docs/inference/custom-llm-provider.md Outdated
Comment thread docs/security/credential-rotation.mdx Outdated
Comment thread docs/security/credential-rotation.mdx Outdated
Comment thread docs/security/credential-rotation.mdx Outdated
Comment thread skill/nat/references/custom-tools.md Outdated
Comment thread skill/nat/references/custom-tools.md Outdated
Comment thread skill/nat/references/function-groups.md Outdated
Comment thread skill/nat/references/install-from-source.md Outdated
Comment thread skill/nat/SKILL.md Outdated
@sauravdev
sauravdev force-pushed the docs/credential-rotation branch 2 times, most recently from 21787ef to 6b5d442 Compare July 4, 2026 15:18
@cv cv added the v0.0.76 label Jul 7, 2026
cv
cv previously requested changes Jul 7, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The copy-paste rotation flow is not executable or safe as documented. It invents provider names and resettable messaging credential names; claims messaging rotation avoids rebuild even though the flow backs up, deletes, and recreates the sandbox; and every non-interactive onboard example omits mandatory --yes-i-accept-third-party-software, so commands can stop before rotation. Validate against actual CLI and provider behavior and update the examples and tests.

@sauravdev
sauravdev force-pushed the docs/credential-rotation branch 2 times, most recently from 659ad00 to 9532d92 Compare July 7, 2026 12:27
@wscurran wscurran added area: docs Documentation, examples, guides, or docs build area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance labels Jul 7, 2026
@wscurran

wscurran commented Jul 7, 2026

Copy link
Copy Markdown
Contributor

✨ Thanks for the PR. This adds a comprehensive Credential Rotation guide covering inference keys, messaging tokens, and web search credentials. Ready for maintainer review.

@wscurran wscurran added v0.0.77 and removed v0.0.76 labels Jul 7, 2026
@github-actions github-actions Bot mentioned this pull request Jul 7, 2026
21 tasks
@cjagwani cjagwani self-assigned this Jul 8, 2026
@ericksoa ericksoa added v0.0.78 and removed v0.0.77 labels Jul 8, 2026
@cjagwani cjagwani added v0.0.79 and removed v0.0.78 labels Jul 8, 2026
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

I pushed a6d628e66 to close the executable/safety gaps while preserving the original contribution by @sauravdev (Co-authored-by: sauravdev <saurava@nvidia.com>).

The guide now uses provider names from credentials list, routes messaging rotation through channels add plus a required rebuild, recreates for web-search changes, includes the third-party acceptance flag on every non-interactive onboard command, and requires a real authenticated request for verification.

Validation completed:

  • credential rotation docs/behavior/reset tests: 23 passed
  • docs variant synchronization: passed
  • docs build: 0 errors, 2 existing repository warnings
  • test size/title checks: passed
  • commit and push hooks: passed

@coderabbitai review

@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor
🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail
gh pr view 6266 --repo NVIDIA/NemoClaw --json title,body,baseRefName,headRefName,commits --jq '.title, .baseRefName, .headRefName'
echo "---DIFF---"
gh pr diff 6266 --repo NVIDIA/NemoClaw
echo "---FILE---"
gh api repos/NVIDIA/NemoClaw/contents/docs/security/credential-rotation.mdx --jq '.content' | base64 -d

Length of output: 14024


🏁 Script executed:

#!/bin/bash
set -euo pipefail
git clone --depth 100 -b docs/credential-rotation https://github.com/NVIDIA/NemoClaw.git repo 2>&1 | tail -5
cd repo

echo "=== search for --recreate-sandbox ==="
rg -n "recreate-sandbox" --type-not md -g '!*.mdx' | head -30
echo "=== search for credentials reset ==="
rg -n "credentials reset|credentials list" -g '*.ts' -g '*.go' -g '*.py' | head -30
echo "=== search for channels add ==="
rg -n "channels add" -g '*.ts' -g '*.go' -g '*.py' | head -30
echo "=== search for NEMOCLAW_NON_INTERACTIVE ==="
rg -n "NEMOCLAW_NON_INTERACTIVE" | head -30
echo "=== check related pages existence ==="
fd -a "runtime-controls" docs
fd -a "switch-inference-providers" docs
fd -a "best-practices" docs
fd -a "credential-storage" docs
echo "=== check AgentOnly usage elsewhere ==="
rg -n "AgentOnly variant=" docs -g '*.mdx' | head -20
echo "=== check --yes-i-accept-third-party-software elsewhere ==="
rg -n "yes-i-accept-third-party-software" docs | head -20

Length of output: 1522


🏁 Script executed:

#!/bin/bash
set -euo pipefail
git clone --depth 200 https://github.com/NVIDIA/NemoClaw.git repo 2>&1 | tail -5
cd repo
git fetch origin pull/6266/head:pr-6266 2>&1 | tail -5
git checkout pr-6266 2>&1 | tail -5

echo "=== search for --recreate-sandbox ==="
rg -n "recreate-sandbox" -g '!*.mdx' | head -30
echo "=== search for credentials reset/list ==="
rg -n "credentials reset|credentials list" -g '*.ts' -g '*.go' -g '*.py' | head -30
echo "=== search for channels add ==="
rg -n "channels add" -g '*.ts' -g '*.go' -g '*.py' | head -30
echo "=== search for NEMOCLAW_NON_INTERACTIVE ==="
rg -n "NEMOCLAW_NON_INTERACTIVE" | head -30
echo "=== check related pages existence ==="
fd -a "runtime-controls" docs
fd -a "switch-inference-providers" docs
fd -a "best-practices" docs
fd -a "credential-storage" docs
echo "=== check AgentOnly usage elsewhere ==="
rg -n "AgentOnly variant=" docs -g '*.mdx' | head -20
echo "=== check --yes-i-accept-third-party-software elsewhere ==="
rg -n "yes-i-accept-third-party-software" docs | head -20
echo "=== check rebuild --yes usage ==="
rg -n "rebuild --yes|rebuild\b" docs -g '*.mdx' | head -20

Length of output: 1685


🏁 Script executed:

#!/bin/bash
set -uo pipefail
cd repo 2>/dev/null || { git fetch origin pull/6266/head:pr-6266; git checkout pr-6266; }

echo "=== search for --recreate-sandbox ==="
rg -n "recreate-sandbox" -g '!*.mdx' || echo "NO MATCH"
echo "=== search for credentials reset/list ==="
rg -n "credentials reset|credentials list" -g '*.ts' -g '*.go' -g '*.py' || echo "NO MATCH"
echo "=== search for channels add ==="
rg -n "channels add" -g '*.ts' -g '*.go' -g '*.py' || echo "NO MATCH"
echo "=== search for NEMOCLAW_NON_INTERACTIVE ==="
rg -n "NEMOCLAW_NON_INTERACTIVE" || echo "NO MATCH"
echo "=== check related pages existence ==="
fd -a "runtime-controls" docs || echo "NOT FOUND"
fd -a "switch-inference-providers" docs || echo "NOT FOUND"
fd -a "best-practices" docs || echo "NOT FOUND"
fd -a "credential-storage" docs || echo "NOT FOUND"
echo "=== check AgentOnly usage elsewhere ==="
rg -n "AgentOnly variant=" docs -g '*.mdx' || echo "NO MATCH"
echo "=== check --yes-i-accept-third-party-software elsewhere ==="
rg -n "yes-i-accept-third-party-software" docs || echo "NO MATCH"
echo "=== check rebuild --yes usage elsewhere ==="
rg -n "rebuild --yes|rebuild\b" docs -g '*.mdx' || echo "NO MATCH"
echo "=== list top-level dirs (find CLI source) ==="
fd -td -d 2 . | head -40

Length of output: 1452


🏁 Script executed:

#!/bin/bash
set -uo pipefail
ls
pwd
cd repo && pwd && git status --short | head -5
echo "=== recreate-sandbox ==="
grep -rn "recreate-sandbox" --include="*.ts" --include="*.go" --include="*.py" . 2>/dev/null | head -20
echo "END1"
echo "=== credentials reset/list ==="
grep -rn "credentials reset\|credentials list" --include="*.ts" --include="*.go" --include="*.py" . 2>/dev/null | head -20
echo "END2"
echo "=== channels add ==="
grep -rn "channels add" --include="*.ts" --include="*.go" --include="*.py" . 2>/dev/null | head -20
echo "END3"
echo "=== docs related files ==="
find docs -iname "*runtime-controls*" -o -iname "*switch-inference-providers*" -o -iname "*best-practices*" -o -iname "*credential-storage*" 2>/dev/null
echo "END4"

Length of output: 9222


🏁 Script executed:

#!/bin/bash
set -uo pipefail
cd repo
echo "=== NEMOCLAW_NON_INTERACTIVE usage ==="
grep -rn "NEMOCLAW_NON_INTERACTIVE" --include="*.ts" . 2>/dev/null | head -20
echo "END1"
echo "=== yes-i-accept-third-party-software ==="
grep -rn "yes-i-accept-third-party-software" --include="*.ts" . 2>/dev/null | head -10
echo "END2"
echo "=== AgentOnly usage in docs ==="
grep -rln "AgentOnly variant=" docs 2>/dev/null | head -10
echo "END3"
echo "=== rebuild --yes usage ==="
grep -rn "rebuild --yes\|rebuild \"" --include="*.ts" . 2>/dev/null | head -10
grep -rln "rebuild --yes" docs 2>/dev/null | head -10
echo "END4"
echo "=== onboard --resume flag ==="
grep -rn "\-\-resume" --include="*.ts" src 2>/dev/null | head -10
echo "END5"

Length of output: 7133


All flags, commands, and env vars used in the guide check out against the actual codebase (--recreate-sandbox, credentials reset/list, channels add, NEMOCLAW_NON_INTERACTIVE, --yes-i-accept-third-party-software, onboard --resume, rebuild --yes), and the linked pages in "Related Pages" all exist (runtime-controls.mdx, switch-inference-providers.mdx, best-practices.mdx, credential-storage.mdx). The AgentOnly component usage pattern also matches existing docs conventions.

@apurvvkumaria Thanks for the update — I reviewed the changes in a6d628e66. The revision addresses the concerns well:

  • Provider names are now sourced from credentials list output rather than invented examples (e.g., nvidia-prod, <sandbox>-brave-search), matching how the CLI actually reports them.
  • Messaging rotation correctly routes through channels add + rebuild --yes, consistent with how the sandbox picks up new bridge tokens only at startup.
  • Web search rotation now uses --recreate-sandbox, which is the real flag (verified in src/lib/onboard.ts and related tests) rather than a soft "may need recreation" caveat.
  • Every non-interactive onboard example consistently includes --yes-i-accept-third-party-software.
  • The verification section now correctly distinguishes between reachability checks (status, inference get) and an actual authenticated request, avoiding false confidence.
  • Added test/credential-rotation-docs.test.ts enforces these invariants going forward (rebuild boundary, third-party flag, real provider names), which is a nice guardrail against doc drift.

I don't see any remaining issues in this revision. Nice work tightening this up with @sauravdev's original contribution intact.

✅ Action performed

Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

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.

Actionable comments posted: 1

🤖 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.

Inline comments:
In `@docs/security/credential-rotation.mdx`:
- Around line 183-205: The verification step descriptions in this section repeat
the same opener, causing the lint warning and making the copy feel repetitive.
Reword one or two of the sentences near the OpenClaw, Hermes, messaging, and web
search checks so they do not all start with “For”, while keeping the meaning
intact and preserving the existing AgentOnly structure and examples.
🪄 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: Enterprise

Run ID: 1b457671-2fab-48f1-8b48-9fc5ad1cfb46

📥 Commits

Reviewing files that changed from the base of the PR and between 659ad00 and a6d628e.

📒 Files selected for processing (3)
  • docs/index.yml
  • docs/security/credential-rotation.mdx
  • test/credential-rotation-docs.test.ts
💤 Files with no reviewable changes (1)
  • test/credential-rotation-docs.test.ts
✅ Files skipped from review due to trivial changes (1)
  • docs/index.yml

Comment thread docs/security/credential-rotation.mdx Outdated
@apurvvkumaria apurvvkumaria self-assigned this Jul 8, 2026
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Exact head a6d628e66 is now green: 28 checks pass, required docs/CLI gates pass, DCO and commit verification pass, and CodeRabbit has no blocker. The requested copy-paste safety gaps are covered by the new documentation contract tests.

@cv please re-review the exact head and clear the now-outdated change request if the corrected provider names, rebuild boundaries, acceptance flags, and live verification guidance satisfy your request.

@cv
cv dismissed their stale review July 8, 2026 22:03

Addressed at exact head a6d628e: provider names now follow credentials list output; messaging rotation uses channels add plus rebuild; every non-interactive onboard example includes the third-party acceptance flag; live verification is distinguished from reachability checks; and focused contract tests cover these boundaries. Dismissing this stale change request. Final approval remains pending the formal merge gate because the exact-head advisor jobs were skipped and check-gates is not allPass.

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head re-review found one remaining executable-flow blocker in a6d628e66.

All normal credential-rotation onboarding examples use onboard --resume (docs/security/credential-rotation.mdx:45,52,103,118,166). That flag only continues an interrupted resumable onboarding run. A normally completed onboarding session is recorded with resumable=false, and src/lib/onboard/session-bootstrap.ts:56-61,143-147 exits with:

No resumable onboarding session was found.
--resume only continues an interrupted onboarding run.

The executable regression at test/cli/onboard-compatibility.test.ts:222-231 pins that rejection. Therefore the documented inference, web-search, and CI/CD rotation commands stop before rotating credentials in the normal completed-sandbox case.

Please remove --resume from the normal rotation examples and related prose while retaining --name <sandbox>; the web-search examples should also retain --recreate-sandbox. Extend the documentation contract coverage to reject --resume in these completed-sandbox recipes, or add a behavioral test that exercises the option/session-resolution path rather than only checking command strings.

The previously requested provider-name, messaging rebuild, third-party acceptance, and live-verification fixes are addressed. The remaining CodeRabbit repeated-opener comment is stylistic and non-blocking.

@sauravdev
sauravdev force-pushed the docs/credential-rotation branch from a6d628e to 305ae33 Compare July 9, 2026 04:01
Step-by-step guide for rotating inference API keys, messaging tokens,
and other provider credentials without a full sandbox rebuild. Covers
emergency rotation, CI/CD workflows, and verification steps.

Adds the page to the docs/index.yml navigation for both openclaw and
hermes agent variants.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@sauravdev
sauravdev force-pushed the docs/credential-rotation branch from 305ae33 to 88b5448 Compare July 9, 2026 04:04

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head re-review at 88b5448e8: the force-push removed the corrective a6d628e66 content and test/credential-rotation-docs.test.ts, so the original copy-paste safety blockers have returned.

  • The guide again invents alpha-nvidia-inference, alpha-slack, and alpha-brave-search; messaging bridge names are not resettable provider credentials.
  • Normal and CI onboarding examples omit --name <sandbox> and the mandatory --yes-i-accept-third-party-software flag, so non-interactive commands can stop before rotation.
  • Messaging rotation again routes through onboard and claims no rebuild. It must use channels add followed by rebuild --yes.
  • Web-search rotation omits provider selection and --recreate-sandbox, even though its configuration is applied at sandbox creation.
  • status and inference get do not authenticate a real model request, so they cannot prove the replacement credential works.
  • The focused documentation contract test that guarded provider names, acceptance flags, and rebuild/recreate boundaries was removed.

Please restore the corrective guide and test from a6d628e66 on top of current main, with one necessary adjustment from the later review: normal completed-sandbox rotation recipes must not use onboard --resume. Keep --name <sandbox>; keep --recreate-sandbox for web-search rotation; and add a contract or behavioral assertion preventing --resume from returning to these recipes.

cv and others added 2 commits July 8, 2026 22:46
Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: sauravdev <saurava@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
cv
cv previously requested changes Jul 9, 2026

@cv cv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Exact-head follow-up at e5c0bcf2fb: all prior provider-name, messaging rebuild, acceptance-flag, no---resume, web-search recreation, and live-verification requests are addressed. The focused docs contracts pass 25/25, and normal CI is green.

One remaining executable-flow correction surfaced in the trusted exact-head advisor run: add --fresh to both Brave and Tavily web-search rotation commands, and pin it in test/credential-rotation-docs.test.ts.

resolveOnboardEntryOptions now auto-detects resume whenever the persisted onboarding session is in_progress, even when the operator did not pass --resume (src/lib/onboard/entry-options.ts:55-69). Therefore onboard --name <sandbox> --recreate-sandbox can resume stale interrupted-session selections instead of deterministically starting the intended emergency credential replacement. The canonical completed-sandbox replacement guidance already uses --fresh --name <sandbox> --recreate-sandbox (docs/reference/commands.mdx:207-214).

Please add --fresh to both web-search examples and extend the existing loop assertion to require it alongside --recreate-sandbox. The trusted GPT advisor run 29002979279 independently recommends merge_after_fixes for this same item. Everything else from the prior reviews is cleared.

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
@cv

cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Exact-head follow-up at 4f2ef44597: the requested web-search correction is addressed. Both recreate examples now include --fresh, the contract asserts it, the focused 25-test set passed, and the docs variant check passed.

The remaining red state is not a credential-rotation defect. CI run 29003446208 attempts 2 and 3 both timed out at the default 5 seconds in unchanged src/lib/actions/sandbox/policy-channel-list.test.ts:260 (marks registry-only provenance as gateway-unreachable). This PR does not touch that file; the exact test passes locally 12/12 in 88 ms. I am not retrying it indefinitely, but required CI remains formally red.

The exact trusted manual GPT advisor run 29003515949 checked out this PR at 4f2ef44597 and returned high-confidence merge_as_is with zero findings. The automatic pull-request advisor was skipped by its cross-repository fork guard and posted no provenance comment, so that manual result cannot satisfy the normal bot-comment gate. The manual Nemotron source-boundary and Hermes-forward warnings do not require another docs edit: the guide already explains that messaging configuration is resolved at sandbox start and web-search configuration is baked into the image, while the canonical command reference already documents forwarding port 8642 and the rotation guide repeats it to keep verification self-contained.

I am leaving the PR unapproved because required CI is red and exact automatic advisor provenance is absent, not because another contributor change is needed in the credential-rotation guide.

@cv

cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

The unrelated ordinary-CI blocker is now cleared at exact head 4f2ef44597c1850c1e1f6a91e75fc7384a5dcb3f: run 29003446208, attempt 4 passed the retried shard, cli-tests, and aggregate checks.

No additional #6266 source change is requested. The remaining gate is trusted automatic advisor provenance; the current manual exact-head GPT review is merge_as_is, but the normal advisor must be rerun after #6566 lands its duplicate-ledger protocol repair. I am leaving the existing review state in place until that gate can complete.

@cv

cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Exact-head maintainer follow-up at 1473591c6 addresses the trusted advisor's credential-handling warning: every replacement secret is now read silently on the trusted host, exported only for the rotation command, and unset immediately afterward. The examples use a form validated in both Bash and zsh, and the docs contract rejects inline replacement values for all seven credential variables.

Local verification:

  • npx vitest run --project integration test/credential-rotation-docs.test.ts: 6/6 passed
  • npm run docs: passed (0 errors; 2 existing Fern warnings)
  • npm run check:diff: passed
  • commit DCO and GitHub verification: valid

The exact-head trusted E2E review 29032114836 returned high-confidence no required or optional live E2E targets because this remains documentation plus documentation-contract coverage. Fresh ordinary CI is running. The trusted PR review is being serialized behind another maintainer's manual advisor run; I am leaving the existing review state in place until that exact-head gate completes.

@cv

cv commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Exact head 1473591c6 is now green after retrying the unrelated GitHub download failure: all 32 ordinary checks pass. The failed advisor-tool test also passed independently 36/36 on the exact checkout.

Trusted manual review run 29032211364 checked out this exact head. Both GPT-5.5 and Nemotron returned high-confidence merge_as_is, zero findings, and unit-sufficient test depth. Trusted E2E run 29032114836 requires no live targets. DCO is valid, all seven commits are GitHub Verified, CodeRabbit has no blocker, and the documentation-impact review found no further source-page changes.

I am leaving the existing review state in place because the fork guard skips the normal pull-request advisor job, while manual trusted runs do not post the exact-head sticky provenance comment required by the documented merge gate. No additional contributor source change is requested.

@jyaunches jyaunches added v0.0.80 and removed v0.0.79 labels Jul 9, 2026
@apurvvkumaria
apurvvkumaria requested a review from cv July 9, 2026 19:57
@cv
cv dismissed their stale review July 10, 2026 17:22

Superseded at exact head 1473591: both Brave and Tavily rotation examples now use --fresh with --recreate-sandbox, the focused contract pins both flags, CI is green, and an independent exact-head approval is present.

@cv
cv merged commit a7bca71 into NVIDIA:main Jul 10, 2026
44 of 47 checks passed
Hadar301 pushed a commit to Hadar301/NemoClaw-OpenShift that referenced this pull request Jul 12, 2026
<!-- markdownlint-disable MD041 -->
## Summary

Adds a dedicated Credential Rotation guide for inference keys, messaging
tokens, and web search credentials.
The maintainer follow-up validates each copy-paste flow against the
current CLI and documents when reuse, rebuild, or recreation is
required.

The original guide and implementation are by @sauravdev.
The corrective maintainer commit preserves that work with
`Co-authored-by: sauravdev <saurava@nvidia.com>`.

## Changes

- Adds `docs/security/credential-rotation.mdx` and exposes it in both
agent variants.
- Uses the authoritative `credentials list` output instead of invented
provider names.
- Routes messaging token rotation through `channels add` followed by
`rebuild`.
- Recreates the sandbox for web search rotation and distinguishes Brave
support from Hermes Tavily support.
- Includes the mandatory third-party software acceptance flag in every
non-interactive onboarding example.
- Separates route and reachability checks from a real authenticated
request.
- Adds a focused documentation contract test for command flags, provider
names, and rebuild boundaries.

## Type of Change

- [ ] Code change (feature, bug fix, or refactor)
- [ ] Code change with doc updates
- [ ] Doc only (prose changes, no code sample modifications)
- [x] Doc only (includes code sample changes)

## Quality Gates

- [x] Tests added or updated for changed behavior
- [x] Existing tests cover changed behavior — credential rotation and
reset behavior remain covered by their focused integration tests.
- [ ] Tests not applicable — justification:
- [x] Docs updated for user-facing behavior changes
- [ ] Docs not applicable — justification:
- [x] Sensitive paths changed (security, policy, credentials, preflight,
onboarding, inference, runner, sandbox, or messaging)
- [x] Sensitive-path review completed or maintainer-approved waiver
recorded — validated examples against current credentials, onboarding,
messaging, and runtime-control implementations.
- [ ] Non-success, skipped, or missing CI check accepted by maintainer —
check name, approval link, and follow-up issue:

## Verification

- [x] PR description includes the DCO sign-off declaration and every
commit appears as `Verified` in GitHub
- [x] Git hooks passed during commit and push, or `npx prek run
--from-ref main --to-ref HEAD` passes
- [x] Targeted tests pass for changed behavior
- [ ] Full `npm test` passes (broad runtime changes only)
- [x] Quality Gates section completed with required justifications or
waivers
- [x] No secrets, API keys, or credentials committed
- [ ] `npm run docs` builds without warnings (doc changes only) — passed
with 0 errors and 2 existing repository warnings.
- [x] Doc pages follow the [style
guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md)
(doc changes only)
- [x] New doc pages include SPDX header and frontmatter (new pages only)

### Validation performed

- `npm run docs:sync-agent-variants`
- `npm run docs` (0 errors; 2 existing warnings)
- `npx vitest run --project integration
test/credential-rotation-docs.test.ts test/credential-rotation.test.ts
test/credentials-reset-outcome.test.ts` (23 passed)
- `npm run test-size:check`
- `npm run test:titles:check`
- Commit and push hooks

---
Signed-off-by: sauravdev <saurava@nvidia.com>


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

## Summary by CodeRabbit

* **Documentation**
* Added a new credential rotation guide with step-by-step instructions
for updating access keys, messaging tokens, and web search settings.
* Expanded the security navigation to include the new guide for both
product variants.

* **Tests**
* Added coverage to verify the guide includes the expected command
examples, rebuild steps, and valid real-world usage patterns.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Carlos Villela <cvillela@nvidia.com>
Signed-off-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Carlos Villela <cvillela@nvidia.com>
Co-authored-by: Apurv Kumaria <akumaria@nvidia.com>
Co-authored-by: J. Yaunches <jyaunches@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: docs Documentation, examples, guides, or docs build area: security Security controls, permissions, secrets, or hardening chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants