Skip to content

feat(policy)!: accept OpenShell network middleware bindings in sandbox policies - #14343

Merged
cv merged 3 commits into
v1from
work/v1/issue-14338
Nov 10, 2026
Merged

cv merged 3 commits into
v1from
work/v1/issue-14338

Conversation

@jyaunches

Copy link
Copy Markdown
Contributor

Explicit sandbox policies can now bind OpenShell supervisor middleware with network_middlewares, so a middleware service registered with the gateway can inspect and block a sandbox's traffic through a NemoClaw deployment document. The intent record moves to version 17, so this build refuses deployments that earlier builds created.

Problem

Part of #14338.

The decision-model guard in NVIDIA/nemoclaw-community#214 registers an OpenShell middleware service and attaches it to sandbox traffic with network_middlewares. NemoClaw can already register the service through spec.gateway.config, but an explicit policy rejects network_middlewares as an unknown field, and refresh reports an observed policy with middleware as incomplete. Users can't activate the guard through a supported deployment.

Still open for #14338: the live boundary test. It should register a deterministic middleware on a live gateway, show that selected traffic reaches it, that allow and block decisions and fail_closed apply, and that an unchanged apply and an export and reapply keep the binding.

Change

  • ExplicitPolicy gains network_middlewares, typed as PolicyMiddleware and PolicyMiddlewareEndpoints with OpenShell v0.1.7's field names: middleware, name, order, config, on_error, and endpoints.include and exclude.
    • Unknown fields are rejected, and the schema lists the two on_error values.
    • The pinned OpenShell validator checks the rest, such as empty names, duplicate orders, selector limits, and fail-closed selection of tls: skip endpoints; NemoClaw reports its refusal and adds no enforcement.
  • Observation reads bindings back through the same typed contract, so refresh, drift comparison, and export keep them, and any change to a binding is drift.
  • RECORD_FORMAT moves to version 17 because the saved document's schema changed; the release notes say so.
  • The regenerated JSON Schema and field reference list the new fields, and the openshell provider's schema snapshot shows config as JSON text.
  • docs/security/sandbox-network.md gains Attach Network Middleware. It separates gateway registration from the sandbox binding, says the operator or platform runs the service, and covers ordering, failure behavior, and OpenShell's research-preview status.
  • Tests:
    • SDK: a binding parses, compiles, and survives observation; shape errors and OpenShell-owned errors are rejected separately.
    • Provider unit test: a loaded policy must keep each binding exactly, even when OpenShell adds filesystem paths.
    • The sandbox contract module: the fake gateway receives the binding as written, and an unchanged apply and a refresh keep it.

Left out on purpose: NemoClaw doesn't run, package, or monitor middleware services, and image runtime policies still can't declare middleware.

Beyond CI

  • No live gateway has registered a middleware service with this change, so interception of real sandbox traffic is unverified until the live boundary test lands.

@jyaunches

Copy link
Copy Markdown
Contributor Author
Authoring session — opening
Field Status Value Evidence or limit
Harness partial Pi coding agent with the PIT typescript tool Session header and tool records; harness version not recorded
Skills recorded create-verification-skill (complete read); maintain-verification-skill (complete read); write-tests (complete read); test-driven-development (complete read); verify-fabric-boundary (complete read); nemoclaw-contributor-create-pr (complete read); bro (complete read) All read before this task in the same session; none newly read during the task interval
Instruction files recorded ~/.pi/agent/AGENTS.md (injected); ~/AGENTS.md (injected); ~/Development/AGENTS.md (injected); NemoClaw-v1 AGENTS.md (injected); task worktree AGENTS.md (complete read, earlier worktree); WRITING.md (complete read, earlier worktree); NemoClaw-working/AGENTS.md (complete read); NemoClaw-working/v1/AGENTS.md (complete read); .github/PULL_REQUEST_TEMPLATE.md (complete read); .github/SESSION_REPORT_TEMPLATE.md (complete read) System prompt injections and reads to cutoff
Tool calls partial typescript: 174 for the session, 103 in this task (wrapper, including failures); subagent: 2 earlier in the session (nested, observed) Session record; other nested calls inside typescript programs are not counted
Session window recorded 2026-11-07T01:16Z to 2026-11-09T22:11Z, including idle time; this task 2026-11-09T21:18Z to 22:11Z, 53 min First event and the task's first message to cutoff
Compactions recorded 0 Complete record to cutoff; 8 context elisions, no compaction
Models recorded nvidia-claude/aws/anthropic/bedrock-claude-opus-5-5 Model change record
Reasoning levels recorded high Thinking-level record

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

@jyaunches
jyaunches requested a review from cv November 10, 2026 14:58
@cv
cv merged commit d8dcdac into v1 Nov 10, 2026
66 checks passed
@cv
cv deleted the work/v1/issue-14338 branch November 10, 2026 17:12
cv added a commit that referenced this pull request Nov 11, 2026
…ms (#14413)

The release notes now list every user-visible change on `v1` since the
`v0.1.0-rc9` tag, including the breaking ones, and four example pages
drop claims that later changes made false.

## Problem

`docs/about/release-notes.md` listed three breaking changes and none of
the features, fixes, and onboarding changes that reached `v1` after
`v0.1.0-rc9`; it didn't name the configuration shapes the parser now
rejects or the intent record version `v0.1.0-rc9` writes.
Some example claims went stale:

- `examples/spark/README.md` said the pinned OpenShell has the Podman
TLS initialization blocker, ai-openshell/openshell#3427; its fix merged before
OpenShell 0.1.0, and `v1` pins 0.1.7.
- `examples/station/README.md` and `examples/gtc-dc/README.md` required
exactly one visible GPU on the host; since #13929,
`container.gpuDevices` lets a service on a host with more GPUs request
one.
- `examples/hcl/travel-team` said Fabric's Deep Agents adapter can't
turn reasoning off, NVIDIA/NeMo-Fabric#433; NVIDIA/NeMo-Fabric#439 fixed
that, and the pinned catalog's Deep Agents `reasoning_effort` accepts
`none`.
- The travel team cited #13313 for the booking key its service doesn't
receive, but #13313 closed when `openshell_api` landed.

## Change

- `docs/about/release-notes.md` gains "Changes Since v0.1.0-rc9",
grouped by area, from the commits in `v0.1.0-rc9..origin/v1`; where a
later commit changed an earlier one, the entry describes the current
code, and changes added and removed after the tag aren't listed:
- Agents and interfaces: #14037, #14038, #14269, #13981, #14024, #14186,
#14052, #14385, #13971, #13858, #13947, #14039, #14042, #14044, #14343.
- Inference: #13929, #14391, #14396, #14398, #14400, #13963, #13912,
#13964, #14388, #14390, #14397.
- Gateways and Kubernetes: #13909, #13970, #13922 (an existing
namespace, refused at plan by #13756, is now bound; cluster-wide reads
dropped), #14014, #14169, #13921.
- Plan, apply, and diagnostics: #14224, #13756, #14141, #14133, #14135,
#13775, #13744, #13701.
- Onboarding: #13693, #13695, #13741, #13757, #13851, #13978, #14228,
#14233, #14334, #14336.
- Examples and builds: #14166, #14184, #14188, #14191, #14192, #14200,
#13889, #14267, #14312, #14315, #14355, b30e9b4, #13781, #13813,
#14246, and the pins in `versions.json` and `image/fabric/Dockerfile`.
- Its breaking changes since the tag:
- the intent record moving from 15, which `v0.1.0-rc9` writes, through
16 (#14266), 17 (#14343), 18 (#13929), 19 (#14391) and 20 (#14394);
  - name-keyed `sandboxes` and `inferenceProviders` (#13703, #13705);
- a recipe `compatibility.gpu` outside every hardware profile (#13912);
- model tuning the adapter doesn't accept (#14111), and Hermes's
`max_tokens` losing its default (#14296);
  - `skills.paths` resolution (#14296);
  - endpoint and `networkCIDR` validation (#13847, #14081);
- the HCL `gateway_values` attribute (#14014), and Kubernetes ownership
receipts from before #13922 and #14014.
  The two earlier items stay, under their own heading.
- `examples/spark/README.md` replaces the closed OpenShell#3427 blocker
with the Podman and remote-model limits in `docs/resources/limits.md`.
- `examples/station/README.md` and `examples/gtc-dc/README.md` require
one GPU visible in the model container, and point to
`container.gpuDevices` for a host with more.
- `examples/hcl/travel-team/README.md` and `WALKTHROUGH.md` drop the
NeMo-Fabric#433 limitation, and the travel team's booking-key statements
link #14417 instead of #13313.

Not listed, because both changes landed after the tag: Deep Agents Code
(#14043, #14250), `compatibility.gpuCount` (#14391, #14394), and the
"Creating infrastructure state" progress step (#14169, #14248).

Checked and left unchanged: the root `README.md`,
`crates/nemoclaw-onboarding/README.md`,
`crates/nemoclaw-cli/assets/README.md`, `internal-docs/README.md`, the
other example READMEs, and every example YAML header comment. The GPU
autoscaling README and `load.sh` read the JSON fields `OperationResult`
serializes, and ai-openshell/openshell#4287 is fixed only after the pinned
0.1.7. The two pre-tag release-note items still match the schema and
SDK. `docs/README.md` is left to #14412, which retires the stale field
reference snapshot it describes.

Not verified: whether Hermes sends the booking key's placeholder to MCP
servers; #14417 tracks the live check.

## Beyond CI

Each relative link and anchor in the changed files resolves to an
existing file and heading.
@wscurran wscurran added area: docs Documentation, examples, guides, or docs build area: networking DNS, proxy, TLS, ports, host aliases, or connectivity area: policy Network policy, egress rules, presets, or sandbox policy area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality v1 NemoClaw v1 branch labels Nov 12, 2026
cv pushed a commit that referenced this pull request Nov 17, 2026
)

The `docker-dummy` live case now checks that a `fail_closed` middleware
binding blocks a sandbox request when the middleware service fails.

## Problem

Part of #14338.

#14343 let explicit sandbox policies carry OpenShell middleware
bindings, and #14441 made the `docker-dummy` live case check allow, deny
and excluded-destination effects. Nothing in a live run made the
middleware service fail, so the issue's last live criterion, that the
configured failure behavior applies when the service fails, was
untested. The case's binding sets `on_error: fail_closed`, so a broken
guard should stop traffic, not let it through. If OpenShell let the
request through or NemoClaw dropped the setting, no test would notice.

## Change

- The live guard in `nemoclaw-test-fixtures` answers a request to
`/fail` with a service error, after recording it as it does for every
request.
- The `middleware` run block in `docker-dummy.tftest.hcl` sends a fourth
request, to `/fail`, last, so no later request depends on how the
supervisor treats a failed service. It must return 403.
- The run block checks three effects. The allow and deny counts stay
exact. The middleware must be called at least once for `/fail`; the
count is a floor because OpenShell may call a failing service more than
once. The recorder must still see only `/allow` and `/bypass`, so
neither the denied nor the failed request arrives.
- The case document and the live test guide describe the new request.
- Left out on purpose: a `fail_open` run. It needs a second binding on a
different destination, and the case has only the two addresses it
already uses. The provider's unit tests already treat a change of
`on_error` to `fail_open` as drift.
- Left out for this change: the export and reapply of the binding on the
live deployment. The export/reapply integration journey from #14441
covers it on its own deployment, and this case's unchanged plan covers
unchanged reconciliation. This PR leaves #14338 open for a maintainer to
decide whether those two meet the issue's last live criterion.

## Beyond CI

I did not run `cargo ci live-docker`: this environment has no reachable
Docker daemon and cannot fetch the OpenShell dependencies, so the Rust
crate was not built here either. What I ran: `rustfmt --check` on the
changed Rust file, `tofu fmt -check` on the test file, and the new HCL
conditions evaluated with OpenTofu against a sample effects file. Per
OpenShell's source at the pinned revision, a failed fail-closed
middleware gets the same 403 as a denial, so the new `/fail` assertions
rest on that reading until the live Docker lane runs them.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->

<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **Documentation**
* Clarified that requests are blocked when middleware encounters an
error and the binding is configured to fail closed.
* Updated the live-test guidance to describe this scenario and its
expected response.

* **Tests**
* Expanded the Docker dummy scenario to cover middleware errors, verify
the expected 403 response, and confirm the request does not reach the
destination.

<!-- end of auto-generated comment: release notes by coderabbit.ai -->

Signed-off-by: Deepak Jain <[email protected]>
@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: docs Documentation, examples, guides, or docs build area: networking DNS, proxy, TLS, ports, host aliases, or connectivity area: policy Network policy, egress rules, presets, or sandbox policy area: security Security controls, permissions, secrets, or hardening feature PR adds or expands user-visible functionality v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants