Skip to content

codex-implementer: handle sandbox write-denial (fail loud, opt-in fallback) - #5

Open
pandaofwild wants to merge 1 commit into
DannyMac180:mainfrom
pandaofwild:fix/codex-sandbox-readonly-fallback
Open

codex-implementer: handle sandbox write-denial (fail loud, opt-in fallback)#5
pandaofwild wants to merge 1 commit into
DannyMac180:mainfrom
pandaofwild:fix/codex-sandbox-readonly-fallback

Conversation

@pandaofwild

Copy link
Copy Markdown

Problem

On some hosts — reproduced on Windows 10 — codex's sandbox setup helper fails to grant the workspace write ACE (SetNamedSecurityInfoW failed: 5 in ~/.codex/.sandbox/sandbox.*.log) and then caches the failure: it never re-attempts the grant, so every codex exec --sandbox workspace-write run has the model report "the workspace is read-only and write approval is disabled" and produce no diff. The codex-implementer lane is permanently dead on such hosts, and the agent's current instructions give it no way to explain why or recover.

Change

agents/codex-implementer.md:

  • Documents the failure signature (read-only message + empty git status).
  • On that signature the agent now either:
    1. returns STATUS: unavailable with REASON: sandbox denied writes …, the exact codex message, and host remediation hints (one elevated codex run so the helper's ACE grant succeeds; or restart codex daemons / clear ~/.codex/.sandbox cache), or
    2. — only when the caller's spec explicitly contains sandbox-fallback: allowed — retries once with --sandbox omitted, deferring to the operator's own sandbox_mode in ~/.codex/config.toml, and adds SANDBOX: downgraded to user-config (workspace-write denied) to the report.
  • workspace-write remains the unconditional first attempt; nothing starts at danger-full-access, and no fallback is ever silent.

skills/orchestration/SKILL.md:

  • Notes the recoverable unavailable case and the explicit opt-in line, so the architect knows the escape hatch exists instead of just rerouting.

Why this shape

The lane's contract is "loud failure over silent substitution". This keeps that: the safe sandbox stays the default, the fallback requires an explicit per-spec opt-in from the caller (who is in the best position to know the operator accepted their own codex sandbox config), and the report always discloses the downgrade.

🤖 Generated with Claude Code

On some hosts (observed on Windows) codex's sandbox setup helper fails
to grant the workspace write ACE and caches the failure, so every
--sandbox workspace-write run reports the workspace as read-only and
the lane stays dead with no explanation.

Teach codex-implementer to recognize that signature and either return
STATUS: unavailable with the exact cause and host remediation hints, or
— only when the caller's spec explicitly includes
"sandbox-fallback: allowed" — retry once under the operator's own
configured sandbox mode, marking the report SANDBOX: downgraded so the
change is never silent. Document the recoverable case in the
orchestration skill.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05a16dea40

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +92 to +94
retry once with the operator's own configured sandbox mode by omitting the
`--sandbox` flag entirely (codex then uses `sandbox_mode` from
`~/.codex/config.toml`, which the machine owner chose deliberately). Add

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Avoid fallback through project Codex config

When a trusted repo contains .codex/config.toml, omitting --sandbox does not necessarily use the machine owner's ~/.codex/config.toml; Codex's configuration precedence lists Project config files: .codex/config.toml ahead of User config: ~/.codex/config.toml. In the sandbox-denial path this can make an opted-in fallback run under a repository-supplied sandbox/approval mode, including broader access, while the report says it used user-config, so the downgrade is not actually explicit to the operator.

Useful? React with 👍 / 👎.

chiptuned added a commit to chiptuned/fable-advisor that referenced this pull request Jul 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant