Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .agents/skills/nemoclaw-user-configure-inference/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ For the full compatible-endpoint prompt flow, non-interactive variables, API-pat

NemoClaw can use an already-running vLLM server on `localhost:8000`, start managed vLLM on supported NVIDIA GPU hosts, or manage a local NIM container when `NEMOCLAW_EXPERIMENTAL=1` is set.
Managed vLLM records the model returned by `/v1/models` and uses runtime metadata such as `max_model_len` when available.
If the host reboots and the `nemoclaw-vllm` container is stopped, NemoClaw restarts the managed vLLM container during recovery instead of requiring a fresh onboarding run.
NIM uses the same chat-completions API path restriction as vLLM.

For registry slugs, Hugging Face token requirements, NGC login behavior, and non-interactive examples, refer to [Inference Options](references/inference-options.md#setup-details-for-local-and-compatible-providers).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ Managed vLLM uses these profiles:
| Host profile | Default model |
|---|---|
| DGX Spark | `nvidia/Qwen3.6-35B-A3B-NVFP4` |
| DGX Station | `deepseek-ai/DeepSeek-V4-Flash` |
| DGX Station | `Qwen/Qwen3.6-27B-FP8` |
| Linux with an NVIDIA GPU | `nvidia/NVIDIA-Nemotron-3-Nano-4B-FP8` |

**Note:**
Expand Down Expand Up @@ -345,10 +345,10 @@ Recognized slugs are:

| Slug | Hugging Face model | Notes |
|---|---|---|
| `deepseek-v4-flash` | `deepseek-ai/DeepSeek-V4-Flash` | Default on the DGX Station profile |
| `qwen3.6-27b` | `Qwen/Qwen3.6-27B-FP8` | Supported override |
| `qwen3.6-27b` | `Qwen/Qwen3.6-27B-FP8` | Default on the DGX Station profile |
| `qwen3.6-35b-a3b-nvfp4` | `nvidia/Qwen3.6-35B-A3B-NVFP4` | Default on the DGX Spark profile |
| `nemotron-3-nano-4b` | `nvidia/NVIDIA-Nemotron-3-Nano-4B-FP8` | Default on the generic Linux + NVIDIA GPU profile |
| `deepseek-v4-flash` | `deepseek-ai/DeepSeek-V4-Flash` | Supported override |
| `deepseek-r1-distill-70b` | `deepseek-ai/DeepSeek-R1-Distill-Llama-70B` | Gated. Requires Hugging Face license acceptance |

The slug is case-insensitive; the full Hugging Face id is also accepted.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -221,16 +221,26 @@ nemoclaw onboard --resume --recreate-sandbox
Use `nemoclaw inference get` to print the provider and model the gateway is currently routing to.
Run it before `nemoclaw inference set` to confirm the starting state, or after a switch to verify the new route.

```console
$ nemoclaw inference get
```bash
nemoclaw inference get
```

Expected output:

```text
Provider: nvidia-prod
Model: nvidia/nemotron-3-super-120b-a12b
```

Pass `--json` for machine-readable output.

```console
$ nemoclaw inference get --json
```bash
nemoclaw inference get --json
```

Expected output:

```json
{
"provider": "nvidia-prod",
"model": "nvidia/nemotron-3-super-120b-a12b"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -321,6 +321,21 @@ This behavior is best effort: if the container runtime restricts `ulimit` modifi
| Risk if relaxed | Removing or raising the limit makes the sandbox vulnerable to fork-bomb attacks, where a runaway process spawns children until the host runs out of resources. If the entrypoint cannot set the limit (logs `[SECURITY] Could not set soft/hard nproc limit`), the container runs without process limits. |
| Recommendation | Keep the default at 512. If the agent runs workloads that spawn many child processes (such as parallel test runners), increase to 1024 and monitor host resource usage. If the entrypoint logs a warning about ulimit restrictions, set the limit through the container runtime instead. |

### Open File Descriptor Limit

An open file descriptor limit caps the number of files, sockets, and pipes the
sandbox user can hold open at once. The entrypoint sets both soft and hard
limits using `ulimit -n 65536`. This is best-effort: if the container runtime
restricts `ulimit` modification, the entrypoint logs a security warning and
continues without the limit.

| Aspect | Detail |
|---|---|
| Default | 65536 open files, soft and hard (`ulimit -n 65536`), best-effort. |
| What you can change | Increase or decrease the limit with `--ulimit nofile=N:N` in `docker run` or the `ulimits` section in Compose. The runtime-level ulimit takes precedence over the entrypoint's setting. |
| Risk if relaxed | Without this cap the sandbox inherits the Docker daemon default (`nofile` ~1048576). A runaway or hostile process can then open file descriptors until it exhausts them — a denial-of-service that can starve the gateway, the agent, or the host of file handles. If the entrypoint cannot set the limit (logs `[SECURITY] Could not set soft/hard nofile limit`), the container runs without a file-descriptor cap. Ref [#4527](https://github.com/NVIDIA/NemoClaw/issues/4527). |
| Recommendation | Keep the default at 65536. If the agent legitimately keeps many connections or files open, raise it deliberately and monitor host file-descriptor usage. If the entrypoint logs a warning about ulimit restrictions, set the limit through the container runtime instead. |

### Non-Root User

The sandbox runs agent processes as a dedicated `sandbox` user and group.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,23 @@ The startup script (`nemoclaw-start.sh`) applies the same limit.

Adjust the value with the `--ulimit nproc=512:512` flag if you launch with `docker run` directly.

## Open File Descriptor Limits

The same ENTRYPOINT also sets `ulimit -n 65536` to cap the number of open file
descriptors a sandbox user can hold. Without this cap the sandbox inherits the
Docker daemon default (`nofile` ~1048576), which can exceed the host runtime
limit and lets a runaway process exhaust file descriptors. The startup script
(`nemoclaw-start.sh`) applies the same limit.

Adjust the value via the `--ulimit nofile=65536:65536` flag if launching with
`docker run` directly.

Like the process limit, this is applied to the PID 1 entrypoint process tree
(gateway + agent). `openshell sandbox connect` shells are spawned outside that
tree and still inherit the runtime default (tracked upstream in
NVIDIA/OpenShell#1452), so enforce both limits at the container runtime when
that residual matters to you.

## Dropping Linux Capabilities

The NemoClaw entrypoint drops dangerous capabilities from the process bounding set before it starts agent services.
Expand All @@ -42,6 +59,7 @@ when you launch the image directly:
docker run --rm \
--cap-drop=ALL \
--ulimit nproc=512:512 \
--ulimit nofile=65536:65536 \
nemoclaw-sandbox
```

Expand All @@ -59,6 +77,9 @@ services:
nproc:
soft: 512
hard: 512
nofile:
soft: 65536
hard: 65536
security_opt:
- no-new-privileges:true
read_only: true
Expand Down Expand Up @@ -123,4 +144,5 @@ The `test/e2e/e2e-cloud-experimental/checks/04-landlock-readonly.sh` script vali
- [#807](https://github.com/NVIDIA/NemoClaw/issues/807): gcc in sandbox image
- [#808](https://github.com/NVIDIA/NemoClaw/issues/808): netcat in sandbox image
- [#809](https://github.com/NVIDIA/NemoClaw/issues/809): No process limit
- [#4527](https://github.com/NVIDIA/NemoClaw/issues/4527): Cap open file descriptors (nofile)
- [#797](https://github.com/NVIDIA/NemoClaw/issues/797): Drop Linux capabilities
Original file line number Diff line number Diff line change
Expand Up @@ -143,8 +143,13 @@ To chat with the agent from a terminal, follow these steps:
The onboard flow starts the dashboard port forward automatically.
Open the dashboard from the host:

```console
$ nemohermes my-hermes dashboard-url --quiet
```bash
nemohermes my-hermes dashboard-url --quiet
```

Expected output:

```text
http://127.0.0.1:18789/
```

Expand Down
57 changes: 57 additions & 0 deletions .agents/skills/nemoclaw-user-manage-policy/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,63 @@ nemoclaw my-assistant policy-remove my-internal-api --yes

`policy-remove` accepts both built-in and custom preset names. Run `nemoclaw <name> policy-list` to see every preset currently applied to the sandbox.

## Agent Policy Context

When an agent runs in the sandbox, it needs a compact view of the active policy so it can decide whether a host or integration is allowed and what to suggest when something fails.
`nemoclaw <name> policy-explain` prints that view as a redacted summary: the recorded tier, the applied presets and their allowed host categories, the known presets that are not applied, the inspect/add/remove commands that change policy, and the support boundaries between NemoClaw, OpenShell, and the agent.

```bash
nemoclaw my-assistant policy-explain
```

Pass `--json` to emit the same context as a structured object the agent can read:

```bash
nemoclaw my-assistant policy-explain --json
```

NemoClaw also seeds the rendered context inside the sandbox at `/sandbox/.openclaw/workspace/POLICY.md` once during onboarding and refreshes it on every `policy-add` or `policy-remove`, so the in-sandbox agent picks it up when it scans the workspace.
Pass `--write` to refresh that file on demand without changing the policy:

```bash
nemoclaw my-assistant policy-explain --write
```

The output is intentionally redacted.
Network policy rule bodies, credential metadata, and binary allowlists are not included; only host stems and category-level summaries appear.
Host stems that resolve to RFC 1918 ranges (10/8, 172.16/12, 192.168/16), loopback (127/8, `::1`), link-local (169.254/16, `fe80::/10`), cloud metadata (`169.254.169.254`), unique-local IPv6 (`fc00::/7`), reserved zero (0.0.0.0/8), CGNAT (100.64/10), benchmarking (198.18/15), `localhost`, and the internal DNS suffixes `.local`, `.internal`, `.lan`, `.home`, `.home.arpa`, `.corp`, `.intra`, `.intranet`, `.localdomain` are dropped from `allowedHostCategories` and surface as a `redactedHostCount`.

Each active preset also carries a `verification` field that tells the agent whether the OpenShell gateway actually enforces it:

| Status | Meaning |
|--------|---------|
| `verified` | Registry lists the preset and the gateway confirms it is enforced. Safe to treat the host stems as allowed. |
| `registry-only` | Registry lists the preset but the gateway does not enforce it (drift). Treat allowed hosts as unverified; the agent should not assume the traffic will reach the host. |
| `gateway-only` | Gateway enforces a preset the registry does not list. Reported as active so the agent does not misclassify allowed hosts as blocked. |
| `gateway-unavailable` | Could not probe the gateway (no live snapshot). The whole report is advisory; rely on `nemoclaw <sandbox> policy-list` once the gateway is reachable. |

The context also documents how the agent should classify a failed host or integration attempt.
The rules are evaluated in order so HTTP 403 has a single interpretation per call: when the host matches an applied preset the request is treated as an authentication failure, otherwise as a policy denial.

1. `unsupported` — the caller asserts the capability is not offered for this sandbox (for example, a messaging channel that the active agent does not support). The agent should surface the limitation without retrying.
2. `missing-approval` — the host **is** allowed by an applied preset and the request was refused with HTTP 401. The network path is open; credentials are missing or invalid.
3. `missing-approval` (low confidence) — the host **is** allowed by an applied preset and the request was refused with HTTP 403. Ambiguous: OpenShell policies enforce by method, path, protocol, and binary, so a 403 on an allowed host can still be a finer-grained policy denial rather than missing credentials. Confirm credentials first, then run `openshell policy get` to check whether the specific method or path is blocked.
4. `blocked-by-policy` — either the host is **not** allowed by any applied preset and either an existing built-in or custom preset declares it (apply that preset), or the request is refused with a network-block error code (`EHOSTUNREACH`, `ENETUNREACH`, `ENOTFOUND`, `ECONNREFUSED`, `ETIMEDOUT`, `EAI_AGAIN`) or HTTP 403. The same network-block codes also surface as `blocked-by-policy` (low confidence) when the host is on an applied but **unverified** preset (`registry-only` or `gateway-unavailable`), because a block code on a host the registry says should be allowed is the strongest signal that the gateway is not enforcing the preset.
5. `unknown` — none of the above apply; the agent should surface the underlying error. A network-block code on a host that matches a **verified** preset stays `unknown` because the gateway has confirmed enforcement, so the block must be an upstream connectivity failure rather than a policy denial.

Each classification also carries a `confidence` field set to `high` or `low`. Low-confidence verdicts mean the agent should report multiple possibilities to the user instead of treating the next-step recommendation as authoritative. Common low-confidence triggers are:

- HTTP 403 on an active host (ambiguous between missing credentials and a finer-grained OpenShell denial by method, path, protocol, or binary).
- The matched preset is `registry-only` (the registry lists it but the gateway does not enforce it) — the agent must not assume the host is reachable.
- The matched preset is `gateway-unavailable` (no live gateway snapshot was available) — the verdict is registry-derived and advisory.

Callers that already hold a verified gateway snapshot can pass it to the classifier so verdicts about hosts on verified presets stay high-confidence.

Use the classification to pick the next step.
For `blocked-by-policy`, run `nemoclaw <name> policy-add <preset>` or author a [custom preset](#custom-preset-files).
For `missing-approval`, confirm the API token and scopes for the integration.
For `unsupported`, surface the limitation to the user without retrying.

## References

- **[references/integration-policy-examples.md](references/integration-policy-examples.md)** — Guides users through common post-install integration policy setup for maintained NemoClaw policy presets, including Outlook, messaging channels, GitHub, Jira, Brave Search, package managers, Hugging Face, local inference, and OpenShell approval workflows.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
import { AgentOnly } from "../_components/AgentGuide";

Workspace and state files define your agent's personality, memory, user context, and durable runtime state.
They persist across sandbox restarts but are **permanently deleted** when you destroy the sandbox.
They persist across sandbox restarts, but destroying the sandbox **permanently deletes** them.

This guide covers snapshot commands, manual backup with CLI commands, and an automated script.
This guide covers snapshot commands, all-sandbox backups, and manual backup with CLI commands.

## When to Back Up

Expand Down Expand Up @@ -148,16 +148,36 @@ openshell sandbox upload "$SANDBOX" "$BACKUP_DIR/platforms/" /sandbox/.hermes/pl

</AgentOnly>

## Back Up All Running Sandboxes

To back up every registered, running sandbox in one step, run `nemoclaw backup-all`.
This is the recommended host-installed command before broad maintenance such as `nemoclaw update`, `nemoclaw upgrade-sandboxes`, or an OpenShell gateway migration.

```console
$ nemoclaw backup-all
```
Comment on lines +156 to +158

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 | 🟡 Minor | ⚡ Quick win

Use bash code block for copyable commands, not console with prompt.

Copyable CLI commands should use language-specific tags like bash without prompt markers. Reserve console blocks for terminal transcripts that include prompts and output.

📝 Suggested fix
-```console
-$ nemoclaw backup-all
+```bash
+nemoclaw backup-all
</details>

As per coding guidelines: Copyable CLI code blocks must use language-specific tags such as `bash`, `sh`, or `powershell`, and must not include prompt markers such as `$`.

<details>
<summary>🤖 Prompt for AI Agents</summary>

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/skills/nemoclaw-user-manage-sandboxes/references/backup-restore.md
around lines 156 - 158, Replace the copyable command block that currently uses a
console fenced block with a bash block and remove the prompt marker: change the
opening fence from console to bash and remove the leading "$ " before the
nemoclaw backup-all line so the block contains just "nemoclaw backup-all";
update the closing fence unchanged. This affects the fenced code block
containing the text "nemoclaw backup-all".


</details>

<!-- fingerprinting:phantom:triton:puma -->

<!-- cr-comment:v1:6f675e38a0c8ce4ddaee1d88 -->

_Source: Coding guidelines_

<!-- This is an auto-generated comment by CodeRabbit -->


`backup-all` walks the sandboxes registered on the host, creates a snapshot for each running sandbox, and stores the snapshot bundles under `~/.nemoclaw/rebuild-backups/<name>/`.
Use `nemoclaw <name> snapshot list` and `nemoclaw <name> snapshot restore` to inspect or restore one sandbox's bundles later.

## Using the Backup Script

<AgentOnly variant="openclaw">

The repository includes a convenience script at `scripts/backup-workspace.sh`.
**Source-tree helper script:**

The [`scripts/backup-workspace.sh`](https://github.com/NVIDIA/NemoClaw/blob/main/scripts/backup-workspace.sh) helper exists only in the NemoClaw source repository for engineering workflows.
It is not installed by the standard `curl -fsSL https://www.nvidia.com/nemoclaw.sh | bash` installer, so host installs should use `nemoclaw backup-all` or the snapshot commands above.

### Backup

```console
$ ./scripts/backup-workspace.sh backup my-assistant
```bash
./scripts/backup-workspace.sh backup my-assistant
```

Expected output:

```text
Backing up workspace from sandbox 'my-assistant'...
Backup saved to /home/user/.nemoclaw/backups/20260320-120000/ (6 items)
```
Expand All @@ -180,8 +200,13 @@ Restore from a specific timestamp:

List backed-up files to confirm completeness:

```console
$ ls -la ~/.nemoclaw/backups/20260320-120000/
```bash
ls -la ~/.nemoclaw/backups/20260320-120000/
```

Expected output:

```text
AGENTS.md
IDENTITY.md
MEMORY.md
Expand All @@ -206,7 +231,7 @@ When you configure OpenClaw with multiple named agents, each agent has its own w
Refer to [Multi-Agent Deployments](workspace-files.md#multi-agent-deployments).

`nemoclaw <name> snapshot create` automatically discovers every `workspace-*/` directory under the sandbox state tree and includes it in the snapshot bundle alongside the default `workspace/`.
`snapshot restore` reapplies the full per-agent set.
`nemoclaw <name> snapshot restore` reapplies the full per-agent set.
You do not need a manual per-workspace backup pattern.

The sandbox entrypoint ensures every per-agent workspace lives directly under the persistent `.openclaw/` tree, so state also survives `openshell sandbox restart`.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ Set `SLACK_ALLOWED_USERS` to comma-separated Slack member IDs to authorize those
Set `SLACK_ALLOWED_CHANNELS` to comma-separated Slack channel IDs to restrict channel `@mention` handling to those channels.
When both Slack allowlists are set, NemoClaw requires the mention to come from one of the allowed channels and one of the allowed members.
Channel messages still require an explicit bot mention.
When a Slack channel `@mention` is denied by these allowlists, NemoClaw sends a denial notice back to the sender instead of dropping the message silently.
During sandbox startup, NemoClaw normalizes OpenShell credential placeholders into the environment shape expected by the Slack runtime, so post-rebuild Slack starts use the gateway-managed tokens instead of literal placeholder strings.

WeChat (experimental) delivers messages over Tencent's iLink gateway through the upstream `@tencent-weixin/openclaw-weixin` plugin baked into the sandbox base image and the built-in Hermes iLink WeChat adapter.
Expand Down
8 changes: 4 additions & 4 deletions .agents/skills/nemoclaw-user-monitor-sandbox/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ Use these files when you need an audit trail, a compliance review surface, or re

To inspect the session directory from the host, run a sandbox command:

```console
$ nemoclaw sandbox exec <name> -- ls -lh /sandbox/.openclaw/agents/main/sessions
```bash
nemoclaw sandbox exec <name> -- ls -lh /sandbox/.openclaw/agents/main/sessions
```

To copy a session log for offline review, use the OpenShell sandbox download command:

```console
$ openshell sandbox download <name> /sandbox/.openclaw/agents/main/sessions/<session-id>.jsonl .
```bash
openshell sandbox download <name> /sandbox/.openclaw/agents/main/sessions/<session-id>.jsonl .
```

Treat exported session logs as sensitive data.
Expand Down
Loading
Loading