Skip to content

feat(presets): add SidClaw agent governance preset - #1044

Closed
VladUZH wants to merge 4 commits into
NVIDIA:mainfrom
VladUZH:add-sidclaw-preset
Closed

feat(presets): add SidClaw agent governance preset#1044
VladUZH wants to merge 4 commits into
NVIDIA:mainfrom
VladUZH:add-sidclaw-preset

Conversation

@VladUZH

@VladUZH VladUZH commented Mar 28, 2026

Copy link
Copy Markdown

Summary

Adds a network policy preset for SidClaw, an agent governance platform that adds policy evaluation, human-in-the-loop approval, and hash-chain audit trails to tools running inside NemoClaw sandboxes.

NemoClaw secures the sandbox (network, filesystem, process). SidClaw governs what happens inside it (policy, approval, audit).

What this preset enables

The sidclaw preset allows the sandbox to reach the SidClaw API (api.sidclaw.com:443) for:

  • Policy evaluationPOST /api/v1/evaluate — every tool call checked against governance policies
  • Approval pollingGET /api/v1/approvals/** — wait for human approval on high-risk actions
  • Outcome recordingPOST /api/v1/traces/*/outcome — tamper-proof audit trail
  • Agent identityGET /api/v1/agents/** — resolve agent permissions

Usage

Add sidclaw to your blueprint's preset list, then use the SidClaw SDK:

import { governNemoClawTools } from '@sidclaw/sdk/nemoclaw';

const governed = governNemoClawTools(client, tools, {
  sandboxName: 'my-sandbox',
  dataClassification: { send_email: 'confidential' },
});
from sidclaw.middleware.nemoclaw import govern_nemoclaw_tools

governed = govern_nemoclaw_tools(client, tools, config)

Links

Summary by CodeRabbit

  • New Features
    • Added a new "sidclaw" policy preset with governance features including policy evaluation, human approval workflows, and comprehensive audit trails
    • Configured secure network communications with TLS encryption for API endpoints
    • Restricted executable access to authorized SidClaw-specific binaries only

@coderabbitai

coderabbitai Bot commented Mar 28, 2026

Copy link
Copy Markdown
Contributor

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: 356db56b-820a-4c76-9478-69fdaa8b2680

📥 Commits

Reviewing files that changed from the base of the PR and between 0c84900 and ae0cf96.

📒 Files selected for processing (1)
  • nemoclaw-blueprint/policies/presets/sidclaw.yaml
✅ Files skipped from review due to trivial changes (1)
  • nemoclaw-blueprint/policies/presets/sidclaw.yaml

📝 Walkthrough

Walkthrough

A new YAML policy preset file for sidclaw governance configuration has been added. The preset defines network policies for a REST endpoint at api.sidclaw.com:443 with specific method/path patterns and enforces an executable allowlist restricted to SidClaw-specific binaries.

Changes

Cohort / File(s) Summary
SidClaw Policy Preset
nemoclaw-blueprint/policies/presets/sidclaw.yaml
New policy preset configuration defining sidclaw governance with REST endpoint network policies (POST /api/v1/evaluate, GET /api/v1/approvals/**, POST /api/v1/traces/*/outcome, GET /api/v1/agents/**) and binary allowlist restrictions (/usr/local/bin/sidclaw*, /usr/local/bin/sidclaw-mcp-proxy).

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Poem

🐰 A new preset hops into place,
SidClaw policies bring governance grace,
REST endpoints secured with care,
Binaries bounded, audit trails fair,
Configuration magic—let policies dance! ✨

🚥 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 change: adding a new SidClaw agent governance preset configuration file. It is concise, specific, and uses conventional commit format (feat scope).
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.

@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: 3

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

Inline comments:
In `@nemoclaw-blueprint/policies/presets/sidclaw.yaml`:
- Around line 4-6: The new preset entry "sidclaw" was added (preset.name =
sidclaw), so update the preset-list test assertions in policies.test.js: add
"sidclaw" to the expected names array/list and increment the expected total
count (or update the snapshot) so the test that verifies preset names/count
passes; ensure any ordering-sensitive assertion matches the actual order used by
the preset loader.
- Around line 24-26: The binaries allowlist in the preset currently whitelists
full interpreters via the "binaries" section (entries for /usr/local/bin/node
and /usr/bin/python3), which is too broad; update the preset to remove these
generic interpreter paths and instead whitelist only the minimal, explicit
executables or wrapper scripts the preset actually needs (e.g., specific CLI
binaries, application launchers, or hashed file entries) so that merging presets
won’t unintentionally grant broad execution surface—locate the "binaries" list
in sidclaw.yaml and replace the interpreter entries with targeted binaries or
remove them entirely if not required.
- Around line 20-21: The policy currently grants write access to approval
decisions via the two entries allow: { method: POST, path:
"/api/v1/approvals/*/approve" } and allow: { method: POST, path:
"/api/v1/approvals/*/deny" } in sidclaw.yaml which is broader than intended;
remove these two POST allow rules (or replace them with a tightly scoped rule
limited to an admin/service role or additional attribute checks) so only the
intended polling GET routes remain (e.g., keep GET /api/v1/approvals/**) and
ensure any approval/deny mutation is only permitted for an explicitly authorized
role.
🪄 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: d6b1f957-a789-42ff-8133-242c032c56ac

📥 Commits

Reviewing files that changed from the base of the PR and between eb4ba8c and 8673747.

📒 Files selected for processing (1)
  • nemoclaw-blueprint/policies/presets/sidclaw.yaml

Comment thread nemoclaw-blueprint/policies/presets/sidclaw.yaml
Comment thread nemoclaw-blueprint/policies/presets/sidclaw.yaml Outdated
Comment thread nemoclaw-blueprint/policies/presets/sidclaw.yaml Outdated
@wscurran

Copy link
Copy Markdown
Contributor

✨ Thanks for submitting this proposal with a detailed summary, it addresses the addition of a network policy preset for SidClaw, an agent governance platform that could improve the security and governance of tools running inside NemoClaw sandboxes.

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

🧹 Nitpick comments (1)
test/policies.test.js (1)

10-13: Reduce redundant count assertion maintenance.

This count check duplicates the stronger name-list assertion below and requires a second manual update whenever a preset is added/removed. Consider deriving the count from the expected names list or removing this test to avoid drift.

♻️ Optional simplification
-    it("returns all 10 presets", () => {
-      const presets = policies.listPresets();
-      expect(presets.length).toBe(10);
-    });
+    it("returns all expected presets", () => {
+      const names = policies
+        .listPresets()
+        .map((p) => p.name)
+        .sort();
+      const expected = [
+        "discord",
+        "docker",
+        "huggingface",
+        "jira",
+        "npm",
+        "outlook",
+        "pypi",
+        "sidclaw",
+        "slack",
+        "telegram",
+      ];
+      expect(names).toEqual(expected);
+    });
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/policies.test.js` around lines 10 - 13, The test asserts a hardcoded
count for policies.listPresets() which duplicates the stronger name-list
assertion and will drift when presets change; update the test to derive the
expected length from the expected names array (e.g., use expectedNames.length
when asserting presets.length) or remove the redundant "returns all 10 presets"
test entirely so maintenance only occurs in the single canonical name-list
assertion that checks listPresets().
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/policies.test.js`:
- Around line 10-13: The test asserts a hardcoded count for
policies.listPresets() which duplicates the stronger name-list assertion and
will drift when presets change; update the test to derive the expected length
from the expected names array (e.g., use expectedNames.length when asserting
presets.length) or remove the redundant "returns all 10 presets" test entirely
so maintenance only occurs in the single canonical name-list assertion that
checks listPresets().

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 02a6f694-e4d4-4b3a-b532-df21241c9859

📥 Commits

Reviewing files that changed from the base of the PR and between 8673747 and cf40453.

📒 Files selected for processing (2)
  • nemoclaw-blueprint/policies/presets/sidclaw.yaml
  • test/policies.test.js
🚧 Files skipped from review as they are similar to previous changes (1)
  • nemoclaw-blueprint/policies/presets/sidclaw.yaml

@VladUZH

VladUZH commented Apr 3, 2026

Copy link
Copy Markdown
Author

Hi @wscurran, thanks for the positive review. All CodeRabbit feedback has been addressed. Is there anything else needed to get this across the line?

@cv

cv commented Apr 9, 2026

Copy link
Copy Markdown
Collaborator

I retried the automated JS→TS migration port, but this branch still needs manual follow-up after merging main.

Please start with:

git fetch origin
git merge origin/main
npx tsx scripts/ts-migration-assist.ts --base origin/main --write
npm run build:cli
npm run typecheck:cli
npm run lint
npm test

@VladUZH

VladUZH commented Apr 9, 2026

Copy link
Copy Markdown
Author

Done — merged upstream/main and ran the TS migration.

What happened:

  1. Merged upstream/main (252 commits) into the branch. One conflict: test/policies.test.js was deleted upstream (migrated to TS) but modified in our branch. Resolved by dropping the JS file and porting our sidclaw additions (preset count bump 10→11, "sidclaw" in sorted list) into test/policies.test.ts.

  2. Ran npx tsx scripts/ts-migration-assist.ts --base upstream/main --write. The script rewrote two path constants in test/policies.test.ts (CLI_PATH and POLICIES_PATH) from bin/ to src/ targets. Reverted those two changes because these paths are used inside String.raw templates that generate JS scripts executed by spawnSync(process.execPath, ...) — plain Node.js can't require() .ts files. With the src/ paths, 10 tests fail; with the original bin/ paths, all 60 policies tests pass.

  3. npm run build:cli — passes

  4. npm run typecheck:cli — passes

  5. npm run lint — passes

  6. npm test — 1185 passed, 4 failed. The 4 failures are pre-existing timeouts in test/cli.test.ts (gateway/sandbox infrastructure tests) that also fail on upstream/main in the same way.

VladUZH and others added 3 commits April 10, 2026 00:54
Adds a network policy preset for SidClaw (https://sidclaw.com), an
agent governance platform that adds policy evaluation, human-in-the-loop
approval, and hash-chain audit trails to tools running inside NemoClaw
sandboxes.

The preset allows the sandbox to reach the SidClaw API for:
- Policy evaluation (POST /api/v1/evaluate)
- Approval status polling (GET /api/v1/approvals/**)
- Outcome recording (POST /api/v1/traces/*/outcome)
- Agent identity resolution (GET /api/v1/agents/**)

Usage: Add `sidclaw` to your blueprint's preset list, then use the
SidClaw SDK (`@sidclaw/sdk/nemoclaw` or `sidclaw.middleware.nemoclaw`)
to wrap tool execution with governance.

Docs: https://docs.sidclaw.com/docs/integrations/nemoclaw
Signed-off-by: Vladimir <vladimir@vlpetrov.com>
…tests

- Remove POST /approve and POST /deny routes from the sidclaw preset.
  Approval decisions are made by human reviewers on the SidClaw dashboard,
  not from inside the sandbox. The agent only needs to poll approval
  status (GET), not send decisions.

- Add comment explaining dual-binary (node + python3) rationale:
  SidClaw ships both TypeScript and Python SDKs.

- Update test/policies.test.js: preset count 9 → 10, add "sidclaw"
  to expected names array.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Vladimir <vladimir@vlpetrov.com>
…ate tests

Narrow the binaries allowlist from generic node/python3 interpreters to
SidClaw-specific binaries (sidclaw*, sidclaw-mcp-proxy). The approve/deny
POST routes and test updates were already addressed in cf40453.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Vladimir <vladimir@vlpetrov.com>
@VladUZH
VladUZH force-pushed the add-sidclaw-preset branch from a14d798 to ae0cf96 Compare April 9, 2026 22:56
Signed-off-by: Vladimir <vladimir@vlpetrov.com>
@wscurran

Copy link
Copy Markdown
Contributor

Thanks for contributing the SidClaw governance preset. We're currently reviewing our approach to third-party integrations in NemoClaw, including scope and support model. Tagging this for evaluation as part of that review — we'll follow up once we have clearer guidance on how we're handling new integration PRs.

@wscurran wscurran added area: integrations Third-party service integration behavior feature PR adds or expands user-visible functionality needs: review PR is conflict-free and awaiting maintainer review and removed enhancement: feature needs: review PR is conflict-free and awaiting maintainer review labels Jun 3, 2026
@apurvvkumaria apurvvkumaria self-assigned this Jul 8, 2026
@apurvvkumaria

Copy link
Copy Markdown
Collaborator

Closing this revision without merge after a current-head merge-gate and 9-category security review.

Credit first: @VladUZH, the least-privilege intent here is good. Your follow-up removed sandbox-side approve/deny mutations and replaced the original generic interpreter entries with proposed dedicated SidClaw paths. That narrowing materially improved the proposal and is explicitly credited even though no code is being carried forward.

SidClaw is live, not obsolete. The official integration guide is available, PyPI still publishes 0.1.2, and the official npm package has advanced from the 0.1.5 cited in this PR to 0.1.11. The current package still exports @sidclaw/sdk/nemoclaw and sidclaw-mcp-proxy. Closure is for the unsupported and unsafe integration boundary in this revision:

  1. The executable boundary is nonfunctional. The SDK middleware makes requests from the calling Node or Python process, and the published proxy is a Node script. Current OpenShell attributes script traffic through /proc/<pid>/exe and process ancestors, so script adapters require the interpreter grant (current NemoClaw boundary). This preset permits only /usr/local/bin/sidclaw*, installs neither path, and adds no agent package/runtime manifest. A normal SDK import, local npm install, or Python middleware call therefore cannot use the proposed egress policy.
  2. The current route contract is narrower than the preset. npm 0.1.11 calls POST /api/v1/evaluate, GET /api/v1/approvals/{id}/status, POST /api/v1/traces/{id}/outcome, and optionally PATCH /api/v1/traces/{id}/telemetry. The PR grants all GET paths below /api/v1/approvals/** plus /api/v1/agents/**, although the current SDK contains no agents read, and omits the optional telemetry route. The safe response is not to widen the preset mechanically.
  3. Authentication, secrets, and disclosure are not integrated. The published client requires SIDCLAW_API_KEY, sends it as an Authorization bearer, and the NemoClaw middleware serializes tool parameters into the remote evaluation context. This PR adds no OpenShell provider profile or placeholder flow, credential lifecycle, data minimization/redaction and size boundary, agent-specific support declaration, install path, health check, or failure-mode tests. Current managed configuration rejects credential-like manifest fields and routes them through provider profiles (credential boundary).
  4. The support and test surface is incomplete. A central preset is otherwise available across agents; this PR does not select a supported agent or runtime. The only test changes are catalog count/name assertions, with no executable-attribution, exact-route, provider-credential, data-disclosure, negative, or live contract coverage. No issue is linked, no duplicate/superseding SidClaw PR or issue exists, and the prior maintainer note already paused new third-party integrations pending a support model.
  5. The merge gate fails independently. The branch is DIRTY/conflicting, required checks, commit-lint, and dco-check runs are absent, the PR body has no valid Signed-off-by: declaration, and all four commits are GitHub-unverified/unsigned.
Security category Verdict Reason
Injection PASS Static YAML; no new command or query construction
Authentication / authorization FAIL Broad approval and unused agent reads; no managed auth binding
Secrets FAIL Raw bearer-key usage is required but no provider/placeholder lifecycle is supplied
Data validation WARNING Remote evaluation receives unbounded tool context without contract tests
Cryptography PASS HTTPS endpoint and schema-valid TLS termination
Information disclosure FAIL Tool parameters can leave the sandbox without redaction or explicit disclosure controls
Dependencies FAIL No supported/pinned install path; current npm contract has already moved
Sandbox isolation FAIL Allowed binaries do not match the process OpenShell observes
Logging / monitoring WARNING Remote audit claims lack NemoClaw health, failure, and local verification coverage

The changed files themselves add no prohibited external repository/community link; I did not use the unofficial example link in the PR body as evidence.

A viable future integration would require product/design authority for the supported agent set, SDK-versus-proxy runtime, interpreter-level blast radius, provider-managed credential flow, exact routes, and data handling contract. That is not a safe mechanical salvage of this branch. Thank you again, @VladUZH, for the original least-privilege proposal and the prior narrowing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: integrations Third-party service integration behavior feature PR adds or expands user-visible functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants