Skip to content

feat(openshell-provider): name the variables sandboxes see credentials in - #13392

Merged
cv merged 3 commits into
v1from
feat/sandbox-credential-env
Oct 18, 2026
Merged

cv merged 3 commits into
v1from
feat/sandbox-credential-env

Conversation

@cv

@cv cv commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Stacked on #13391.

Failure

Inside a sandbox, an agent reads a provider's key from a variable OpenShell sets, and nothing told the configuration that variable's name.

  • Web search: keys appeared as BRAVE_API_KEY or TAVILY_API_KEY, but harnesses read different names. Hermes's Brave plugin reads BRAVE_SEARCH_API_KEY, so web search silently failed in Hermes sandboxes.
  • Inference: an agent's api_key_env had to reproduce NemoClaw's internal naming (NEMOCLAW_INFERENCE_<NAME>_KEY) to find a registration's key.

Decision

  • openshell_web_search: takes an optional sandbox_env naming the variable sandboxes see its key in. Changing it replaces the registration.
  • openshell_inference: exports sandbox_env, the variable sandboxes see its key in, so an agent configuration can write api_key_env = openshell_inference.<name>.sandbox_env.
  • Test fixture: the fake gateway now reports credential names with redacted values, as OpenShell does, instead of dropping them, so tests can check the names.

Validation

  • New unit and contract tests cover a web search key under a custom variable and the exported inference variable.
  • A v1 test that compares a profile's planned row exactly now also strips the computed sandbox_env, as it already stripped registration.
  • cargo ci passes: 1542 unit tests and 150 lifecycle tests.
  • Live on a DGX Spark, Hermes researchers searched with Brave through sandbox_env = "BRAVE_SEARCH_API_KEY", and the scheduler and buyer read their hosted model's key through the exported name.

cv added 2 commits October 17, 2026 17:35
…is their providers

A sandbox with attached providers runs in proxy mode, where OpenShell
adds its known filesystem paths to the loaded policy. The policy check
accepted those additions only when the sandbox had network rules of its
own, so a sandbox whose only network access came from its providers was
created but every later refresh reported an incomplete observation.
…s in

openshell_web_search takes an optional sandbox_env naming the variable
sandboxes see its key in, since harnesses differ: Hermes's Brave plugin
reads BRAVE_SEARCH_API_KEY, not the default BRAVE_API_KEY.
openshell_inference exports sandbox_env, the variable sandboxes see its
key in, so agent configurations need not reproduce NemoClaw's naming.
The fixture gateway now reports credential names with redacted values,
as OpenShell does, instead of dropping them.
Base automatically changed from fix/provider-only-sandbox-observation to v1 October 18, 2026 00:58
@cv
cv enabled auto-merge (squash) October 18, 2026 01:12
@cv
cv merged commit b6a9efc into v1 Oct 18, 2026
@cv
cv deleted the feat/sandbox-credential-env branch October 18, 2026 01:28
@github-actions

Copy link
Copy Markdown
Contributor

cv added a commit that referenced this pull request Oct 18, 2026
…13393)

Stacked on #13392.

## Failure

The only hand-written HCL example, `examples/hcl/travel`, has a single
agent. Nothing showed or tested how NemoClaw's providers compose for
several agents with different harnesses, models, credentials and network
policies. A live trial of such a team found problems that no
single-agent example exercises: #13389, #13391 and #13392, and
NVIDIA/NeMo-Fabric#433.

## Decision

`examples/hcl/travel-team` adds a team of six agents as plain OpenTofu
HCL, all running Hermes on Fabric through `fabric-agent-ctl`:

- **Four researchers** (flights, stays, transport, attractions) on a
local Ollama model, with Brave web search and `GET` access to their own
sources.
- **A scheduler** on a hosted model, delegating one feasibility review.
- **A buyer** on a hosted model that reaches a booking service over MCP.
OpenShell's MCP grant limits it to the listed tools, since Hermes can't
filter a server's tools.

