Skip to content

Respect externally managed sandbox policy across lifecycle operations #9833

Closed as not planned

Description

@apurvvkumaria

Problem Statement

NemoClaw assumes that it owns the effective OpenShell sandbox policy. It supplies a policy during sandbox creation and later replaces policy while applying presets, resuming onboarding, rebuilding, restoring snapshots, managing Model Context Protocol services, configuring messaging channels, and changing Shields state.

When another authority manages the sandbox policy, OpenShell rejects direct mutations. Some NemoClaw workflows can reach this refusal after they change other state. The sandbox registry also cannot accurately represent policy that another authority manages.

Desired Behavior

NemoClaw can operate with an externally managed sandbox policy without attempting direct policy mutation.

  • Before the first policy-dependent side effect, NemoClaw determines policy authority from stable, machine-readable OpenShell metadata.
  • NemoClaw persists the policy authority so onboarding, resume, rebuild, restore, and recovery use the same decision.
  • When policy is externally managed, NemoClaw omits a caller-supplied policy during sandbox creation and does not run policy set, update, removal, or preset replay operations.
  • NemoClaw reads the effective policy and verifies required policy entries before it reports a dependent capability as available.
  • If the effective policy lacks a required entry, NemoClaw stops before related provider, credential, service, registry, or sandbox mutation and explains that the policy authority must supply the requirement.
  • NemoClaw does not record policy presets as applied by NemoClaw when another authority supplies the effective policy.
  • If policy authority is unavailable or ambiguous, NemoClaw fails closed before mutation.
  • Existing NemoClaw-managed policy behavior remains unchanged.

For example, a sandbox rebuild with externally managed policy must not replay recorded presets. It must preserve the external policy-authority state and verify the effective policy before reporting successful recovery.

Constraints and Non-goals

  • Do not bundle or configure an external policy service.
  • Do not add vendor-specific policy adapters or deployment configuration.
  • Do not infer policy authority only from human-readable error text.
  • Do not weaken OpenShell permission checks or retry a structured policy-ownership denial.
  • Do not fall back to direct mutation when the external policy authority is unavailable.
  • Operations that require a policy change may refuse the operation and identify the missing policy requirement.

Implementation Idea

Add one persisted policy-authority field and one read-only authority preflight. Use the result before sandbox creation and before every policy-dependent lifecycle operation.

Place a central guard before policy set and update commands. Also guard higher-level workflows before they change adjacent state. If the authority changes between preflight and mutation, classify the structured ownership denial as final, do not retry, and do not record success.

Cover these paths:

  • Sandbox creation and onboarding
  • Resume, rebuild, recreate, and recovery
  • Snapshot restore and clone
  • Policy preset and messaging-channel changes
  • Managed Model Context Protocol policy changes
  • Shields transitions and recovery
  • Blueprint policy additions

Tests must prove that externally managed and unknown policy authority produce no direct policy mutation, no false registry attribution, and no destructive lifecycle side effects. Tests must also prove that NemoClaw-managed policy behavior is unchanged.

Category

Feature

Checklist

  • I searched existing issues and this is not a duplicate. Duplicate review is pending.
  • I described the problem and desired behavior.

Follow-up: provider-backed APF

Temporarily, APF onboarding supports providerless sandboxes only. Plans that require model, messaging, or MCP providers must stop before sandbox creation and before any provider or credential effect.

Work with OpenShell upstream on an identity-bound provider attachment API. It must atomically attach to the previously verified immutable sandbox ID and expected resource version; name-only attachment is not sufficient. After that API lands, NemoClaw can enable provider-backed APF onboarding and validate the normal model/MCP lifecycle.

