Repository navigation
fix(security): scan named agent workspaces for secret writes - #10527
Conversation
Multi-agent sandboxes give each named agent its own workspace at /sandbox/.openclaw/workspace-<agent>/, with its own memory/ daily notes. The memory-path classifier that gates the secret scanner only carried the default /.openclaw/workspace/ segment, so an absolute write into a named workspace matched no classifier and skipped the scan. The gateway-managed runtime resolves every write tool path to that absolute form, so this is the primary path, not an edge case: isMemoryPath already returns true for the relative workspace-<agent>/memory/... form. Anchor the new segment on /.openclaw/ so unrelated project directories named workspace-* keep classifying as non-memory. Signed-off-by: Udaya Tejas <[email protected]>
|
Note Reviews pausedIt 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 Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
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 (1)
🚧 Files skipped from review as they are similar to previous changes (1)
Included review availability: Your plan provides up to 12 included reviews per hour; 10 remain after this review. 📝 WalkthroughWalkthroughThe secret scanner now classifies absolute paths under named ChangesNamed workspace memory scanning
Estimated code review effort: 1 (Trivial) | ~5 minutes Merge Risk: ⚪ Minimal · up to The change extends secret scanning to named agent workspaces while preserving project-path classification, with validation reported clean at the current head. No actionable merge-blocking risk remains beyond normal checks and review. 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Full details: Linked Issues checkExplanation The changes satisfy issue Full details: Docstring CoverageExplanation Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 3 files. (1 skipped: 1 unsupported.) ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
✨ Thanks for the fix. This addresses a security gap where named agent workspace writes were not scanned for secrets. Maintainers will review the security-sensitive changes. Related open PRs:
Related open issues: |
|
Note GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer. |
|
Found a small problem with the PR advisor. I'm making a separate PR to fix it, and will merge it into this branch shortly. |
<!-- markdownlint-disable MD041 --> ## Outcome PR Review Advisor specialists receive the workflow-selected comparison refs inside OpenShell sandboxes. ## Reason Fork PR Advisor jobs prepared target/base and HEAD, but sandboxed specialist execution fell back to origin/main because the refs were not supplied as command arguments. The read-only checkout has no origin/main ref, so every specialist failed before producing artifacts. ### Related issues Refs #10527 ## Changes - Pass the required base and head refs explicitly to sandboxed Advisor analysis and specialist entrypoints. - Cover both ordinary analysis and specialist execution at the OpenShell command boundary. ## Verification - Contributor validation: npm run validate:pr passed against canonical origin/main 7478a88. - Tests: npx vitest run --project integration test/automation/pull-requests/pr-review-advisor-openshell.test.ts (38 passed); npm run validate:pr passed. - Broad gate: npm run validate:pr passed, including repository checks and CLI TypeScript validation. - Secrets review: The diff contains no secrets, API keys, or credentials <!-- nemoclaw-docs-review:start --> - Documentation review: `no-docs-needed` - Documentation evidence: Internal Advisor workflow command-boundary repair; no user-facing documentation surface changes. - Documentation agent: openai/openai/gpt-5.6-sol <!-- docs-review-head-sha: 48c1193 --> <!-- docs-review-agents-blob-sha: dd3528f --> <!-- nemoclaw-docs-review:end --> <!-- nemoclaw-targeted-validation:start --> - Targeted validation: Focused Advisor command and workflow-boundary suites passed (117 tests); the review follow-up E2E-support suite passed (78 tests); npm run validate:pr passed. Exact-commit workflow_dispatch validation passed at https://github.com/NVIDIA/NemoClaw/actions/runs/33335093964: discovery and all nine specialist lifecycle, artifact upload, and outcome-verification jobs succeeded. Commit 48c1193 additionally requires exact workflow ref expressions and rejects target/base~1 and HEAD~1 lookalikes. <!-- nemoclaw-targeted-validation:end --> <!-- nemoclaw-broad-gate:start --> - Broad gate: passed — npm run validate:pr passed at 48c1193, including YAML, repository, source-shape, growth, and CLI TypeScript checks. <!-- nemoclaw-broad-gate:end --> --- Signed-off-by: Carlos Villela <[email protected]> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Improved pull request review analysis by consistently specifying the target base and current head revisions. * Updated specialist review sessions to use the correct execution flow and behavior settings. * Enhanced automated checks to verify revision-aware analysis and specialist execution. <!-- end of auto-generated comment: release notes by coderabbit.ai --> --------- Signed-off-by: Carlos Villela <[email protected]>
Signed-off-by: Carlos Villela <[email protected]>
Signed-off-by: Carlos Villela <[email protected]>
|
PR Review Advisor finished for commit |
Outcome
A write into a named agent workspace (
/sandbox/.openclaw/workspace-<agent>/)is now scanned for secrets like a write into the default
workspace/. Beforethis change it was not scanned at all.
Reason
MEMORY_PATH_SEGMENTScarries only the default/.openclaw/workspace/(
nemoclaw/src/security/secret-scanner.ts:147), and thebefore_tool_callhook classifies the resolved absolute path (
nemoclaw/src/index.ts:377). Namedworkspaces were documented in #2383; the classifier was last extended in #4519,
which added the relative
workspace-<agent>/memory/...form(
nemoclaw/src/security/secret-scanner.ts:188) but not the absolute one. Sothe two forms of one path disagree.
Related issues
Fixes #10525
Changes
nemoclaw/src/security/secret-scanner.ts: addNAMED_WORKSPACE_SEGMENT,anchored on
/.openclaw/so project directories namedworkspace-*keepclassifying as non-memory.
nemoclaw/src/security/secret-scanner.test.ts: extend the existingmatches named-workspace daily memory pathsanddoes not match unanchored workspace in project pathscases.Verification
npx vitest run --project plugin— 37 files, 1053 passedmain, new test kept:/workspace-[^/]+\//) instead failsdoes not match unanchored workspace in project paths— 1 failed | 55 passednpm --prefix nemoclaw run typecheck,npx oxlint,npx oxfmt --check— cleandocs-updatedSigned-off-by: Udaya Tejas [email protected]
Summary by CodeRabbit
Bug Fixes
.openclawdirectory.Documentation