One table of roles drives the sandboxes, registrations, grants, agent
configurations and toolsets, so adding a researcher is one entry. An
agent's configuration change replaces its sandbox through
`terraform_data` and `replace_triggered_by`. Policies hold only the
access no attached provider grants. Handoffs use embedded JSON Schemas,
and the `agents` output gives what `fabric-agent-ctl invoke` needs.
`WALKTHROUGH.md` explains the HCL file by file, and every excerpt in it
matches the files.

What the live trial on a DGX Spark changed in the example:

- **Toolsets:** each role lists its toolsets. With no list Hermes
enables all of its defaults, so the buyer had terminal and code
execution.
- **Reasoning:** models use Hermes's `custom` provider, which sends
`reasoning_effort: "none"`. With reasoning on, Nemotron missed Fabric's
320-second invocation deadline.
- **Researchers:** a search budget, "keep only options whose price you
found", and option IDs prefixed with the topic, since IDs collided
across researchers.
- **Buyer:** books each distinct option once, quotes everything before
booking anything, and has enough turns for a full itinerary.
- **Hosted model:** the default is now
`nvidia/nemotron-3-super-120b-a12b`, because the earlier one was
retired.
- **Scheduler:** runs on Hermes, not Deep Agents, until
NVIDIA/NeMo-Fabric#433 lets Deep Agents turn reasoning off.

The README lists what isn't covered yet:

- agents calling each other (#13311, #13312);
- approval inside the workflow (#13314);
- the booking service's key (#13313);
- Fabric's 320-second invocation deadline.

## Validation

- **New test:** `crates/nemoclaw-e2e/tests/travel_team_example.rs`
applies the directory unchanged against the bundle's providers, with
fakes for the engines, gateway and model server. It checks each
sandbox's providers, grants, toolsets and configuration, an unchanged
second plan, that a hosted-model change replaces only the scheduler's
and buyer's sandboxes, and teardown. Each OpenTofu command takes under a
second; the test takes 5 seconds.
- **`cargo ci`:** passes, with 1542 unit tests and 151 lifecycle tests.
`fern check` reports no errors.
- **Live:** on a DGX Spark with a managed OpenShell gateway, Nemotron 3
Nano on Ollama, Nemotron 3 Super on NVIDIA's API, Brave, and a test MCP
booking service, one trip took about four minutes. The buyer quoted and
then booked all 18 itinerary options once each, through the MCP grant.
Researchers' prices remained partly unconfirmed with the small local
model, so the README says to review them before approving.

The trial also found that `tofu destroy` can't remove gateway storage,
which NemoClaw retains by design, and that the docs don't say how to
remove it by hand. That's outside this PR.
cv added a commit that referenced this pull request Oct 18, 2026
Closes #13396. Part of #13394.

## Failure

The `openshell_web_search` resource takes `sandbox_env` (#13392), which
names the variable a sandbox sees for the search key. Hermes's Brave
plugin reads `BRAVE_SEARCH_API_KEY`, while OpenShell's default is
`BRAVE_API_KEY`. The YAML `webSearch` integration had no matching field,
so a YAML deployment couldn't give Hermes the key under the name it
expects.

## Decision

- `webSearch.sandboxEnv` names the variable inside the sandbox, compiled
to `sandbox_env`. Without it, nothing changes.
- It must be an environment variable name, by the same rule as
credential references.
- Two sandboxes that share a web search resource must agree on it, as
they already must for the provider and credential.

## Validation

- A new SDK test failed before the change (`unknown fields are not
allowed`) and passes after. It checks the target and the compiled
resource with and without the field, and that an invalid name is
rejected.
- `cargo ci` passes locally: 1543 unit tests and 151 lifecycle tests.
- The schema and the configuration reference are regenerated, and
`docs/agents.md` documents the field.
@wscurran wscurran added area: integrations Third-party service integration behavior area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality integration: brave Brave integration behavior integration: hermes Hermes integration behavior v1 NemoClaw v1 branch labels Oct 23, 2026
@cv cv added this to the Roadmap: GTC DC 2026 milestone Nov 18, 2026
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 area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality integration: brave Brave integration behavior integration: hermes Hermes integration behavior v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants