Skip to content
Closed
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
19 changes: 19 additions & 0 deletions .github/workflows/nightly-e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ on:
overlayfs-autofix-e2e, device-auth-health-e2e,
launchable-smoke-e2e, gpu-e2e, gpu-double-onboard-e2e,
channels-add-remove-e2e, channels-stop-start-e2e, brave-search-e2e,
duckduckgo-search-e2e,
sessions-agents-cli-e2e
required: false
type: string
Expand Down Expand Up @@ -599,6 +600,21 @@ jobs:
nvidia_api_key: true
github_token: true
secrets: *nightly-e2e-default-secrets
duckduckgo-search-e2e:
if: >-
github.repository == 'NVIDIA/NemoClaw' && (github.event_name != 'workflow_dispatch' ||
inputs.jobs == '' ||
contains(format(',{0},', inputs.jobs), ',duckduckgo-search-e2e,'))
uses: ./.github/workflows/e2e-script.yaml
with:
ref: ${{ inputs.target_ref || github.ref }}
script: test/e2e/test-duckduckgo-search-e2e.sh
artifact_name: "install-log-duckduckgo-search"
artifact_path: "/tmp/nemoclaw-e2e-duckduckgo-search-onboard.log"
env_json: '{"NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE":"1","NEMOCLAW_NON_INTERACTIVE":"1","NEMOCLAW_EXPERIMENTAL":"1","NEMOCLAW_WEB_SEARCH_PROVIDER":"duckduckgo","NEMOCLAW_SANDBOX_NAME":"e2e-duckduckgo-search"}'
nvidia_api_key: true
github_token: true
secrets: *nightly-e2e-default-secrets
kimi-inference-compat-e2e:
if: >-
github.repository == 'NVIDIA/NemoClaw' &&
Expand Down Expand Up @@ -1912,6 +1928,7 @@ jobs:
channels-add-remove-e2e,
channels-stop-start-e2e,
brave-search-e2e,
duckduckgo-search-e2e,
kimi-inference-compat-e2e,
bedrock-runtime-compatible-anthropic-e2e,
token-rotation-e2e,
Expand Down Expand Up @@ -2020,6 +2037,7 @@ jobs:
channels-add-remove-e2e,
channels-stop-start-e2e,
brave-search-e2e,
duckduckgo-search-e2e,
kimi-inference-compat-e2e,
bedrock-runtime-compatible-anthropic-e2e,
token-rotation-e2e,
Expand Down Expand Up @@ -2185,6 +2203,7 @@ jobs:
channels-add-remove-e2e,
channels-stop-start-e2e,
brave-search-e2e,
duckduckgo-search-e2e,
kimi-inference-compat-e2e,
bedrock-runtime-compatible-anthropic-e2e,
token-rotation-e2e,
Expand Down
5 changes: 5 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -505,6 +505,10 @@ ARG NEMOCLAW_PROXY_PORT=3128
# The actual API key is injected at runtime via openshell:resolve:env, never
# baked into the image.
ARG NEMOCLAW_WEB_SEARCH_ENABLED=0
# Non-secret flag: name of the web search provider when web search is enabled.
# Defaults to "brave"; "duckduckgo" is gated behind NEMOCLAW_EXPERIMENTAL=1
# during onboard and is keyless (no API key is baked or injected).
ARG NEMOCLAW_WEB_SEARCH_PROVIDER=brave
ARG NEMOCLAW_OPENCLAW_OTEL=0
ARG NEMOCLAW_OPENCLAW_OTEL_ENDPOINT=http://host.openshell.internal:4318
ARG NEMOCLAW_OPENCLAW_OTEL_SERVICE_NAME=openclaw-gateway
Expand Down Expand Up @@ -538,6 +542,7 @@ ENV NEMOCLAW_MODEL=${NEMOCLAW_MODEL} \
NEMOCLAW_PROXY_HOST=${NEMOCLAW_PROXY_HOST} \
NEMOCLAW_PROXY_PORT=${NEMOCLAW_PROXY_PORT} \
NEMOCLAW_WEB_SEARCH_ENABLED=${NEMOCLAW_WEB_SEARCH_ENABLED} \
NEMOCLAW_WEB_SEARCH_PROVIDER=${NEMOCLAW_WEB_SEARCH_PROVIDER} \
NEMOCLAW_OPENCLAW_OTEL=${NEMOCLAW_OPENCLAW_OTEL} \
NEMOCLAW_OPENCLAW_OTEL_ENDPOINT=${NEMOCLAW_OPENCLAW_OTEL_ENDPOINT} \
NEMOCLAW_OPENCLAW_OTEL_SERVICE_NAME=${NEMOCLAW_OPENCLAW_OTEL_SERVICE_NAME} \
Expand Down
7 changes: 4 additions & 3 deletions docs/get-started/quickstart.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,9 @@ Non-interactive runs (`NEMOCLAW_NON_INTERACTIVE=1`) print the summary for log cl
### Configure Web Search and Messaging