Activity

  1. added
    needs: triage
    on Aug 20, 2026
  2. removed
    needs: triage
    on Aug 21, 2026
  3. apurvvkumaria commented on Aug 21, 2026

    @apurvvkumaria
    CollaboratorAuthor

    Maintainer product decision

    Status: accepted.

    NemoClaw supports externally managed OpenShell policy as a lifecycle mode for issue #9833 and PR #9899.

    • OpenShell policy metadata is the authority signal. Sandbox policy means NemoClaw-managed. An active global policy means externally managed.
    • Before a sandbox exists, NemoClaw uses the bounded global policy-history result and strict global policy metadata. Missing, malformed, unavailable, or contradictory metadata fails closed.
    • Externally managed policy is verification-only. NemoClaw must not set, remove, or attribute that policy.
    • NemoClaw must verify required effective policy entries before policy-dependent or destructive lifecycle operations.
    • NemoClaw must persist the authority decision and revalidate it at mutation boundaries.
    • Legacy state without recorded authority must not default to NemoClaw-managed.
    • The supported lifecycle includes onboarding, rebuild, snapshot and restore, messaging, MCP, Shields, and blueprint operations.
    • Security review is owned by @apurvvkumaria. Required repository security checks and maintainer review must pass before merge.
    • Required validation includes CLI and plugin checks, managed and external authority tests, fresh-gateway coverage, lifecycle recovery tests, managed-image startup, MCP discovery, generic-GPU E2E, and security review.
    • Public documentation can use the repository Docs / Post-Merge Catch-Up workflow. Owning repository guidance remains part of the code-changing PR.

    Technical remediation of PR #9899 may resume under this accepted design decision.

  4. added
    area: install
    on Aug 21, 2026
  5. added theissue type on Aug 21, 2026
  6. added
    area: onboarding
    area: policy
    area: sandbox
    on Aug 21, 2026
  7. apurvvkumaria commented on Aug 25, 2026

    @apurvvkumaria
    CollaboratorAuthor

    Superseding maintainer product decision

    Status: accepted.

    This decision supersedes the earlier statement that every sandbox-scoped policy is NemoClaw-managed. All other lifecycle, security review, and validation requirements in the earlier decision remain in force.

    • policy_source: sandbox identifies policy scope. It does not prove that NemoClaw created or owns the policy.
    • NemoClaw may mutate a sandbox-scoped policy only when a durable NemoClaw creation receipt matches the OpenShell gateway, immutable sandbox identity, and verified effective policy identity.
    • A sandbox policy without a matching receipt has unknown ownership. NemoClaw must leave it unchanged and must not infer or persist NemoClaw ownership.
    • An operator-selected APF mode is supported as an external-policy workflow. NemoClaw creates the sandbox without a caller policy, then immediately verifies the required effective policy entries before later provider, credential, service, registry, or completion effects.
    • OpenShell 0.0.85 does not expose client-verifiable APF provenance. NemoClaw must not label the policy as verified APF authority. It records the policy as non-NemoClaw and read-only.
    • Missing, malformed, insufficient, or changed effective policy fails closed. Post-create failure uses exact sandbox identity for cleanup or reports the surviving sandbox and incomplete cleanup.
    • PR fix(policy): enforce external policy authority #10049 owns the durable NemoClaw creation receipt and unknown-policy mutation guard.
    • PR fix(onboard): preserve external policy authority #10115 owns the generic no-policy create, immediate post-create verification, and exact-identity cleanup boundary.
    • A separate APF PR owns operator selection and use of that generic boundary.
    • Positive authenticated APF provenance remains deferred until APF or OpenShell defines a trusted issuer, key-discovery, sandbox, gateway, policy binding, and enforcement-timing contract.
    • Issue Respect externally managed sandbox policy across lifecycle operations #9833 remains open until all lifecycle slices and the APF workflow merge and pass the required validation.
  8. apurvvkumaria commented on Aug 26, 2026

    @apurvvkumaria
    CollaboratorAuthor

    Provider attachment identity boundary

    The #10332 follow-up confirmed a remaining OpenShell dependency for credential-bearing provider attachment.

    • The supported OpenShell attachment operation identifies the sandbox by mutable name and resource version. It does not accept the immutable sandbox ID in the same authoritative mutation.
    • A separate NemoClaw identity check cannot close the race: the sandbox name can be rebound after verification and before attachment, causing credentials to reach a different sandbox.
    • Until OpenShell provides an attachment operation atomically bound to immutable sandbox identity, NemoClaw must fail closed before provider attachment. It must retain the sandbox, sandbox registry entry, onboarding session, and durable incomplete checkpoint; it must not report completion or destroy a sandbox by mutable name.
    • Required regression evidence: same-name substitution causes zero provider attachments and zero later provider, credential, registry, or completion effects; the durable identity fingerprint remains available for recovery.

    This constraint applies to the generic deferred-effects boundary and the APF workflow. APF policy verification can succeed independently, but any required provider attachment remains incomplete until an identity-bound OpenShell mutation is available.

    Source review: #10332 and the exact security finding. A focused NemoClaw follow-up will implement the fail-closed behavior; positive completion remains dependent on the OpenShell API capability.

  9. apurvvkumaria commented on Aug 27, 2026

    @apurvvkumaria
    CollaboratorAuthor

    Follow-up cleanup: one owner for deferred sandbox effects

    • Consolidate duplicated deferred-effect intent construction into one production owner.
    • Derive deferred-effect behavior directly from the selected interceptor mode.
    • Remove unreachable post-create provider-attachment helpers and redundant tests.
    • Preserve current behavior: ordinary provider-backed onboarding succeeds; interceptor plans that need providers refuse before credential, provider, route, or sandbox effects; providerless interceptor creation remains supported.
    • Acceptance evidence: focused behavior tests remain green, repository ownership checks identify one intent owner, and refusal produces zero provider or credential effects.

    This is nonblocking maintainability work. It is deferred until after #10396 qualification.

  10. apurvvkumaria commented on Aug 30, 2026

    @apurvvkumaria
    CollaboratorAuthor

    Closing as superseded by #10514, delivered in #10515. The durable NemoClaw policy-authority and receipt design described here is no longer the accepted direction. Independent provider inspection hardening continues in #10621. Provider-backed APF still requires an OpenShell API that binds provider attachment to immutable sandbox identity and the expected resource version; track that upstream dependency separately.

  11. added
    area: security
    on Nov 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area: installarea: onboardingarea: policyarea: sandboxarea: security

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions