Skip to content

feat(ce-work-beta): add user-selectable sandbox options to Codex delegation#364

Open
huntharo wants to merge 3 commits intoEveryInc:mainfrom
huntharo:claude/elated-mestorf
Open

feat(ce-work-beta): add user-selectable sandbox options to Codex delegation#364
huntharo wants to merge 3 commits intoEveryInc:mainfrom
huntharo:claude/elated-mestorf

Conversation

@huntharo
Copy link
Copy Markdown

@huntharo huntharo commented Mar 24, 2026

Summary

Add a security posture selection step to the Codex External Delegation Workflow so users can choose between default, workspace-write, and full-access (--yolo) modes before delegation runs.

Why this matters

Taking over PR #363 after discussing with @mvanhorn .

codex exec with default settings fails on the first operation needing approval (e.g., npm install) because exec mode is non-interactive. That PR proposed hardcoding -s workspace-write -a never, but workspace-write still restricts system-level (and network) access outside the workspace directory. For non-trivial one-shot delegations, --yolo (--dangerously-bypass-approvals-and-sandbox) is the only flag set likely to produce a complete solution -- but it carries real risks (arbitrary file deletion, secret leakage, unapproved command execution).

Rather than hardcoding one posture, this PR lets the user choose with full visibility into the tradeoffs.

Changes

Added step 2 ("Select security posture") to the External Delegation Workflow in plugins/compound-engineering/skills/ce-work-beta/SKILL.md:

  • Default (no flags) -- Codex defaults. Will almost certainly fail in exec mode.
  • Workspace write (--full-auto) -- -s workspace-write -a on-request. Moderate risk, may still fail for tasks needing system access.
  • Full access (--yolo) -- --dangerously-bypass-approvals-and-sandbox. Explicit risk warnings about data deletion, secret leakage, and unapproved commands. Only option likely to work for non-trivial exec-mode delegation.

The choice is asked once per session via the platform's blocking question tool (with numbered-list fallback for platforms without one). Renumbered subsequent steps (old 2-7 -> new 3-8).

Supersedes #363.

Testing

Tested via claude-code-ce script that loads updated plugin into claude code CLI, then giving the problem below and checking before/after.

There is an additional oddity uncovered: it tries to redirect the prompt file into codex and this fails and it ends up reading help messages several times then deciding to just emit the full prompt in the command line string - other times it randomly decides to cat the plan and pipe it to codex, which appears to work.

Test Prompt

/ce:work-beta Run `npm view dive` via Codex.

Before - Does Not Prompt / Simply Fails to Exit Codex Sandbox

After - Prompts for Mode

image

After - Yolo Selected - Runs with dangerously-bypass-approvals-and-sandbox

image

After - Yolo Selected - Gets Result

image

After - Workspace Write Selected - Runs with full-auto

image

After - Workspace Write Selected - Fails on Network

image

Copy link
Copy Markdown

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

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: 476feb89d3

ℹ️ 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".

@huntharo
Copy link
Copy Markdown
Author

I ran this last night via the wrapper shell script and built a full stack app in about 45 minutes from Claude using Codex to do the build.

@mvanhorn
Copy link
Copy Markdown
Contributor

@huntharo That's great to hear - full stack app in 45 minutes is a solid validation of the Codex delegation flow. Any rough edges or things that could be smoother?

@tmchow
Copy link
Copy Markdown
Collaborator

tmchow commented Mar 30, 2026

@huntharo can you rebase off main as i've merged a lot in. I'd like to figure out a path to get this into the main ce:work skill instead of maintaining it as separate provided we can get enough testing it. Given how big of a boost this is, it's helpful to converge.

One thing to consider is whether we should store a user preference for always running codex mode when the skill is invoked from claude code. remember that we are cross agent env compatible by design so running codex mode from within codex won't make sense. I'm planning on moving preferences sometime soon out of the compound-engineering.local.md and instead moving it to something like ~/.compound-engineering/config.json (or config.yaml). but for now, propose a preference setting that the skill optionally reads from? it can fallback to conservative if setting is missing and only use codex mode if user invoked skill mentioning it.

@huntharo huntharo force-pushed the claude/elated-mestorf branch from 805609b to 1ae9270 Compare March 30, 2026 23:09
@huntharo
Copy link
Copy Markdown
Author

@huntharo can you rebase off main as i've merged a lot in. I'd like to figure out a path to get this into the main ce:work skill instead of maintaining it as separate provided we can get enough testing it. Given how big of a boost this is, it's helpful to converge.

One thing to consider is whether we should store a user preference for always running codex mode when the skill is invoked from claude code. remember that we are cross agent env compatible by design so running codex mode from within codex won't make sense. I'm planning on moving preferences sometime soon out of the compound-engineering.local.md and instead moving it to something like ~/.compound-engineering/config.json (or config.yaml). but for now, propose a preference setting that the skill optionally reads from? it can fallback to conservative if setting is missing and only use codex mode if user invoked skill mentioning it.

Should be all done @tmchow - I have my Codex doing a code review too just in case it finds anything.

Copy link
Copy Markdown

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

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: 1ae927038f

ℹ️ 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".

@huntharo huntharo force-pushed the claude/elated-mestorf branch from 1ae9270 to 05f0b79 Compare March 31, 2026 01:42
@tmchow
Copy link
Copy Markdown
Collaborator

tmchow commented Mar 31, 2026

@huntharo address the relevant codex feedback

huntharo and others added 2 commits March 31, 2026 07:26
…gation

The delegate step told the agent to run Codex without specifying sandbox
or approval flags. Users without permissive global Codex config saw
delegation fail on the first network operation (e.g., npm install).

PR EveryInc#363 proposed hardcoding `-s workspace-write -a never`, but
one-shotting via `codex exec` likely needs `--yolo` for non-trivial
tasks since workspace-write still restricts system-level access.

Add a new step 2 to the External Delegation Workflow that presents
three security posture options:

- Default (no flags) -- uses Codex defaults, will likely fail in exec mode
- Workspace write (--full-auto) -- moderate access, may still fail
- Full access (--yolo) -- disables all restrictions, with explicit risk
  warnings about data deletion, secret leakage, and unapproved commands

The choice is asked once per delegation session and applied to all
delegated tasks. Uses cross-platform question tool with numbered-list
fallback per the skill checklist.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Codex review correctly flagged that in --yolo mode the sandbox is
disabled, so the delegate CAN write to .git/index.lock. Updated step 7
to clarify the sandbox only blocks commits in default and
workspace-write modes; in yolo mode, the prompt instruction is what
prevents the delegate from committing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@huntharo huntharo force-pushed the claude/elated-mestorf branch from 05f0b79 to c0f7192 Compare March 31, 2026 11:26
Copy link
Copy Markdown

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

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: c0f7192c8e

ℹ️ 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".

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.

3 participants