After you confirm the summary, NemoClaw registers the selected provider with the OpenShell gateway and sets the `inference.local` route.
The wizard then asks whether to enable Brave Web Search.
If you enable it, enter a Brave Search API key when prompted.
The wizard then asks whether to enable Web Search.
If you accept, the wizard selects Brave Search by default and prompts for a Brave Search API key.
When `NEMOCLAW_EXPERIMENTAL=1` is set, the wizard also offers an unofficial, keyless DuckDuckGo backend; set `NEMOCLAW_WEB_SEARCH_PROVIDER=duckduckgo` to pre-select it and skip the provider prompt in both interactive and non-interactive runs.

The wizard also offers messaging channels such as Telegram, Discord, Slack, WeChat, and WhatsApp.
Press a channel number to toggle it, then press Enter to continue.
Expand All @@ -312,7 +313,7 @@ Review [Messaging Channels](../manage-sandboxes/messaging-channels) before enabl

After the sandbox image builds and OpenClaw starts inside the sandbox, NemoClaw asks which network policy tier to apply.
Web search and messaging selections happen before this point so the sandbox image and the policy suggestions stay aligned.
The default **Balanced** tier includes common development presets such as npm, PyPI, Hugging Face, Homebrew, and Brave Search when the selected agent supports web search.
The default **Balanced** tier includes common development presets such as npm, PyPI, Hugging Face, Homebrew, and either Brave Search or DuckDuckGo (depending on the provider you picked) when the selected agent supports web search.
Use the arrow keys or `j` and `k` to move, Space to select, and Enter to confirm.

The preset selector lets you include more destinations, such as GitHub, Jira, Slack, Telegram, or local inference.
Expand Down
12 changes: 12 additions & 0 deletions docs/reference/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,18 @@ BRAVE_API_KEY=... \
If Brave Search key validation fails in non-interactive mode, onboarding prints a warning, skips web search setup, and continues with the rest of the sandbox setup.
After fixing the key, re-enable web search with `nemoclaw config web-search`.

To enable the experimental DuckDuckGo Web Search backend in non-interactive mode, set the experimental flag, the provider, and accept the third-party software notice (or pass `--yes-i-accept-third-party-software`):

```bash
NEMOCLAW_EXPERIMENTAL=1 NEMOCLAW_WEB_SEARCH_PROVIDER=duckduckgo \
NEMOCLAW_ACCEPT_THIRD_PARTY_SOFTWARE=1 \
nemoclaw onboard --non-interactive
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
```

`NEMOCLAW_WEB_SEARCH_PROVIDER=duckduckgo` selects the DuckDuckGo backend, which has no API key requirement.
The DuckDuckGo backend is unofficial and rate-limited; do not depend on it for production workloads.
In interactive mode, the wizard prompts for `[brave/duckduckgo]` only when `NEMOCLAW_EXPERIMENTAL=1` is set and `NEMOCLAW_WEB_SEARCH_PROVIDER` is unset; otherwise it defaults to Brave. Pre-setting `NEMOCLAW_WEB_SEARCH_PROVIDER=duckduckgo` (together with `NEMOCLAW_EXPERIMENTAL=1`) skips the provider prompt and selects DuckDuckGo directly in both interactive and non-interactive modes.

The wizard prompts for a sandbox name.
Names must be 1 to 63 characters, lowercase, start with a letter, contain only letters, numbers, and internal hyphens, and end with a letter or number.
The CLI rejects names that do not match these rules.
Expand Down
12 changes: 7 additions & 5 deletions docs/reference/network-policies.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,16 @@ The baseline policy is always applied regardless of the selected tier.
| Tier | Presets included | Description |
|------|------------------|-------------|
| Restricted | None | Base sandbox only. No third-party network access beyond inference and core agent tooling. |
| Balanced (default) | `npm`, `pypi`, `huggingface`, `brew`, `brave when supported` | Full dev tooling and web search for agents that support web search. No messaging platform access. |
| Open | `npm`, `pypi`, `huggingface`, `brew`, `brave when supported`, `slack`, `discord`, `telegram`, `wechat` (experimental), `whatsapp` (experimental), `jira`, `outlook` | Broad access across third-party services including messaging and productivity. |
| Balanced (default) | `npm`, `pypi`, `huggingface`, `brew`, web-search preset (when supported) | Full dev tooling and web search for agents that support web search. No messaging platform access. |
| Open | `npm`, `pypi`, `huggingface`, `brew`, web-search preset (when supported), `slack`, `discord`, `telegram`, `wechat` (experimental), `whatsapp` (experimental), `jira`, `outlook` | Broad access across third-party services including messaging and productivity. |

