Sandbox host context and local services — investigation

This records an operational gap observed while using Codex: a command may be safe and correct on the host but fail from the managed sandbox because it is in a different network namespace. The aim is to make the correct execution context explicit and repeatable without weakening sandbox isolation.

Observed behaviour

Current safe operating rule

Keep the sandbox as the default. For a known host-local service, use its approved local client or localhost endpoint in the host execution context only; do not substitute direct remote SSH simply because the sandbox cannot reach a loopback socket.

Proposed improvements to investigate

IdeaBenefitOpen question
Local-service registryOne short record per service: localhost address/socket, purpose, supported client, health probe, data classification and whether host context is required.Where it should live and how agents discover it without loading a large shell profile.
Explicit host-local execution classA narrow, auditable path for approved localhost clients such as notes and WebDAV, distinct from broad unsandboxed networking.Whether the execution system can enforce a localhost-only or named-command allowlist.
Non-interactive client wrapperInstall a real notes command on PATH rather than relying on aliases in interactive shell startup files.Choose command name, configuration source and how it selects public/private stores.
Preflight helperBefore a tool call, report sandbox visibility, host listener state and the correct command/context.How to expose host socket state safely without giving arbitrary host process visibility.
Unix-domain socket optionFor a single trusted local API, a specifically mounted Unix socket may be simpler than TCP and network-namespace exceptions.Authentication, mount permissions and whether it is preferable to the existing stunnel route.
Target inventory guardMake local, personal and infrastructure host classes explicit so an agent cannot use a similarly named but irrelevant host as a shortcut.Best authoritative source and how destructive/remote tools consume it.

Small validation plan

  1. Record the existing private-notes and WebDAV paths in the registry, with a harmless read-only health check for each.
  2. Prototype a non-interactive notes wrapper using the existing local stunnel; confirm reads and writes work without SSH to the service host.
  3. Add a preflight that demonstrates the expected distinction: sandbox cannot see the host-only listener; host context can.
  4. Decide whether a narrowly scoped host-local execution class or a mounted Unix socket gives the clearer security boundary.
  5. Document the chosen route in the agent operating guidance, including the rule against direct-SSH bypasses.

Relationship to existing design

This is an operational complement to the broader sandbox design. It does not propose giving the sandbox unrestricted network access. The broader design already considers a Unix-domain socket for a fixed local service and a tightly controlled network path for other destinations.

Non-goals

version 2  ·  created 2026-09-07  ·  updated 2026-09-07  ·  tags sandbox, local-services, stunnel, operations, ideas