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
4 changes: 3 additions & 1 deletion docs/get-started/quickstart-langchain-deepagents-code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -237,13 +237,15 @@ nemo-deepagents <sandbox-name> rebuild

The shared `tavily` preset only opens `POST /search` and `POST /extract` egress to `api.tavily.com:443`. Attaching the credential provider alone does not authorize the managed Python interpreter; the explicit policy preset is the interpreter-level opt-in. Export `TAVILY_API_KEY` only for registration, then remove it from the host shell; the gateway injects the stored value at egress, and the sandbox never sees the raw value. NemoClaw does not bake `TAVILY_API_KEY` into the managed config or image, and the managed wrapper rejects direct service-key injection into `dcode`. Because OpenShell attributes the harness's calls to the sandbox `python3` interpreter, this egress is process-wide for sandbox Python rather than a `dcode`-only boundary.

The `tavily` preset binds its endpoint to the attached `tavily-search` provider when that provider uses the `tavily-policy-binding-v1` profile. OpenShell then replaces the `openshell:resolve:env:TAVILY_API_KEY` placeholder at egress. If the provider is already attached, `policy add` adds the binding. Otherwise, the next rebuild adds it. Resetting the gateway-wide `tavily-search` provider detaches every sandbox that uses it, so you must rebuild each detached sandbox after you register the replacement. If `tavily-search` uses the earlier `tavily` profile, reset it, register it again with `--agent dcode`, and rebuild each detached sandbox.

Remove the target sandbox's managed-Python opt-in when it is no longer needed.

```bash
nemo-deepagents <sandbox-name> policy remove tavily --yes
```

This does not unregister the gateway-wide `tavily-search` provider; its credential and Node/curl routes remain available to sandboxes that attach it. When no sandbox needs the provider, remove it globally with `nemo-deepagents credentials reset tavily-search --yes`. The command detaches current sandbox attachments, removes the gateway provider, and reports every detached sandbox that you must rebuild after registering a replacement.
This does not unregister the gateway-wide `tavily-search` provider. A provider that uses the `tavily-policy-binding-v1` profile opens no egress, so the sandbox cannot reach Tavily after you remove the preset. A provider that uses the earlier `tavily` profile still opens egress to `api.tavily.com` until you reset it. When no sandbox needs the provider, remove it globally with `nemo-deepagents credentials reset tavily-search --yes`. The command detaches current sandbox attachments, removes the gateway provider, and reports every detached sandbox that you must rebuild after registering a replacement.

</Accordion>

Expand Down
5 changes: 3 additions & 2 deletions docs/reference/commands.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3999,8 +3999,9 @@ Registered providers are gateway-wide and attach to every sandbox you build or r
Tavily requires a provider profile that permits the intended agent runtime.
Use `--type tavily --agent hermes` to select the versioned `tavily-hermes-v1` profile for Hermes Python.
The explicit `--type tavily-hermes-v1` form remains supported without `--agent`.
OpenClaw and Deep Agents use the existing `tavily` profile with `--agent openclaw` or `--agent dcode`.
Without `--agent`, `--type tavily` retains that profile and prints a warning that it does not authorise Hermes Python.
OpenClaw and Deep Agents use the endpointless `tavily-policy-binding-v1` profile with `--agent openclaw` or `--agent dcode`.
Without `--agent`, `--type tavily` also selects `tavily-policy-binding-v1` and prints a warning that it does not authorise Hermes Python.
A provider that you registered with the earlier `tavily` profile keeps that profile until you reset it and register it again.

`--agent` accepts `hermes`, `openclaw`, `langchain-deepagents-code`, and their aliases only for Tavily profiles.
An explicit Hermes profile combined with a non-Hermes agent is rejected before gateway operations.
Expand Down
20 changes: 20 additions & 0 deletions docs/reference/troubleshooting.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -822,6 +822,11 @@ $$nemoclaw <name> config get --key tools.web.search --format yaml

The provider should be `brave` or `tavily` and `enabled` should be `true`. If the provider is wrong, rerun onboarding with `NEMOCLAW_WEB_SEARCH_PROVIDER=brave` or `tavily` and the matching `BRAVE_API_KEY` or `TAVILY_API_KEY`.

If a rebuild reports that `TAVILY_API_KEY` is not available for a sandbox that was onboarded with the earlier `tavily` profile, export `TAVILY_API_KEY` and rerun the rebuild so NemoClaw registers `<name>-tavily-search` with the current profile.
If `logs` shows a `credential_unavailable` denial for `api.tavily.com`, confirm that `<name>-tavily-search` is attached and uses the `tavily-policy-binding-v1` profile, and compare the configured `tavily` endpoint with the checked-in preset.
A differing endpoint remains unbound even when the provider and profile are valid, and a rebuild preserves that edited policy.
If the endpoint differs, review your custom policy changes, reapply the `tavily` preset when appropriate, and then rerun `$$nemoclaw <name> rebuild`.

</AgentOnly>
<AgentOnly variant="hermes">

Expand Down Expand Up @@ -1857,6 +1862,21 @@ If Tavily is still blocked after rebuild, inspect recent policy denials:
nemo-deepagents <name> logs --tail 50
```

A `credential_unavailable` denial means the `tavily` endpoint has no usable credential binding.
NemoClaw adds the binding only when `tavily-search` is attached to the sandbox, uses the `tavily-policy-binding-v1` profile, and the `tavily` endpoint matches the checked-in preset.
Register the provider with `--agent dcode`, not `--agent hermes`.
Confirm that `nemo-deepagents credentials list` shows `tavily-search` and check its profile with `openshell provider get tavily-search`.
Resetting the gateway-wide `tavily-search` provider detaches every sandbox that uses it, so you must rebuild each detached sandbox after you register the replacement.
If `tavily-search` uses the earlier `tavily` profile, replace it and rebuild each detached sandbox:

```bash
nemo-deepagents credentials reset tavily-search --yes
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
export TAVILY_API_KEY=tvly-...
nemo-deepagents credentials add tavily-search --type tavily --agent dcode --credential TAVILY_API_KEY
unset TAVILY_API_KEY
nemo-deepagents <name> rebuild
```

The `tavily` preset is a managed-Python opt-in. It is process-wide for sandbox Python and is not a `dcode`-only boundary.

### Deep Agents read-only path checks fail
Expand Down
8 changes: 8 additions & 0 deletions docs/security/credential-storage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,10 @@ The documented Deep Agents flow uses the gateway-wide name `tavily-search` witho
</AgentOnly>
<AgentOnly variant="openclaw,deepagents">
Agent configuration uses `openshell:resolve:env:<KEY>` references instead of raw keys.
NemoClaw binds the `tavily` preset only to an attached provider named `tavily-search` or `<sandbox>-tavily-search` that uses the `tavily-policy-binding-v1` profile.
An endpointless Tavily provider without a matching binding cannot supply the credential for the placeholder, and OpenShell denies the request with `credential_unavailable`.
A provider that uses the earlier `tavily` profile declares the Tavily endpoint, so it can open egress to `api.tavily.com` without the `tavily` preset.
Reset that provider and register it again to use `tavily-policy-binding-v1`.
</AgentOnly>
<AgentOnly variant="hermes">
OpenShell supplies `TAVILY_API_KEY` through the Hermes process environment as a revision-scoped reference such as `openshell:resolve:env:v<revision>_TAVILY_API_KEY`.
Expand All @@ -119,7 +123,11 @@ The `tavily` policy preset enables request-body credential rewriting so OpenShel
<AgentOnly variant="deepagents">
For Deep Agents, the managed launch paths reject direct `TAVILY_API_KEY` injection into `dcode`.
Register the key with OpenShell through `$$nemoclaw credentials add tavily-search --type tavily --agent dcode --credential TAVILY_API_KEY`, then apply the `tavily` policy preset and rebuild the sandbox so the provider attaches.
Resetting the gateway-wide `tavily-search` provider detaches every sandbox that uses it, so you must rebuild each detached sandbox after you register the replacement.
If `tavily-search` uses the earlier `tavily` profile, run `$$nemoclaw credentials reset tavily-search --yes`, register it again with `--agent dcode`, and rebuild each detached sandbox.
The `tavily` preset is the sandbox-level network opt-in, while the `tavily-search` provider is gateway-wide and can attach to future sandboxes that you build or rebuild.
When `tavily-search` is attached to the sandbox and uses the `tavily-policy-binding-v1` profile, `policy add` and `rebuild` bind the `tavily` preset endpoint to that provider, so OpenShell replaces the placeholder at egress.
If `tavily-search` is not attached, the preset opens egress without a binding and OpenShell denies the request with `credential_unavailable`.
</AgentOnly>

Use a dedicated low-scope search key and keep the matching `brave` or `tavily` policy preset applied only while the sandbox needs web search.
Expand Down
24 changes: 24 additions & 0 deletions managed-inference/provider-profiles/tavily-policy-binding-v1.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

# Endpointless carrier for a Tavily credential bound by the tavily policy preset.
# OpenShell withholds a static credential stored under a profile that declares
# no endpoints until the sandbox policy names that profile's provider in an
# endpoint credential_binding. A profile that already declares endpoints cannot
# supply that binding. The network contract stays with the preset.
id: tavily-policy-binding-v1
display_name: Tavily credential for policy binding
description: Endpointless profile for a Tavily credential bound by the tavily policy preset
category: agent
credentials:
- name: api_key
description: Tavily Search API key
env_vars:
- TAVILY_API_KEY
required: true
auth_style: bearer
header_name: authorization
query_param: ''
endpoints: []
binaries: []
inference_capable: false
16 changes: 11 additions & 5 deletions src/commands/credentials.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,22 @@ describe("credentials oclif adapter source coverage", () => {
["TaViLy", "nemohermes", "tavily-hermes-v1"],
["tavily-hermes-v1", "hermes", "tavily-hermes-v1"],
["tavily-hermes-v1", undefined, "tavily-hermes-v1"],
["tavily", "dcode", "tavily"],
["tavily", "openclaw", "tavily"],
["tavily", "dcode", "tavily-policy-binding-v1"],
["tavily", "openclaw", "tavily-policy-binding-v1"],
] as const)(
"registers %s for %s using the intended runtime profile",
async (type, agent, profile) => {
vi.stubEnv("TAVILY_API_KEY", "host-only-tavily");
const exportedProfile = JSON.stringify(
parseYaml(
fs.readFileSync(
path.join(rootDir, "nemoclaw-blueprint/provider-profiles", `${profile}.yaml`),
path.join(
rootDir,
profile === "tavily-policy-binding-v1"
? "managed-inference/provider-profiles"
: "nemoclaw-blueprint/provider-profiles",
`${profile}.yaml`,
),
"utf8",
),
),
Expand Down Expand Up @@ -150,7 +156,7 @@ describe("credentials oclif adapter source coverage", () => {
const exportedProfile = JSON.stringify(
parseYaml(
fs.readFileSync(
path.join(rootDir, "nemoclaw-blueprint/provider-profiles/tavily.yaml"),
path.join(rootDir, "managed-inference/provider-profiles/tavily-policy-binding-v1.yaml"),
"utf8",
),
),
Expand All @@ -176,7 +182,7 @@ describe("credentials oclif adapter source coverage", () => {
"--name",
"shared-search",
"--type",
"tavily",
"tavily-policy-binding-v1",
"--credential",
"TAVILY_API_KEY",
],
Expand Down
11 changes: 5 additions & 6 deletions src/lib/actions/credentials-add.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
} from "../inference/native-nvidia";
import {
HERMES_TAVILY_PROVIDER_PROFILE_ID,
TAVILY_POLICY_BINDING_PROVIDER_PROFILE_ID,
TAVILY_PROVIDER_PROFILE_AGENTS,
TAVILY_PROVIDER_PROFILE_ID,
webSearchProviderProfileId,
Expand Down Expand Up @@ -157,12 +158,10 @@ function bundledProviderProfile(type: string): { profileType: string; profilePat
if (profileType === NVIDIA_HOSTED_NATIVE_PROFILE_ID) {
return { profileType, profilePath: nativeNvidiaProviderProfilePath() };
}
const profilePath = path.join(
ROOT,
"nemoclaw-blueprint",
"provider-profiles",
`${profileType}.yaml`,
);
const profilePath =
profileType === TAVILY_POLICY_BINDING_PROVIDER_PROFILE_ID
? path.join(ROOT, "managed-inference", "provider-profiles", `${profileType}.yaml`)
: path.join(ROOT, "nemoclaw-blueprint", "provider-profiles", `${profileType}.yaml`);
return fs.existsSync(profilePath) ? { profileType, profilePath } : null;
}

Expand Down
2 changes: 1 addition & 1 deletion src/lib/actions/credentials-provider-adapter.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,7 @@ describe("credential actions use typed OpenShell provider results", () => {

expect(result.exitCode).toBe(1);
expect(result.failureLines).toContain(
" OpenShell provider profile 'tavily' does not match NemoClaw's checked-in credential boundary.",
" OpenShell provider profile 'tavily-policy-binding-v1' does not match NemoClaw's checked-in credential boundary.",
);
expect(adapter.createProvider).not.toHaveBeenCalled();
});
Expand Down
122 changes: 122 additions & 0 deletions src/lib/adapters/config/live-export-search-source-test-fixture.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
// SPDX-License-Identifier: Apache-2.0

import { mockSupportedLiveSource, raw } from "../../../../test/support/config-export-harness";
import {
endpointlessTavilyProfile,
managedBraveProfile,
managedTavilyProfile,
} from "../../../../test/fixtures/openshell-provider-profile";
import { buildManagedStartupProfile } from "../../onboard/managed-startup/profile-builder";
import type { SandboxEntry } from "../../state/registry/types";
import {
braveProvider,
entry,
imageRef,
inventory,
provider,
startupInput,
} from "./live-export-source-test-fixture";

export function tavilyProfile(agent: "openclaw" | "hermes") {
return agent === "hermes" ? managedTavilyProfile(agent) : endpointlessTavilyProfile();
}

function hermesDashboard() {
return {
agent: "hermes" as const,
mode: "disabled" as const,
url: "http://127.0.0.1:18789",
browserUrl: "http://127.0.0.1:18789",
publicPort: null,
internalPort: null,
tuiEnabled: false as const,
};
}

function searchStartup(searchProvider: "brave" | "tavily", agent: "openclaw" | "hermes") {
return buildManagedStartupProfile({
...startupInput,
agent,
...(agent === "hermes"
? {
inference: { ...startupInput.inference, primaryModelRef: null, compatibility: null },
dashboard: hermesDashboard(),
}
: {}),
webSearch: { fetchEnabled: true, provider: searchProvider },
});
}

function searchRegistry(
searchProvider: "brave" | "tavily",
agent: "openclaw" | "hermes",
runtimeImage: string,
built: ReturnType<typeof searchStartup>,
) {
return {
...entry,
agent,
imageTag: runtimeImage,
...(agent === "hermes" ? { hermesApiPort: 8642 } : {}),
webSearchEnabled: true,
webSearchProvider: searchProvider,
workload: {
...(entry.workload as Extract<
NonNullable<SandboxEntry["workload"]>,
{ kind: "managed-image" }
>),
reference: runtimeImage,
encodedProfile: built.encodedProfile,
startupProfileSha256: built.startupProfileSha256,
},
};
}

function searchProviderRow(searchProvider: "brave" | "tavily", agent: "openclaw" | "hermes") {
const base = braveProvider();
const profile = searchProvider === "brave" ? managedBraveProfile() : tavilyProfile(agent);
const providerName = `alpha-${searchProvider}-search`;
return {
providerName,
profile,
search: {
...base,
provider: {
...base.provider,
metadata: { ...base.provider.metadata, name: providerName },
type: profile.id,
credentials: Object.defineProperty(
{},
searchProvider === "brave" ? "BRAVE_API_KEY" : "TAVILY_API_KEY",
{
enumerable: true,
get: base.readCredential,
},
),
},
},
};
}

export function mockSearchLiveSource(
searchProvider: "brave" | "tavily",
agent: "openclaw" | "hermes" = "openclaw",
) {
const runtimeImage =
agent === "hermes" ? imageRef.replace("openclaw-sandbox", "hermes-sandbox") : imageRef;
const built = searchStartup(searchProvider, agent);
mockSupportedLiveSource(3, 3, searchRegistry(searchProvider, agent, runtimeImage, built));
const { providerName, profile, search } = searchProviderRow(searchProvider, agent);
raw.getProviderProfile.mockResolvedValue({ profile });
raw.getProvider.mockImplementation(async ({ name }: { name: string }) =>
name === providerName ? { provider: search.provider } : provider(),
);
raw.getSandbox.mockResolvedValue({
sandbox: {
...inventory().sandbox,
spec: { template: { image: runtimeImage }, providers: [providerName] },
},
});
return search;
}
Loading
Loading