Skip to content

feat(gateway): workspace-scoped settings with overridable global defaults #6221

Description

@purp

User Story

I use OpenShell on a shared, multi-user Kubernetes gateway. I keep my persistent development sandboxes in a dedicated workspace. The gateway administrator sets proposal_approval_mode = auto globally, which suits most users. For my workspace I need manual, so that a denied connection from one of my sandboxes is never added to its policy without my review. I can't set that today.

Problem Statement

Settings have two scopes, gateway-global and per-sandbox, and a global value locks the key for every sandbox. There's no workspace scope. A workspace owner can't set a value for all of their sandboxes, and a gateway administrator can't set a default that some workspaces may tighten.

Impact / Why This Matters

  • Once a key is set globally, every sandbox gets that value. openshell settings set <sandbox> --key proposal_approval_mode --value manual fails with setting 'proposal_approval_mode' is managed globally; delete the global setting before sandbox update.
  • The administrator has to choose between one value for every user and no default at all. Workspaces are meant to be isolation boundaries, but their owners can't make security-relevant choices for their own sandboxes.
  • Even without a global value, a workspace owner has to set each key on each sandbox, and new sandboxes start without them. A missed sandbox silently gets the gateway default.
  • Auto-approval is a security control, so the gap matters: a workspace that holds sensitive credentials or long-lived agents can't opt into human review on a gateway where others rely on auto-approval.

Proposed Design

Add a workspace scope for settings, resolved between global and sandbox, and let a global value be either a lock (today's behavior) or an overridable default. Notional CLI:

# Gateway administrator: a default that workspaces may override
openshell settings set --global --overridable --key proposal_approval_mode --value auto

# Workspace owner: applies to every sandbox in the workspace, current and future
openshell --workspace team-a settings set --workspace-scope --key proposal_approval_mode --value manual
openshell --workspace team-a settings get --workspace-scope
openshell --workspace team-a settings delete --workspace-scope --key proposal_approval_mode

# The effective value shows where it came from
openshell --workspace team-a settings get my-sandbox
#   proposal_approval_mode = manual (workspace)

Resolution order: a locking global value applies everywhere. Otherwise the sandbox value applies if set, then the workspace value, then the overridable global default. Workspace members with write access manage their workspace's settings. Global settings keep their current authorization.

Acceptance Criteria

  • Workspace-scoped settings can be set, read and deleted through the API and CLI.
  • A sandbox's effective settings show whether each value came from global, workspace or sandbox scope.
  • A locking global value still overrides workspace and sandbox values, as today.
  • An overridable global value yields to workspace and sandbox values.
  • Changing a workspace setting reaches running sandboxes in that workspace the same way a global change does.
  • Users without access to a workspace can't read or change its settings.
  • Existing global settings keep their current locking behavior unless an administrator marks them overridable.

Alternatives Considered

  • Per-sandbox settings: blocked when the key is set globally. Otherwise it has to be repeated for every sandbox, and new sandboxes miss it.
  • Sandbox workload templates: a template carries workload shape (image, resources, labels, environment, driver config), not gateway settings, so it can't set proposal_approval_mode.
  • A gateway interceptor or supervisor middleware that rejects proposals for some workspaces: possible, but it would reimplement settings resolution beside the settings system, and the effective value would no longer show in settings get.
  • A separate gateway per workspace owner: gives the control, but defeats a shared gateway and multiplies operations.

Agent Investigation

Code findings at 34fc27738:

  • proto/sandbox.proto:415: SettingScope has only SETTING_SCOPE_SANDBOX and SETTING_SCOPE_GLOBAL.
  • proto/datamodel.proto:84: Workspace carries only metadata and status, with no settings or configuration.
  • crates/openshell-server/src/grpc/policy.rs:4573 and :4614: setting or deleting a sandbox value fails when the key exists in global settings, so global values are always locks.
  • proto/openshell.proto:1273: SandboxTemplate has no settings fields.

Activity

  1. self-assigned this
    on Dec 4, 2026
  2. added theissue type on Dec 4, 2026
  3. purp commented on Dec 4, 2026

    @purp
    ContributorAuthor

    A related gap in the same shared-gateway setting: provider credentials.

    With the openshell-driver-db-credstore credential driver, provider secrets (GitHub tokens, model OAuth grants, API keys) sit in the gateway's database, where anyone who administers the gateway or its cluster can read them. On a shared gateway a workspace owner may need some credentials that even platform administrators can't read, while still letting the gateway inject them into that workspace's sandboxes.

    This may belong in its own issue, but it fits a workspace-level configuration story: a workspace could choose a credential driver or protection mode, for example credentials encrypted to a key the workspace owner controls and released only to that workspace's sandboxes at injection time. The acceptance test would be that a gateway or cluster administrator who isn't a member of the workspace can't recover a provider credential's value, and that this can be verified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions