Skip to content

feat(config): add an integration for key-authenticated HTTP APIs - #13403

Merged
cv merged 1 commit into
v1from
feat/yaml-api-integration
Oct 18, 2026
Merged

cv merged 1 commit into
v1from
feat/yaml-api-integration

Conversation

@cv

@cv cv commented Oct 18, 2026

Copy link
Copy Markdown
Collaborator

Closes #13397. Part of #13394.

Failure

The openshell_api resource registers a key-authenticated HTTP API with OpenShell, such as the travel team's booking service over MCP. The YAML had no matching integration, so a YAML deployment couldn't reach such a service with a gateway-held key.

Decision

  • A new integration kind, api, has endpoint, credential, and an optional authStyle (bearer or header) and headerName. Those mirror openshell_api's settings, and NemoClaw's existing rules validate them.
  • An attached api compiles to one openshell_api per definition and image scope. Its executables come from the sandbox's harness, as for web search, and the sandbox attaches and waits for its registration.
  • Like web search, nothing is created unless an agent attaches it. Registration names can't collide with inference providers.
  • No managed network grant: OpenShell grants attached providers itself.
  • sandboxEnv, proposed in the issue, is left out: openshell_api has no such input.

Validation

  • New SDK tests failed before the change (unknown variant) and pass after. They cover the compiled resource and attachment, header authentication, and that an unattached definition creates nothing.
  • A new lifecycle test applies an api integration through the SDK and the bundle's CLI against the fixture gateway, exports it, re-applies unchanged, and destroys it.
  • cargo ci passes locally: 1545 unit tests and 151 lifecycle tests.
  • The schema and the configuration reference are regenerated, and docs/agents.md documents the kind.

An api integration names an endpoint, a credential reference, and optionally
how the key is sent, and compiles to openshell_api for each image scope the
attaching sandboxes use.
@cv
cv enabled auto-merge (squash) October 18, 2026 02:53
@github-actions

Copy link
Copy Markdown
Contributor

@cv
cv merged commit 5bbc718 into v1 Oct 18, 2026
@cv
cv deleted the feat/yaml-api-integration branch October 18, 2026 03:07
cv added a commit that referenced this pull request Oct 18, 2026
)

Closes #13399. Part of #13394. Stacked on #13405.

## Failure

