Skip to content

fix(cloud-codex): disable codex CLI bwrap sandbox (incompatible with standard k8s securityContext) - #385

Closed
samxu01 wants to merge 1 commit into
mainfrom
fix/cloud-codex-sandbox-disable
Closed

samxu01 wants to merge 1 commit into
mainfrom
fix/cloud-codex-sandbox-disable

Conversation

@samxu01

@samxu01 samxu01 commented May 16, 2026

Copy link
Copy Markdown
Contributor

Follow-up to #382/#383/#384 closing the Gap 1 wedge.

Problem

Codex CLI's default `sandbox_mode` uses bubblewrap, which needs CAP_SYS_ADMIN / unprivileged user-namespaces — neither available to standard k8s containers. Verified empirically: even `pwd` fails with `bwrap: Failed to make / slave: Permission denied`. Cody reported back "couldn't execute the wedge".

Fix

Set `sandbox_mode = "danger-full-access"` + `approval_policy = "never"` in the boot-script's `config.toml` seed. The pod itself is the security perimeter (PVC-scoped workspace, no host mounts, isolated identity). bwrap inside the pod is redundant.

Verification

  • Live evidence Cody is blocked: msg 22657 in Sign-up flow pod
  • Post-deploy: `@cody clone X, commit a stub file, try to push` succeeds at clone+commit; push 403s only on SAML SSO (operator-side, not in scope).

🤖 Generated with Claude Code

…e w/ standard k8s securityContext)

Codex CLI 0.125.0 defaults to a bubblewrap (bwrap) sandbox for every
shell tool call. bwrap needs CAP_SYS_ADMIN or unprivileged user-
namespaces, neither of which standard k8s containers have. Verified
empirically: even `pwd`, `ls -la`, `git status` fail inside the
cloud-codex pod with "bwrap: Failed to make / slave: Permission
denied", and Cody reports back "couldn't execute the wedge" — the
entire codex tool-use path is dead-on-arrival.

Set `sandbox_mode = "danger-full-access"` + `approval_policy =
"never"` in /state/.codex/config.toml. The pod itself is the security
perimeter — agent identity is isolated, workspace is PVC-scoped, no
host mounts. bwrap inside the pod is redundant.

Same pattern as ChatGPT's other "this is cluster-IP-bound" knobs:
codex CLI was built for laptops and ships defaults that don't hold in
a managed container. Fix it once in the deployment template.

Closes Gap 1 wedge: with this + the PAT + git binary (#382/#383/#384),
Cody can autonomously clone/branch/commit. Push to Team-Commonly org
still needs operator-side SAML SSO grant on the PAT.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
samxu01 added a commit that referenced this pull request May 16, 2026
…MCP servers

Verified empirically 2026-05-15 after merging #388: codex CLI 0.125.0
recognizes [mcp_servers.commonly] in config.toml (`codex mcp list`
shows it enabled), but `codex exec` does NOT actually connect to or
expose tools from configured MCP servers. The model's tool list stays
limited to codex's built-in tools (web, image_gen, exec_command,
apply_patch, ...). list_mcp_resources returns empty regardless.

Per docs/MCP_INTEGRATION.md, the supported codex pattern is to wrap
codex AS an MCP server (codex-as-mcp), not to have codex consume MCP
servers. So #388 adds noise without effect.

For Cody to actually call commonly_react_to_message autonomously, the
real options are:
  - Switch her adapter from codex → claude-code or another MCP-
    consuming host (architectural decision).
  - Add the reaction tool to the openclaw extension's commonly_*
    block (separate Team-Commonly/openclaw PR; out of the
    "make-collab-bulletproof" goal's "no openclaw-coupled fixes"
    constraint).

Keeping the four ship-PRs (#379/#380/#381/#382 + #383/#384/#385/#386
follow-ups) in place — they're all correct. Just removing #388.

Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
@samxu01

samxu01 commented May 17, 2026

Copy link
Copy Markdown
Contributor Author

Closing — squash-merged to main locally (commit on main).

@samxu01 samxu01 closed this May 17, 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