cc-plugin-codex icon indicating copy to clipboard operation
cc-plugin-codex copied to clipboard

Built-in forwarders run Claude without network escalation

Open behruznassre opened this issue 4 months ago • 1 comments

Summary

Built-in rescue forwarding can launch claude-companion.mjs task inside Codex's default workspace-write sandbox without requesting network escalation. The companion starts Claude Code successfully, but Claude cannot resolve its API endpoint and eventually returns:

API Error: Unable to connect to API (ENOTFOUND)

The same boundary also applies to the built-in review and adversarial-review forwarders.

Environment

  • cc-plugin-codex 1.3.0 installed as cc@sendbird
  • Claude Code 2.1.216
  • macOS Codex session using sandbox_mode = "workspace-write"
  • approval_policy = "on-request"
  • approvals_reviewer = "auto_review"
  • plugin data root is writable, but sandbox_workspace_write.network_access is not enabled

Confirmed evidence

Six tracked rescue tasks across two repositories failed with the same ENOTFOUND result between 2026-07-17 and 2026-07-21.

A representative task made ten API retries over 173 seconds before failing. Its tracked result is a normal Claude failure payload, not a setup/auth failure.

Network comparison in the same Codex session:

  • sandboxed official-doc fetch: curl: (6) Could not resolve host: developers.openai.com
  • escalated official-doc fetch: succeeded
  • sandboxed rescue companion: Claude returned ENOTFOUND
  • the same installed Claude binary invoked with targeted escalation: returned OK in 3.5 seconds

This isolates the failure to the outer Codex command sandbox. Claude authentication and API availability are healthy.

Root cause

The public rescue/review/adversarial-review skills require the forwarding subagent to run exactly one blocking exec_command call, but they do not require that call to request escalated sandbox permissions.

Codex subagents inherit the parent's sandbox. In the default workspace-write mode, spawned commands have no outbound network unless configuration enables it or the command explicitly requests escalation. Because version 1.3.0 setup grants the plugin data root as writable, the companion command no longer encounters a filesystem boundary that would otherwise force escalation; it runs successfully inside the network-disabled sandbox and Claude's API DNS lookup fails.

Expected behavior

The forwarding contract should tell the transient child to run the one companion command with targeted escalated sandbox permissions and a scoped justification. This lets the existing approval policy or auto-review gate the networked command without requiring users to enable global command networking.

Proposed fix

  • Update rescue, review, and adversarial-review public skill contracts to require exec_command with sandbox_permissions: "require_escalated" and a concise Claude-network justification.
  • Keep exactly-one-command, blocking, non-interactive execution unchanged.
  • Mirror the requirement in the shared rescue/review runtime references.
  • Add contract and E2E assertions so forwarding children cannot regress to use_default.

Why not global network_access = true

That user-level workaround expands outbound network access for every sandboxed command in every project. A companion-scoped escalation is narrower and leaves the user's normal Codex sandbox policy intact.

behruznassre avatar Jul 21 '26 01:07 behruznassre

Shipped in v1.4.0, now on npm as [email protected] and in the sendbird/codex-marketplace snapshot. Update with $cc:setup after your Codex plugin cache refreshes.

Note that 1.4.0 also fixes a separate Codex 0.145 incompatibility (#87): spawn_agent stopped advertising agent_type and dropped gpt-5.4-mini from its child-model catalog, both of which the built-in forwarding paths pinned. If you saw background review/rescue spawns failing on 1.3.0 beyond the sandbox issues above, that was the cause.

sf-jin-ku avatar Jul 29 '26 07:07 sf-jin-ku