The multi-agent travel team existed only as hand-written HCL (#13393).
Expressing it in YAML exposed gaps that #13400, #13401, #13402, #13403
and #13405 closed, but there was no YAML version showing that the team
now fits.

## Decision

`examples/travel-team.yaml` declares the HCL example's six agents:

- **Researchers:** a managed Ollama Nemotron Nano, web search with
Hermes's key name (`sandboxEnv`), the `web` toolset, at temperature 0.2.
- **Scheduler:** a hosted Nemotron Super at temperature 0.3, with the
`delegation` toolset.
- **Buyer:**
  - the hosted model at temperature 0;
- the booking service as an `api` integration and an MCP server, with
only its toolset;
- a network grant limiting the service to setup, discovery, `get_quote`
and `book_option`.
- **All roles:** isolated sandboxes, Hermes's `custom` provider
(reasoning off), and the HCL example's token and turn limits.

The YAML has no templating, so instructions are written out per agent
and shorter than the HCL's, and they describe each hand-off format
instead of embedding the JSON Schemas. The HCL README links the YAML
version and says when to use each.

## Validation

- A new SDK test compiles the example and checks each sandbox against
the HCL example's settings: Fabric model provider, temperature, token
and turn limits, toolsets, instructions, attached registrations, and the
buyer's tool-restricted grant.
- `cargo ci` passes locally: 1552 unit tests and 153 lifecycle tests.
- Not run against a live gateway; the HCL version ran on a DGX Spark in
#13393.
gaveezy added a commit that referenced this pull request Oct 19, 2026
Bring the branch up to date with 108 v1 commits, including the provider
reorganization (#13131), the key-authenticated HTTP API integration
(#13403), and the web search sandbox variable (#13401).

Resolutions:

- config/integrations.rs: keep v1's API integration and web search
  sandboxEnv. The API key, the web search key, and the resolved web
  search key are SecretRef, because each holds the credential itself.
- config/validation.rs: validate the API integration key as a SecretRef;
  the credential() helper it called no longer exists.
- config/schema/validation.rs: keep v1's sandboxEnv rule for webSearch
  variants beside the SecretRef and FileRef env rules.
- kubernetes/mod.rs: keep v1's boxed ManagedKubernetes; its kubeconfig
  is a FileRef.
- nemoclaw-e2e deployment.rs: take v1's removal of the two inference
  credential tests. #13373 folded them into the export_observations.rs
  test, which now builds its reference as a SecretRef.
- config_kubernetes.rs: keep the new tests from both sides, and add the
  API integration key to the reference-kind test as a secret.
- Regenerate the JSON Schema and the configuration reference.

No other v1 field used Credential; the Fabric model provider and driver
configuration changes add none.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
cv pushed a commit that referenced this pull request Oct 19, 2026
…eRef (#13222)

## Summary

Splits the configuration's one `Credential` type into `SecretRef`, whose
environment variable holds a bearer or API credential, and `FileRef`,
whose variable holds the path of a local file.
Existing references keep their `{env: NAME}` YAML; the managed
Kubernetes OIDC token moves from `tokenEnv: NAME` to `token: {env:
NAME}`. This is shape change 2 of #13080.

## Why

One type held both kinds of reference, so the schema, the generated
reference, and editors could not say whether a variable must contain a
secret or a path
([types.rs](https://github.com/NVIDIA/NemoClaw/blob/9a90ce7e7/crates/nemoclaw-sdk/src/config/types.rs#L76-L84)).

| Field | Runtime use of the variable's value | Type |
|---|---|---|
| `gateway.credential` (external) | Bearer token for the gateway
connection | `SecretRef` |
| `inferenceProviders[].credential`, inline route providers | Registered
provider credential | `SecretRef` |
| Web-search `integrations.<name>.credential` | Search provider API key
| `SecretRef` |
| API `integrations.<name>.credential` (#13403) | Key OpenShell injects
into requests to the API endpoint | `SecretRef` |
| `gateway.kubernetes.authentication.token` (#13414; was `tokenEnv`) |
Bearer token NemoClaw sends to a managed gateway with the OIDC profile |
`SecretRef` |
| `gateway.tls.ca`, `certificate`, `key` | Read as files | `FileRef` |
| `gateway.kubernetes.kubeconfig` | Made absolute and passed as the
kubeconfig path | `FileRef` |
| `sandboxes[].image.metadata` | Absolute path of an OCI metadata
bundle, read as a file | `FileRef` |

## Change

- `SecretRef` and `FileRef` replace `Credential` in the Rust types, the
schema, and the reference. There is no alias, so a misclassified
reference is a compile error.
- Both keep the existing `env` rules: the variable-name pattern and the
reserved `NEMOCLAW_KUBERNETES_STATE`, `NEMOCLAW_MANAGED_K8S_`, `HELM_`,
and `KUBE_` names. The kubeconfig and `environment` rules are unchanged.
A rejected name now reports `secret reference …` or `file reference …`.
- As cv's review asked, there is no `file` form for secrets and no
`kubernetesSecret` form: reading secrets from files changes the
credential model, and OpenShell cannot bind a Secret by reference yet.
Adding either later is additive.
- The OIDC token was the one secret reference held as a bare string
(`tokenEnv`). It is now a `SecretRef` under `token`. Its property keeps
the kubeconfig reference's reserved names, which `tokenEnv` also
excluded, because the token reaches OpenTofu beside the kubeconfig. A
reserved SDK prefix reports `secret reference …`; a kubeconfig-reserved
name reports `token environment reference …`.

Breaking for Rust SDK callers that name `Credential` or
`KubernetesAuthentication::token_env`, and for documents using the OIDC
profile, which must replace `tokenEnv: NAME` with `token: {env: NAME}`.
Other authored documents are unchanged.

Retained state is unchanged except for OIDC deployments made since
#13414: the `openshell_kubernetes_auth` resource's `oidc` attribute is
the serialized settings, so state that holds `tokenEnv` now fails as an
invalid managed Kubernetes attribute and is not adopted.
Development-profile state stores no settings and is unaffected.

## Validation

- New test
`config_kubernetes::a_reserved_reference_name_states_whether_the_reference_holds_a_secret_or_a_file_path`
failed before the change with the shared credential message. It checks
each `SecretRef` and `FileRef` field, including the API integration key
from #13403 and the OIDC token, along with the schema location and the
message, and that the name is not echoed.
-
`config_kubernetes::an_oidc_profile_requires_its_issuer_and_development_takes_no_oidc_settings`
and the reference-kind test failed on `token` as an unknown field before
the token change. The OIDC test now also rejects `tokenEnv` and a bare
string `token`.
- Settings that hold `tokenEnv` fail to deserialize into
`KubernetesAuthentication` with an unknown-field error, which
`Spec::from_row` maps to the invalid-attribute error. This was checked
with a temporary test that is not committed.
- `cargo ci` at `64cfa22e5` (linux_arm64; `v1` at `1802b0611` merged
in): every step passed (`tools`, `fmt`, `clippy`, `build`, `test`,
`schema`, `bundle`, and `lifecycle`). `test`: 1,601 tests, 19.2 s wall
against a 45 s budget. `lifecycle`: 150 tests, 106.9 s wall against 300
s. Contract binaries summed 8.4 s of 25 s (fabric-provider), 42.0 s of
45 s (nemoclaw-provider), and 101.6 s of 105 s (openshell-provider).
`nemoclaw-build docs --check` also passed.
- `5ecebeb63` merges `v1` at `d33d50647` (#13460), which changes only
build tooling. After the merge, `cargo fmt --check`, the
`nemoclaw-build` tests, `schema --check`, and `docs --check` passed.
- Not run: the live TLS, `kubernetes_live`, and `kubernetes_oidc`
suites, which need live clusters and an issuer. They compile under
clippy.

Part of #13080.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Hai Nguyen <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
@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 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 v1 NemoClaw v1 branch

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants