Repository navigation
Description
Problem Statement
Provider automation cannot currently bind a credential/config mutation atomically to the provider identity it inspected.
In OpenShell v0.0.104 (dd2b4e3bc0688bdd59f90030f7c1d52511d6e354):
openshell provider list --output jsonreturns a useful secret-free identity view (id,name,workspace,type, credential/config key names, andresource_version).- The gateway supports client-driven optimistic concurrency when
Provider.metadata.resource_versionis non-zero. - The
provider updateCLI always sends an empty provider ID andresource_version: 0. - The gateway therefore resolves the provider by name at mutation time and CASes against the version it just read, rather than an identity/version previously observed by the caller.
If a provider is updated or deleted/recreated between an automation client's read and update, the new identity can receive the submitted credential/config before a client-side post-read detects drift. A post-mutation receipt cannot undo that credential delivery.
This blocks fail-closed consumers that need multiple endpoint-bound providers, including NemoClaw's judge/weak/strong model targets for native Hermes → NeMo Relay → Switchyard routing (NVIDIA/NemoClaw#8887).
The current secret-free inventory also cannot attest endpoint configuration or the resolved provider-profile revision: it intentionally exposes config key names but not a non-secret config digest or profile provenance. Consequently, callers cannot distinguish two same-shaped providers targeting different endpoints.
Proposed Design
Add an identity-bound conditional mutation contract to the provider API and CLI.
- Extend provider update with explicit expected identity fields, for example:
expected_provider_idexpected_resource_version
- Expose corresponding CLI flags, such as:
openshell provider update NAME --expected-id ID --expected-resource-version N ...
- Validate both fields against the current record before preparing or storing any submitted credential material.
- Preserve the existing unconditional behavior only when neither expectation is supplied; reject partial expectation pairs.
- Return a machine-readable, secret-free mutation receipt from create/update and a matching read surface containing:
- provider ID, name, workspace, type, and resource version;
- credential/config key names, never values;
- resolved profile ID, scope/workspace, and profile resource version;
- a versioned digest of canonical non-secret provider config (or another stable endpoint/config attestation).
The receipt should be generated by the gateway from the committed record, not reconstructed by the CLI.
Security Requirements
- A stale expected provider ID or resource version fails before any new credential reaches persistent or external credential storage.
- A concurrent delete/recreate under the same name cannot satisfy an update authorized for the old provider, even if its numeric resource version happens to match.
- Errors and structured output never contain credential values or credential-store handles.
- The config attestation format is versioned and deterministic; unknown/unsupported versions fail closed for consumers that require it.
- Profile provenance is resolved at the same gateway snapshot used for the mutation receipt.
Acceptance
- CLI and API can conditionally update a provider by exact ID plus resource version.
- Concurrent update and delete/recreate tests prove stale mutations do not persist or deliver submitted credentials.
- Successful create/update returns a secret-free receipt bound to the committed identity/version.
- A read API exposes the same attestation fields without credential values.
- Same-shaped providers with different endpoint config produce different config attestations.
- Resolved provider-profile revision/scope drift is observable.
- Backward-compatible unconditional updates remain explicitly documented, while security-sensitive automation can require the conditional path.
Alternatives Considered
Client-side read → update → read: detects some drift after the fact but cannot prevent credential delivery to the wrong identity.
Resource version without provider ID: does not fully protect delete/recreate under the same name when versions coincide.
Expose raw provider config: unnecessary for the transaction and can expand disclosure. A stable versioned digest plus resolved profile provenance is sufficient for exact automation checks.
Checklist
- Existing issues were searched for provider CAS, expected resource version, concurrent provider update, and provider attestation.
- The current CLI, proto, gateway update path, and concurrency tests were inspected.
- This is a design/API request, not a request to expose credentials.
Activity
cjagwani commentedon Aug 12, 2026
Implementation audit — strict RPC and credential-staging boundary
I traced the current-main gateway, persistence CAS, credential-driver, CLI, and TUI paths.
The existing primitives can securely guarantee that a stale credential is never attached to or resolvable through the wrong provider identity:
A new RPC is safer than only adding protobuf fields to the legacy update method: an older gateway then returns
UNIMPLEMENTEDbefore handling the mutation instead of ignoring unknown expectation fields and performing an unconditional update. The current update RPC can remain explicitly legacy/unconditional.The attestation can remain secret-free while carrying provider identity/version, sorted credential and config key names, a versioned length-prefixed SHA-256 digest of canonical non-secret config, and resolved profile identity/scope/source/resource revision.
One acceptance detail needs maintainer clarification. Fresh staging plus database CAS prevents stale secrets from becoming reachable through a provider, but an external credential backend can transiently hold an unreferenced staged value before a racing CAS failure removes it. If the requirement means never attached or resolvable by the wrong provider, the current architecture supports the strict path. If it literally means never written to external credential storage before CAS, this requires a broader cross-replica reservation/fence or transactional credential-driver prepare/commit contract. A process-local mutex is insufficient for multi-replica gateways.
The focused test boundary should include partial expectations, wrong ID with a matching numeric version, stale version, delete/recreate, two concurrent strict updates with one winner, staged-handle cleanup, rotation ordering, deterministic/different config digests, profile provenance drift, and old-gateway
UNIMPLEMENTEDbehavior.krishicks commentedon Aug 12, 2026
It's difficult for me to understand what the use case here is; I gather it's something that NemoClaw is doing, but can you restate the behavior NemoClaw is expecting to exercise here?
cjagwani commentedon Aug 13, 2026
The concrete NemoClaw operation is onboarding and rotating the three provider bindings used by native Hermes → Relay → Switchyard routing:
NemoClaw needs to read each provider's identity, endpoint/profile attestation, and resource version; submit updated config and credentials for that exact record; then persist the gateway-authored committed identity for generated Switchyard configuration and revision-bound placeholders.
The race we need to reject is:
weakas ID A / version 4.weakas ID B.weakrecord before a post-read detects the drift.The expected secure behavior is a conditional update that requires ID A + version 4 and fails before the credential becomes attached to or resolvable through any different provider. On success, the gateway returns the committed ID/version plus secret-free endpoint/profile attestation so NemoClaw can verify and persist the exact binding. On mismatch, NemoClaw fails onboarding/rotation and leaves the previously working routing configuration intact.
This is also needed for rebuild and credential rotation: NemoClaw must prove that
classifier,weak, andstrongstill refer to the endpoint-bound provider identities it qualified before enabling Hermes readiness. A name plus credential/config key names is insufficient because same-shaped providers can target different endpoints.For the staging clarification: NemoClaw does not require that bytes can never transiently exist under a fresh unreferenced backend handle. It requires that a stale mutation can never attach the submitted secret to, or make it resolvable through, the wrong provider identity; staged handles must be deleted on CAS failure.
krishicks commentedon Aug 13, 2026
Please restate the issue in terms of a persona using OpenShell; the above comment is so rooted in NemoClaw terminology and behavior it's unclear what it's actually doing with OpenShell. I'd like to see a clear user story that outlines a workflow within OpenShell that exposes a gap in current functionality. It shouldn't require anything specific to NemoClaw to define an actionable user story.
cjagwani commentedon Aug 24, 2026
Here is the OpenShell-native user story.
Persona
A platform engineer operates a shared OpenShell gateway and automates credential rotation for endpoint-bound providers. Multiple administrators or controllers may update providers concurrently.
Workflow
model-fastand observes provider ID A, resource version 4, its resolved profile revision, and a secret-free attestation of the endpoint/configuration.model-fastas ID B.model-fastonly if it is still ID A at version 4.Gap in the current OpenShell workflow
The current CLI mutation is name-based and does not let the controller submit the ID and resource version it previously observed. A post-update read can detect drift, but only after a credential may have been applied to a different record with the same name. The secret-free read surface also cannot prove that a same-shaped provider still resolves to the endpoint/profile revision that the controller approved.
This is not specific to a routing product. It applies to any security-sensitive automation that rotates credentials or configuration for a named provider on a shared gateway.
Expected OpenShell behavior
The staged-handle interpretation from the earlier comment is sufficient: a value may transiently exist under a fresh unreferenced backend handle, but it must be cleaned up on CAS failure and must never become attached to or resolvable through the wrong provider identity.
github-actions commentedon Sep 8, 2026
This issue has had no activity for 14 days and is now marked stale. It may be closed in 7 days if there is no further activity. Comment or remove the state:stale label to keep it open.
github-actions commentedon Oct 13, 2026
Closing this issue after 14 days with no activity since it was marked stale. Reopen it if the work is still relevant.