Skip to content
Draft
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
60 changes: 30 additions & 30 deletions .secrets.baseline

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 19 additions & 3 deletions integrations/nemo-relay/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,28 @@ What changed for operators and integrators. Interface-level detail: [`DESIGN.md`

## 0.1.0 (unreleased)

- **Optional host-verified human approval (prototype).** Explicit operator trust
can accept a host's exact-operation approval through separate execution
context, retaining the remaining middleware chain without another Council
review or a fabricated writ. Invalid claims and replay are refused. Disabled
by default; requires unreleased Relay transport and a matching worker SDK.
The draft package and lock now pin the matching Relay 1.0 source SDK/runtime;
ordinary proposals still use Council review.
Exact approved replays recheck current central OPA policy without Council
votes. Hard denials and unavailable policy block execution. Explicit
policy-required human review is separate from Council refusal and errors.
[Contract, trust responsibilities and release dependency](docs/host-human-approval.md).

The first release, from NVIDIA/Nomos. The versions under [development history](#development-history-standalone-repository-unpublished)
were never published.

- **Requires NeMo Relay 0.11** (`>=0.11.0,<0.12`; was `>=0.9.0,<1.0`): the worker SDK, bindings and CLI move
together, and Relay 0.10 refuses to add the plugin. 0.11 fixes the codec limitation with several edited tools
([findings](docs/findings.md)), so the one-guarded-tool workaround is no longer needed.
- **Requires matching NeMo Relay 1.0 source builds** (`>=1.0.0,<1.1`): the manifest
now declares `nvidia.nemo.relay.worker.v1`. The SDK and Python host are locked to
one public Git revision; managed-worker tests use a CLI built from that revision.
Offline installation consumes a source-built SDK wheel and runtime-only locked
dependencies. Published-package installation remains a release gate. See
[source-build testing](docs/relay-1-source-testing.md). Earlier Relay 0.11 codec
fixes remain recorded in [findings](docs/findings.md).
- **Authorization runs before Relay's caches.** H3 runs at priority 90 (was 10000), below the tool and LLM caches
(150) and NeMo Guardrails (100): before, a tool-cache hit returned before the Council was asked.
- **Exported traces carry only the annotation's status fields.** `sanitize_exported_annotation` removes the
Expand Down
14 changes: 13 additions & 1 deletion integrations/nemo-relay/DESIGN.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ SPDX-License-Identifier: Apache-2.0

# `nemo_relay_nomos`: physical design

The ordinary authorization path below uses Council and native request
correlation. An optional, default-off
[host-verified human-approval prototype](docs/host-human-approval.md) instead
accepts an explicitly trusted host assertion for exact local operations. It
retains downstream middleware but does not mint a Council writ. The prototype
requires unreleased Relay transport; existing SDK pins do not enable it.

The contract the implementation and the QA suite are both held to. **must**, **never** and **always** mark a
promise, and every promise has a test. Code: [`nemo_relay_nomos/`](nemo_relay_nomos/).

Expand Down Expand Up @@ -44,7 +51,7 @@ and provider tool-call IDs. The worker governs a configurable set of those tools
9. Streaming supports OpenAI chat chunks only: a built-in codec identity or an explicit operator format declaration
is required. Bindings publish only after terminal tool-call completion, normal exhaustion and source cleanup.

**Constraints:** Relay worker SDK `nemo-relay-plugin==0.11.1` (`grpc-v1`), Relay >=0.11 · Nomos command-v1 and structured-tool-v2
**Constraints:** Relay worker SDK `nemo-relay-plugin==1.0.0` from the pinned public source (`nvidia.nemo.relay.worker.v1`), Relay >=1.0,<1.1 · Nomos command-v1 and structured-tool-v2
wire contracts (writ, `ExecutionResult`, `council_authorize`) · guarded calls sequential within a conversation, concurrent across
conversations · POSIX only (`O_NOFOLLOW`) · no disk and no external service (SQLite `:memory:` in the worker).

Expand Down Expand Up @@ -746,6 +753,11 @@ answer's structured parts, never the Council's free text:

## Change history

- Relay 1.0 source migration (2026-11-19): pin the runtime/SDK source revision,
declare `nvidia.nemo.relay.worker.v1`, and require a matching source-built CLI
for managed-worker tests. Keep the feature draft until published-package
clean installation passes; see `docs/relay-1-source-testing.md`.

- Native execution correlation (2026-11-09): remove model-carried turn tokens, transcript attribution and
supersession; bind completed provider IDs to immutable request snapshots using native Agent UUIDs. Require
Relay 0.11+, SDK 0.11.1; explicitly declare OpenAI streaming for callback codecs. Replay ancestry remains required.
Expand Down
36 changes: 33 additions & 3 deletions integrations/nemo-relay/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ What crosses each connection (arrowheads in the figure show who initiates; the f
|---|---|---|---|---|
| **C1** | application → Relay host | in-process calls | `llm.execute(request)`, `tools.execute(name, args, tool_call_id)`; results back. The plugin is not on this link | every model call and tool call |
| **C2** | Relay host → model provider | the application's model call (HTTPS) | the prepared request (guarded tools require `nomos`; an optional trailing message holds the evidence catalog); the reply, possibly a tool call whose arguments carry `nomos`. The plugin never contacts the provider | every model call |
| **C3** | Relay host → plugin worker | Relay's worker protocol (gRPC, `grpc-v1`) | H2: model request and continuation in; schema/catalog preparation and completed-response call-ID binding. H3: tool name, arguments (with `nomos`) and `tool_call_id` in; the result plus a host-only `{"nomos": …}` annotation out. For a `local` tool the worker calls back through Relay (`next_`) with the arguments minus `nomos` | H2 around every model invocation, H3 on every tool call; the worker is started once |
| **C3** | Relay host → plugin worker | Relay's worker protocol (gRPC, `nvidia.nemo.relay.worker.v1`) | H2: model request and continuation in; schema/catalog preparation and completed-response call-ID binding. H3: tool name, arguments (with `nomos`) and `tool_call_id` in; the result plus a host-only `{"nomos": …}` annotation out. For a `local` tool the worker calls back through Relay (`next_`) with the arguments minus `nomos` | H2 around every model invocation, H3 on every tool call; the worker is started once |
| **C4** | H3 → Council | MCP over streamable HTTP, bearer proxy token | `council_authorize`: identity, the observed command or tool call, the call's turn's user request, the four intent fields, cited evidence, and (opt-in) the tool list the application offered; back: `approved` with a base64 writ and `writ_id`, or `denied` / `error` with reasons and votes. Opt-in, once: `council_get_public_key` | once per guarded call that passes the plugin's own checks |
| **C5** | writ handler → Executor | HTTP `POST /execute`, header `X-Agent-ID` | `{"writ": …}` unchanged; back: an Executor-signed `ExecutionResult`, read with a byte bound | once per approved `nomos_http` call, after the nonce claim; never for `local` tools |
| **C6** | worker ⇄ its store | SQLite `:memory:` inside the worker | turns, conversations, catalog reads, the call journal, records, writ claims, tool lists | every H2; up to three journal transactions per H3 call |
Expand All @@ -85,6 +85,36 @@ requests finishing out of order keep their own context; request association stay

[Before/after examples, sequence diagram, streaming configuration and replay requirements](docs/native-correlation.md).

### Optional host-verified human approval (prototype)

An application that already verified human approval can pass an exact-operation
assertion through Relay's separate execution context. With explicit operator
trust, H3 validates and journals it, rechecks central OPA policy, then calls the
remaining chain without Council-member review or a Council writ. A hard policy
denial cannot be overridden by human approval. Invalid supplied claims are refused; calls
without a claim retain ordinary Council review. The host still owns principal,
expiry, mandatory-policy and final-argument checks.

The response status distinguishes `denied` operations from those requiring
human approval. Only `requires_human_approval` requests the application's
existing approval flow. Errors fail closed and never request human approval.
Approved replay requires the core policy-only API and
enabled, healthy OPA; older services cannot silently bypass that check.

This path is **disabled by default** and requires the unreleased transport in
[NeMo Relay PR #1749](https://github.com/NVIDIA/NeMo-Relay/pull/1749). The published
The draft now pins a matching Relay 1.0 source SDK and runtime; released-package installation remains unverified. See the
[host-approval contract and limitations](docs/host-human-approval.md).

### Optional host-reported runtime facts

A host can report an effective working directory and mappings between logical
workspace roots and execution roots through `execution_context.data.runtime_context`.
The worker checks the configured source, exact tool, native call ID and argument
snapshot; Council independently checks the authenticated issuer. This defaults
to disabled and never implies human approval. See [runtime context](docs/runtime-context.md)
for the contract, examples, trust configuration and privacy limits.

### What H3 does to a guarded tool call

Before anything may run: the plugin's own checks, the journal row (T1), the citations and the denial cap, then the
Expand Down Expand Up @@ -269,7 +299,7 @@ Every governed result: `contract_version: "nomos-plugin/v1"`, `status`, `executi

## Requirements and limits

- NeMo Relay `>=0.11.0,<0.12` (tested with SDK, CLI and Python/Node bindings 0.11.1); Python 3.11+; Linux or macOS.
- NeMo Relay `>=1.0.0,<1.1`, with matching source-built runtime, CLI and worker SDK; Python 3.11+; Linux or macOS. See [source-build testing](docs/relay-1-source-testing.md) and its release gate.
- No disk or extra service: evidence lives in the worker's memory and is lost if the worker dies.
- Guarded calls are sequential within a native Agent; different Agents may run at once. The host must preserve
native Agent ownership and provider call IDs between model and tool execution; missing origins refuse.
Expand Down Expand Up @@ -313,7 +343,7 @@ make docs # redraw docs/figures, re-render docs/architecture
make build # sdist and wheel into dist/
```

`make test` installs the bundle through the real Relay CLI (`nemo-relay-cli-bin==0.11.1` from the test group), offline
`make test` installs the bundle through the matching source-built Relay CLI (`NOMOS_TEST_RELAY_BIN`), offline
from a wheelhouse it builds on first use ([`scripts/wheelhouse.sh`](scripts/wheelhouse.sh)). The end-to-end tier uses the enclosing Nomos
(`NOMOS_TEST_NOMOS_SOURCE` points it elsewhere). `scripts/test.sh -k <expr>` runs a subset without the coverage floor.

Expand Down
Loading
Loading