After selecting a tier, a combined preset and access-mode screen lets you include or exclude individual presets and toggle each between read (GET only) and read-write (GET + POST/PUT/PATCH) access.
Tier-default presets are pre-selected; additional presets can be added from the full list.
NemoClaw filters tier defaults by the active agent's supported integrations.
For example, Hermes onboarding omits the Brave Search preset because Hermes does not use NemoClaw's OpenClaw web-search configuration.
Claude Code direct egress is not included in any policy tier.
NemoClaw filters tier defaults by the active agent's supported integrations and the selected web-search provider.
The included web-search preset depends on the provider you picked during onboarding: `brave` for Brave Search (default) or `duckduckgo` for the experimental DuckDuckGo backend.
NemoClaw prunes the unused web-search preset from the tier defaults.
For example, Hermes onboarding omits the web-search preset because Hermes does not use NemoClaw's OpenClaw web-search configuration.
Claude Code direct egress is not included in any tier or `shields down` permissive policy.
If you install and run the Claude Code CLI inside the sandbox with its own credentials, apply the `claude-code` preset explicitly.
Normal NemoClaw Anthropic inference still routes through the OpenShell gateway.

Expand Down
28 changes: 28 additions & 0 deletions nemoclaw-blueprint/policies/presets/duckduckgo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
preset:
name: duckduckgo
description: "DuckDuckGo Search access (experimental, unofficial, keyless)"
network_policies:
duckduckgo:
name: duckduckgo
endpoints:
- host: duckduckgo.com
port: 443
protocol: rest
enforcement: enforce
rules:
- allow: { method: GET, path: "/**" }
- allow: { method: POST, path: "/**" }
- host: lite.duckduckgo.com
port: 443
protocol: rest
enforcement: enforce
rules:
- allow: { method: GET, path: "/**" }
- allow: { method: POST, path: "/**" }
binaries:
- { path: /usr/local/bin/node }
- { path: /usr/bin/node }
- { path: /usr/local/bin/curl }
- { path: /usr/bin/curl }
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
23 changes: 23 additions & 0 deletions nemoclaw-blueprint/provider-profiles/duckduckgo.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
id: duckduckgo
display_name: DuckDuckGo Search
description: DuckDuckGo Search access (experimental, unofficial, keyless)
category: agent
endpoints:
- host: duckduckgo.com
port: 443
protocol: rest
access: read-write
enforcement: enforce
- host: lite.duckduckgo.com
port: 443
protocol: rest
access: read-write
enforcement: enforce
binaries:
- /usr/local/bin/node
- /usr/bin/node
- /usr/local/bin/curl
- /usr/bin/curl
inference_capable: false
18 changes: 13 additions & 5 deletions scripts/generate-openclaw-config.mts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
// NEMOCLAW_EXTRA_AGENTS_JSON_B64,
// NEMOCLAW_PROXY_HOST, NEMOCLAW_PROXY_PORT,
// NEMOCLAW_OPENCLAW_MANAGED_PROXY, NEMOCLAW_WEB_SEARCH_ENABLED,
// NEMOCLAW_WEB_SEARCH_PROVIDER,
// NEMOCLAW_OPENCLAW_OTEL, NEMOCLAW_OPENCLAW_OTEL_ENDPOINT,
// NEMOCLAW_OPENCLAW_OTEL_SERVICE_NAME, NEMOCLAW_OPENCLAW_OTEL_SAMPLE_RATE.

Expand Down Expand Up @@ -1072,11 +1073,18 @@ export function buildConfig(env: Env = process.env): JsonObject {
tools.web.fetch = { enabled: true, useTrustedEnvProxy: true };

if (env.NEMOCLAW_WEB_SEARCH_ENABLED === "1") {
tools.web.search = {
enabled: true,
provider: "brave",
apiKey: "openshell:resolve:env:BRAVE_API_KEY",
};
if (env.NEMOCLAW_WEB_SEARCH_PROVIDER === "duckduckgo") {
tools.web.search = {
enabled: true,
provider: "duckduckgo",
};
} else {
tools.web.search = {
enabled: true,
provider: "brave",
apiKey: "openshell:resolve:env:BRAVE_API_KEY",
};
}
}

return config;
Expand Down
59 changes: 58 additions & 1 deletion src/lib/inference/web-search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,67 @@

import { describe, expect, it } from "vitest";

import { BRAVE_API_KEY_ENV } from "./web-search";
import {
BRAVE_API_KEY_ENV,
isWebSearchEnabled,
isWebSearchProvider,
normalizeWebSearchProvider,
} from "./web-search";

describe("web-search module", () => {
it("exports BRAVE_API_KEY_ENV constant", () => {
expect(BRAVE_API_KEY_ENV).toBe("BRAVE_API_KEY");
});
});

describe("isWebSearchEnabled", () => {
it("returns false for null or undefined", () => {
expect(isWebSearchEnabled(null)).toBe(false);
expect(isWebSearchEnabled(undefined)).toBe(false);
});

it("returns false when fetchEnabled is not literally true", () => {
expect(isWebSearchEnabled({})).toBe(false);
expect(isWebSearchEnabled({ fetchEnabled: false })).toBe(false);
expect(isWebSearchEnabled({ fetchEnabled: null })).toBe(false);
});

it("returns true regardless of provider when fetchEnabled is true", () => {
expect(isWebSearchEnabled({ fetchEnabled: true })).toBe(true);
expect(
isWebSearchEnabled({ fetchEnabled: true, provider: "duckduckgo" } as {
fetchEnabled: boolean;
}),
).toBe(true);
});
});

describe("isWebSearchProvider", () => {
it("accepts the known allowlist values", () => {
expect(isWebSearchProvider("brave")).toBe(true);
expect(isWebSearchProvider("duckduckgo")).toBe(true);
});

it("rejects unknown values, including realistic typos and rogue inputs", () => {
expect(isWebSearchProvider("bing")).toBe(false);
expect(isWebSearchProvider("Brave")).toBe(false);
expect(isWebSearchProvider("")).toBe(false);
expect(isWebSearchProvider(null)).toBe(false);
expect(isWebSearchProvider(undefined)).toBe(false);
expect(isWebSearchProvider(42)).toBe(false);
});
});

describe("normalizeWebSearchProvider", () => {
it("returns the value when valid", () => {
expect(normalizeWebSearchProvider("brave")).toBe("brave");
expect(normalizeWebSearchProvider("duckduckgo")).toBe("duckduckgo");
});

it("falls back to the default provider for invalid values", () => {
expect(normalizeWebSearchProvider("bing")).toBe("brave");
expect(normalizeWebSearchProvider("")).toBe("brave");
expect(normalizeWebSearchProvider(null)).toBe("brave");
expect(normalizeWebSearchProvider(undefined)).toBe("brave");
});
});
21 changes: 21 additions & 0 deletions src/lib/inference/web-search.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

export type WebSearchProvider = "brave" | "duckduckgo";

export const WEB_SEARCH_PROVIDERS: readonly WebSearchProvider[] = ["brave", "duckduckgo"];

export const DEFAULT_WEB_SEARCH_PROVIDER: WebSearchProvider = "brave";

export function isWebSearchProvider(value: unknown): value is WebSearchProvider {
return WEB_SEARCH_PROVIDERS.includes(value as WebSearchProvider);
}

export function normalizeWebSearchProvider(value: unknown): WebSearchProvider {
return isWebSearchProvider(value) ? value : DEFAULT_WEB_SEARCH_PROVIDER;
}

export interface WebSearchConfig {
fetchEnabled: boolean;
provider?: WebSearchProvider;
}

export function isWebSearchEnabled(
webSearchConfig: { fetchEnabled?: boolean | null } | null | undefined,
): boolean {
return webSearchConfig?.fetchEnabled === true;
}

export const BRAVE_API_KEY_ENV = "BRAVE_API_KEY";
2 changes: 1 addition & 1 deletion src/lib/onboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7018,7 +7018,7 @@ async function onboard(opts: OnboardOptions = {}): Promise<void> {
hermesToolGateways,
stagedLegacyKeys,
migratedLegacyKeys,
webSearchEnabled: braveProviderProfile.shouldEnableBraveWebSearch(webSearchConfig),
webSearchEnabled: webSearch.isWebSearchEnabled(webSearchConfig),
deps: {
ensureAgentDashboardForward,
setDefaultSandbox: registry.setDefault,
Expand Down
13 changes: 10 additions & 3 deletions src/lib/onboard/brave-provider-profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,19 @@ export const BRAVE_PROVIDER_PROFILE_ID = "brave";
* `createSandbox` to push a Brave provider/token and trip the BRAVE_API_KEY-
* required abort even when the feature is off, while the downstream
* finalization/verifier paths already gate on `fetchEnabled`. Keep every gate
* routed through this helper so they stay aligned.
* routed through this helper so they stay aligned. A web-search config that
* names a non-Brave provider (e.g. `duckduckgo`) does not enable Brave-specific
* setup paths, even when `fetchEnabled` is true.
*/
export function shouldEnableBraveWebSearch(
webSearchConfig: { fetchEnabled?: boolean | null } | null | undefined,
webSearchConfig:
| { fetchEnabled?: boolean | null; provider?: string | null }
| null
| undefined,
): boolean {
return Boolean(webSearchConfig?.fetchEnabled);
if (!webSearchConfig?.fetchEnabled) return false;
const provider = webSearchConfig.provider;
return !provider || provider === BRAVE_PROVIDER_PROFILE_ID;
}

export type BraveProviderProfileDeps = {
Expand Down
Loading
Loading