Repository navigation
Description
The workflow
While configuring a Codex thread, I want to select the same named permission profile I use in Codex, including :workspace or a custom managed profile.
The profile should remain provider-owned. BB should extend it only with the roots needed for the current environment, such as the workspace, Git metadata, thread storage, and configured host roots.
Existing Codex UI
Codex Desktop lists named permission profiles beside its built-in approval choices. The same workspace-dev profile defined in config.toml appears as a selectable option.
What happens today
BB exposes generic permission modes in the composer. The Codex bridge translates those modes into workspace-write or danger-full-access and adds writable roots through sandbox_workspace_write.writable_roots.
The UI cannot discover or select Codex named profiles. Users must reproduce their policy through BB's generic modes or change Codex configuration outside the thread workflow.
For our use case, workspace-dev extends :workspace, then grants the developer cache and toolchain roots that sandboxed builds need:
default_permissions = "workspace-dev"
[permissions.workspace-dev]
description = "Workspace access plus developer caches and network access."
extends = ":workspace"
[permissions.workspace-dev.workspace_roots]
"~/.local/share/mise" = true
"~/Library/Caches/mise" = true
"~/.bun/install/cache" = true
"~/.cache" = true
"~/.npm" = true
"~/go/pkg/mod" = true
"~/.proto" = true
"~/.codex" = true
[permissions.workspace-dev.network]
enabled = trueCodex does not combine permission profiles with the legacy sandbox configuration that BB currently supplies:
sandbox_mode = "workspace-write"
[sandbox_workspace_write]
writable_roots = ["/path/to/additional/root"]What you would expect
For providers that advertise named permission profiles:
- The execution controls list the available profiles.
- A selected profile becomes the provider-native permission policy instead of a competing sandbox mode.
- BB overlays its required runtime roots without changing the stored profile.
- The selection carries through thread creation, follow-ups, queued messages, forks, and project defaults.
- The CLI and SDK can list and select the same profiles.
Providers without profile support should continue to use the existing permission modes.
AGENT GENERATED
Context and alternatives
No response
Checks
- I searched open and closed issues for the same request.
- If an agent wrote this, the body ends with
> AGENT GENERATED.
Activity
Ernxst commentedon Sep 29, 2026
Another case for this, from bb 0.43.4 with Codex CLI 0.157.1 on macOS.
My
default_permissionsprofile adds the tool caches that sandboxed builds write to:In a bb thread, the per-turn
sandbox: "workspace-write"andsandbox_workspace_write.writable_rootsreplace that profile, so none of those roots are writable and ordinary commands fail:The only workaround I found is moving the caches into roots bb does grant, through
[shell_environment_policy.set], which bb merges rather than replaces:With these set,
node -vandbun installpass; unset them and both fail as above. MovingMISE_STATE_DIRalso moves mise's trust records out of the user's state directory. With the profile honoured as this issue describes, none of this would be needed.fangerya commentedon Dec 2, 2026
Another case, with pnpm 12, on bb 0.51.0 and codex-cli 0.173.0, on macOS and Linux.
The Codex sessions bb starts get the workspace and the thread storage as writable roots. The user's
sandbox_workspace_write.writable_rootsfrom~/.codex/config.tomlis not applied, as thesandbox_policyin each session's rollout file shows. Our list there includes the pnpm store.pnpm 12 has a deliberate fallback for this. When no folder above the project accepts a hard link, it creates its store at
<project>/node_modules/.pnpm-store. In a checkout installed from the shared store, the next install under Codex therefore switches stores. It emptiesnode_modulesand downloads every package again. WithverifyDepsBeforeRun: install, a read-onlypnpm <script> --helpwas enough to start this, and an interrupted run leftnode_moduleshalf empty.Setting
storeDirin pnpm's global config stops the switch, because pnpm can read that file inside the sandbox. A Codex thread still cannot add a package that is not in the store yet. The install fails withFailed to write cafs ... Operation not permitted. With the proposal here, bb would extend the user's Codex policy with its roots, and the store would stay writable.