Skip to content

feat(gateway/sandbox): support arbitrary gateway-to-sandbox runtime settings over SandboxConfig #405

@johntmyers

Description

@johntmyers

Problem Statement

Issue #393 currently combines two concerns:

  1. OCSF logging integration in openshell-sandbox (the primary deliverable)
  2. A broader gateway -> sandbox operational settings channel via SandboxConfig

The OCSF work only requires a narrow config shape (config_revision + logging.ocsf_enabled) to support hot-reload. Expanding #393 to define and implement a general arbitrary-settings channel increases implementation risk, review scope, and delivery time for the logging migration.

We need a dedicated follow-up issue for designing and implementing a robust gateway -> sandbox arbitrary settings mechanism on top of the existing policy poll response channel.

Proposed Design

Implement a generalized settings channel in the SandboxConfig transport path, separate from #393:

  • Keep transport path: GetSandboxPolicyResponse.sandbox_config
  • Keep revision semantics: gateway maintains a monotonic config_revision; sandbox applies only newer revisions
  • Add a dedicated settings payload for arbitrary runtime settings, using a namespaced key/value model with typed values
  • Define sandbox-side apply semantics:
    • unknown keys are ignored safely
    • invalid values are rejected with structured log output
    • partial apply does not roll back unrelated valid keys
  • Keep backward compatibility:
    • older gateway (no arbitrary settings payload) remains no-op
    • older sandbox ignores unknown payload fields from newer gateway

Delivery should include:

  • Proto schema update for arbitrary settings payload
  • Gateway config source plumbing and response population
  • Sandbox apply loop integration and revision tracking
  • Unit tests for backward compatibility and apply semantics
  • E2E test covering runtime update without sandbox restart
  • Documentation update in architecture/ and user-facing docs where relevant

Alternatives Considered

  1. Keep arbitrary-settings work inside feat(sandbox): integrate openshell-ocsf crate with dual-file output, OCSF toggle config, and log site migration #393

    • Rejected because it couples a large schema/control-plane change to the OCSF migration, increasing risk and delaying primary logging outcomes.
  2. Add only more typed fields immediately (no generic settings payload)

    • Rejected because each new runtime setting would require another proto/control-plane roundtrip and repeated plumbing work.
  3. Send untyped JSON blobs only

    • Rejected because it weakens validation, compatibility guarantees, and observability of invalid config.

Agent Investigation

  • Reviewed #393 and confirmed it already introduces SandboxConfig on GetSandboxPolicyResponse with revision-driven hot-reload.
  • Confirmed #393 currently frames SandboxConfig as a general-purpose operational config channel while also carrying the OCSF migration and 93-site logging refactor.
  • This split keeps #393 focused on OCSF deliverables and moves generalized settings-channel design into an independent issue.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions